:root {
  --bg: #f5f6fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fafbff;
  --text: #141821;
  --text-soft: #5a6472;
  --muted: #7b8594;
  --line: #e6e9ef;
  --line-strong: #d2d8e3;
  --brand: #e94f77;
  --brand-2: #9a3f78;
  --brand-strong: #8f3f63;
  --brand-text: #ffffff;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ink: #181f2a;
  --shadow-sm: 0 10px 24px rgba(18, 24, 40, 0.06);
  --shadow: 0 18px 45px rgba(18, 24, 40, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --container: min(1340px, calc(100% - 32px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 14% -12%, #f9e6ef 0%, transparent 40%),
    radial-gradient(circle at 94% -12%, #e7f0ff 0%, transparent 42%),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

body.layout-desktop .mobile-cart-cta {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
  line-height: 1.2;
  touch-action: manipulation;
  user-select: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  transform: none !important;
}

input,
select,
textarea,
button {
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #5875ff;
  outline-offset: 2px;
}

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

@media (prefers-reduced-motion: no-preference) {
  * {
    transition-property: color, background-color, border-color, transform, box-shadow;
    transition-duration: 0.22s;
    transition-timing-function: ease;
  }
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-soft) !important;
}

.site-compliance {
  width: var(--container);
  margin: 18px auto 32px;
  padding: 12px 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.site-icp-link {
  color: inherit;
  text-decoration: none;
}

.site-icp-link:hover {
  color: var(--brand-strong);
}

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

h1 {
  line-height: 1.12;
  font-weight: 800;
}

h2 {
  margin-bottom: 4px;
  font-size: 28px;
  line-height: 1.22;
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.3;
}

p {
  margin-bottom: 0;
  color: var(--text-soft);
}

a {
  color: var(--brand-2);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

main {
  width: var(--container);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(260px, max-content) minmax(180px, 1fr) minmax(150px, 210px) auto auto;
  gap: 12px;
  align-items: center;
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(22, 31, 50, 0.08);
  border-radius: 0 0 12px 12px;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand > div {
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: #fff4ef;
  box-shadow: 0 10px 22px rgba(233, 79, 119, 0.24);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand-en,
.brand small {
  display: block;
  line-height: 1.26;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-en {
  margin-top: 1px;
  color: #8f3f63;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.role-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7f9fc;
  justify-self: start;
}

.role-tab {
  min-height: 34px;
  border-radius: 9px;
  padding: 8px 16px;
  color: #4d5664;
  background: transparent;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.role-tab:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.role-tab.active {
  border-color: transparent;
  background: linear-gradient(165deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 7px 16px rgba(233, 79, 119, 0.22);
}


.operator-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  min-height: 34px;
}

.operator-tab {
  border-color: #f0d4dc;
  color: #8f3f63;
  background: #fff7fa;
}

.operator-tab:hover {
  border-color: #e6b8c6;
  background: #fff;
}

.operator-tab.active,
.operator-tab.active:hover,
.operator-tab.active:focus-visible {
  border-color: transparent;
  background: linear-gradient(165deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 7px 16px rgba(233, 79, 119, 0.22);
}

.operator-tab.active:focus-visible {
  outline: 2px solid rgba(88, 117, 255, 0.72);
  outline-offset: 2px;
}

.operator-tab[hidden] {
  display: none !important;
}

.guest .role-tabs {
  display: none;
}

.guest .topbar {
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 190px) auto minmax(260px, auto);
}

.guest .operator-tabs {
  display: none;
}

.guest .auth-panel {
  grid-column: 3;
}

.store-context {
  display: inline-flex;
  grid-template-columns: minmax(300px, max-content) minmax(220px, 1fr) minmax(170px, 220px) auto;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-width: 0;
  height: 42px;
  padding: 4px 5px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.store-context span,
.store-context small {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-context span {
  color: var(--text);
  flex: 0 0 auto;
  font-weight: 800;
}

.store-context small {
  display: none;
}

.store-context select {
  min-width: 0;
  width: min(132px, 34vw);
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(18, 24, 40, 0.05);
}

.auth-panel {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px;
  align-items: center;
  justify-content: end;
  color: var(--text-soft);
}

body:not(.guest) .auth-panel {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.auth-panel select,
#login-status {
  min-height: 36px;
  min-width: 0;
}

#login-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 120px;
  font-weight: 800;
}

body:not(.guest) #login-status {
  max-width: 240px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(18, 24, 40, 0.05);
}

body:not(.guest) #login-status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

body:not(.guest) #logout-btn {
  min-width: 76px;
  min-height: 38px;
  border-radius: 9px;
  background: transparent;
}

body:not(.guest) #logout-btn:hover {
  background: #fff;
}

.guest .operator-tabs {
  display: none;
}

.guest .auth-panel {
  grid-template-columns: 96px 96px;
  gap: 10px;
  justify-content: end;
}

.guest .auth-panel select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding-right: 14px;
}

.guest .auth-panel #login-status {
  display: none;
}

.guest .auth-panel .primary-btn,
.guest .auth-panel .ghost-btn {
  min-height: 36px;
  padding-inline: 10px;
}

.auth-view {
  min-height: calc(100vh - 92px);
  padding: 26px 0 42px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 460px);
  gap: 20px;
  align-items: stretch;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.auth-identity,
.auth-card {
  border: 1px solid rgba(224, 232, 240, 0.92);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(18, 24, 40, 0.09);
}

.auth-identity {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  background: #111827;
}

.auth-photo {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.06), rgba(17, 24, 39, 0.68)),
    linear-gradient(90deg, rgba(17, 24, 39, 0.18), rgba(189, 62, 105, 0.2)),
    url("assets/flower-market-hero.png") center / cover;
  transform: scale(1.02);
}

.auth-identity-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 570px;
  padding: 42px;
  color: #fff;
}

.auth-brand-mark {
  display: grid;
  gap: 1px;
  width: fit-content;
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-strong);
  font-weight: 950;
}

.auth-brand-mark em,
.hero-brand-lockup em {
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-brand-mark em {
  color: #8f3f63;
  font-size: 11px;
  line-height: 1.2;
}

.auth-identity h1 {
  max-width: 560px;
  margin: 0 0 14px;
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

.auth-identity p:not(.auth-brand-mark) {
  max-width: 600px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 1.8;
}

.auth-benefits,
.auth-trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-benefits {
  margin-top: 26px;
}

.auth-trust-list {
  margin-top: 12px;
}

.auth-benefits span,
.auth-trust-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 850;
}

.auth-benefits span {
  background: #fff;
  color: #173626;
}

.auth-trust-list span {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
}

.auth-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.auth-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.auth-card-kicker {
  margin: 0 0 5px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
}

.auth-card-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8fb;
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #415266;
  font-weight: 850;
  cursor: pointer;
}

.auth-tab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.auth-tab:focus-visible,
.auth-login-form input:focus-visible,
.auth-debug-controls select:focus-visible,
.auth-shop-link:focus-visible {
  outline: 3px solid rgba(189, 62, 105, 0.22);
  outline-offset: 2px;
}

.auth-tab.active {
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(18, 24, 40, 0.08);
}

.auth-panel-view {
  margin-top: 20px;
}

.auth-panel-view[hidden] {
  display: none;
}

.wechat-login-layout {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 206px;
  padding: 18px;
  border: 1px solid #e9eef5;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfdfb 100%);
}

.wechat-qr {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 9px solid #fff;
  border-radius: 14px;
  background:
    linear-gradient(90deg, #10251d 10px, transparent 10px) 0 0 / 27px 27px,
    linear-gradient(#10251d 10px, transparent 10px) 0 0 / 27px 27px,
    #f2fbf6;
  box-shadow: inset 0 0 0 1px rgba(16, 37, 29, 0.1), 0 12px 28px rgba(18, 24, 40, 0.12);
}

.wechat-qr span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 950;
}

.wechat-login-layout h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.wechat-login-layout p {
  margin: 0 0 16px;
  color: #415266;
  line-height: 1.65;
}

.auth-login-form {
  display: grid;
  gap: 15px;
  padding: 18px;
  border: 1px solid #e9eef5;
  border-radius: 14px;
  background: #fff;
}

.auth-login-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 850;
}

.auth-login-form input,
.auth-debug-controls select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
}

.auth-login-form input::placeholder {
  color: #5b6b7d;
}

.phone-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
}

.phone-code-row .ghost-btn {
  min-height: 46px;
  padding-inline: 10px;
}

.auth-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: #415266;
  font-weight: 850;
}

.auth-status[data-tone="success"] {
  color: var(--success);
}

.auth-status[data-tone="error"] {
  color: var(--danger);
}

.auth-debug-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: auto;
  padding: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.9);
  border-radius: 12px;
  background: #f8fafc;
}

.auth-debug-panel[hidden] {
  display: none !important;
}

.auth-debug-panel strong {
  color: #334155;
}

.auth-debug-panel p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.auth-debug-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
}

.auth-shop-link {
  align-self: center;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 900;
  cursor: pointer;
}

.primary-btn,
.ghost-btn,
.icon-btn,
button[type="submit"] {
  min-height: 40px;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(165deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px rgba(233, 79, 119, 0.24);
}

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

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost-btn:hover {
  border-color: #c4cbe0;
  box-shadow: 0 8px 16px rgba(24, 31, 42, 0.06);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
}

.small {
  min-height: 34px;
  font-size: 13px;
  line-height: 1.35;
}

.full {
  width: 100%;
}

.hero {
  position: relative;
  min-height: 520px;
  padding: clamp(42px, 5vw, 72px) 0;
  margin-top: 14px;
  background:
    linear-gradient(90deg, rgba(18, 24, 40, 0.88), rgba(18, 24, 40, 0.58), rgba(18, 24, 40, 0.2)),
    url("assets/flower-market-hero.png") center / cover no-repeat;
  border-radius: var(--radius);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(18, 24, 40, 0.25), transparent 35%, rgba(20, 28, 41, 0.4));
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 0.94fr) minmax(380px, 520px);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
}

.hero-copy {
  position: relative;
  display: grid;
  gap: 16px;
  max-width: 590px;
  color: #fff;
}

.hero-brand-lockup {
  display: grid;
  gap: 2px;
  width: fit-content;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.hero-brand-lockup span {
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 950;
}

.hero-brand-lockup em {
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
}

.hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

.hero-kicker {
  width: fit-content;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.hero-copy h1 {
  max-width: 580px;
  margin: 0;
  font-size: clamp(42px, 4.2vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.guest-hero-sub {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.hero-actions .primary-btn,
.hero-actions .ghost-btn {
  min-width: 124px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 480px;
  margin-top: 8px;
}

.hero-metrics div {
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  font-size: 25px;
  line-height: 1;
}

.hero-metrics span {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.content-sections {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.content-section-card,
.content-section-editor,
.filters,
.cart-panel,
.catalog-panel,
.work-panel,
.orders-section,
.store-card,
.store-home-card,
.cart-item,
.order-card,
.manage-item,
.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.content-section-card,
.content-section-editor {
  padding: 16px;
}

.text-link {
  color: var(--brand);
  font-weight: 800;
}

.content-section-card p {
  margin: 0;
}

.service-legal-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1fr);
  gap: 12px;
}

.service-legal-strip > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
}

.service-legal-strip strong {
  display: block;
  margin-bottom: 6px;
}

.service-legal-strip p {
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.shop-layout {
  margin: 26px auto 38px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 340px;
  gap: 18px;
  width: var(--container);
}

.filters {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 16px;
  background: #fff;
}

.filter-head,
.section-head,
.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-head h2,
.section-head h2 {
  margin: 0;
}

.section-head {
  margin-bottom: 14px;
}

.section-head.compact {
  margin-bottom: 10px;
}

.filters label,
.checkout-form label,
.review-form label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.filters input,
.filters select {
  background: #fff;
}

.catalog-panel {
  padding: 18px;
  background: #fff;
}

.store-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.store-home-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.store-showcase:empty,
.store-home-panel:empty {
  display: none;
  margin: 0;
}

.store-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  background: #fdfcfe;
}

.store-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(233, 79, 119, 0.15), 0 10px 20px rgba(233, 79, 119, 0.13);
}

.store-card p,
.store-home-grid p,
.product-body p {
  margin: 0;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.store-home-card {
  padding: 16px;
}

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

.store-review-list {
  display: grid;
  gap: 8px;
}

.sort-control {
  display: grid;
  grid-template-columns: auto 170px;
  gap: 8px;
  align-items: center;
  color: var(--text-soft);
  font-weight: 700;
}

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

.is-state-loading .catalog-panel,
.is-state-loading .cart-panel {
  cursor: progress;
}

.state-loading-card {
  display: grid;
  gap: 12px;
  overflow: hidden;
  min-height: 236px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.state-loading-card.compact {
  min-height: auto;
}

.state-loading-card strong {
  color: var(--ink);
}

.state-loading-media,
.state-loading-line {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #eef2f7;
}

.state-loading-media {
  aspect-ratio: 16 / 11;
}

.state-loading-line {
  display: block;
  width: 68%;
  height: 12px;
}

.state-loading-line.wide {
  width: 92%;
}

.state-loading-line.short {
  width: 42%;
}

.state-loading-media::after,
.state-loading-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  animation: state-loading-shimmer 1.4s ease-in-out infinite;
}

.state-loading-body {
  display: grid;
  gap: 10px;
}

@keyframes state-loading-shimmer {
  to {
    transform: translateX(100%);
  }
}

.product-card {
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d7dcef;
}

.product-image {
  aspect-ratio: 16 / 10.7;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 58%, rgba(24, 31, 42, 0.12)),
    url("assets/flower-market-hero.png") center / cover;
}

.product-body,
.product-copy {
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 22px;
}

.product-title-row,
.line-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.product-title-row strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

.product-title-row span {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 24px;
  font-weight: 900;
}

.product-desc {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.product-title-row h3 {
  margin: 0;
  line-height: 1.32;
  min-width: 0;
}

.product-title-row h3,
.line-row strong,
.line-row span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  color: #3554b2;
  background: #eff3ff;
  font-weight: 900;
  line-height: 1;
}

.tag.featured-tag,
.featured-tag {
  color: #8d4d00;
  background: #fff4dd;
}

.stock-low {
  color: var(--danger);
  font-weight: 800;
}

.product-stock {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.product-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
}

.product-actions .primary-btn,
.product-actions .ghost-btn {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
}

.product-actions .primary-btn {
  order: -1;
}

.product-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.product-action-buttons .primary-btn,
.product-action-buttons .ghost-btn {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
}

.product-action-buttons .primary-btn {
  grid-column: 1 / -1;
  min-height: 42px;
  font-size: 15px;
}

.product-action-buttons .ghost-btn {
  min-height: 38px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

@container (max-width: 360px) {
  .product-action-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cart-panel {
  padding: 16px;
}

.cart-list,
.order-list,
.management-list {
  display: grid;
  gap: 10px;
}

.cart-item,
.order-card,
.manage-item {
  padding: 12px;
  background: var(--bg-soft);
}

.cart-item {
  border-radius: 14px;
  background: #fff;
}

.cart-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.cart-selection-bar span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.cart-selection-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cart-item.selected {
  border-color: rgba(210, 59, 117, 0.22);
  background: #fffafd;
  box-shadow: 0 10px 24px rgba(210, 59, 117, 0.08);
}

.cart-item-main {
  display: grid;
  grid-template-columns: auto 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.cart-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.cart-check input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--brand);
}

.cart-item-thumb {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cart-item-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.cart-item-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 8px;
}

.cart-item-title-row strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.cart-item-title-row span {
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.cart-item-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.cart-item-meta,
.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-item-meta span {
  color: var(--text-soft);
  font-size: 12px;
}

.cart-item-actions .qty-control {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.cart-item-actions .qty-control button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.cart-item-actions .qty-control span {
  min-width: 28px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.cart-remove-btn {
  min-width: 56px;
  min-height: 32px;
  padding-inline: 12px;
  color: var(--text-soft);
  background: #fff;
}

.inventory-tools,
.inventory-form,
.inventory-ledger-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcff;
}

.inventory-operation-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-color: #dfe6f1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(18, 24, 40, 0.045);
}

.inventory-operation-card--secondary {
  background: #fcfdff;
  box-shadow: none;
}

.inventory-operation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.inventory-operation-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.inventory-operation-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.inventory-operation-head span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.inventory-operation-head em {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #8a3450;
  background: #fff0f5;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.inventory-tools label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.inventory-tools label input,
.inventory-tools label select {
  min-height: 38px;
}

.inventory-store-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  margin: 2px 0 4px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #37507a;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 800;
}

.inventory-form + .inventory-form,
.inventory-tools,
.inventory-ledger-tools {
  margin-top: 10px;
}

.inventory-ledger-tools {
  grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr);
  background: #fff;
}

.inventory-summary {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.inventory-summary:empty,
.inventory-dashboard:empty,
#platform-stock-alerts:empty {
  display: none;
}

.inventory-playbook {
  display: grid;
  gap: 10px;
  margin: 10px 0;
  padding: 14px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(233, 79, 119, 0.08), transparent 44%),
    #ffffff;
}

.inventory-playbook strong {
  color: var(--ink);
}

.inventory-playbook ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
  font-weight: 700;
}

.inventory-code-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #245f45;
  background: #e4f6eb;
  font-size: 12px;
  font-weight: 900;
}

.inventory-code-badge.empty {
  color: #8d4d00;
  background: #fff4dd;
}

.inventory-custom-adjust {
  display: inline-grid;
  grid-template-columns: 92px auto;
  gap: 6px;
  align-items: center;
}

.inventory-custom-adjust input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.inventory-custom-adjust .small {
  min-width: 72px;
}

.inventory-quantity-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(42px, auto));
  gap: 6px;
  align-items: center;
}

.inventory-quantity-control input {
  min-width: 0;
}

.inventory-quantity-control .small {
  min-width: 42px;
  padding-inline: 8px;
}

.inventory-action-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.inventory-action-card {
  min-height: 76px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.inventory-action-card:hover {
  border-color: #c59aa6;
  box-shadow: 0 8px 20px rgba(39, 55, 44, 0.08);
  transform: translateY(-1px);
}

.inventory-action-card.active {
  border-color: var(--brand);
  background: #fff5f8;
  box-shadow: 0 10px 24px rgba(216, 71, 112, 0.14);
}

.inventory-action-card:focus-visible {
  outline: 2px solid rgba(182, 70, 99, 0.32);
  outline-offset: 2px;
}

.inventory-action-card strong,
.inventory-action-card span {
  display: block;
  pointer-events: none;
}

.inventory-action-card strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.inventory-action-card span {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-summary .summary-title {
  display: block;
  color: var(--text);
  font-weight: 700;
}

.inventory-summary .summary-line {
  color: var(--text-soft);
  line-height: 1.5;
  word-break: break-word;
}

.inventory-summary .summary-line strong {
  color: var(--ink);
  margin: 0 2px;
}

.inventory-summary .summary-line strong.danger {
  color: var(--danger);
}

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

.inventory-dashboard .metric-card {
  padding: 14px;
  min-height: 96px;
}

.inventory-dashboard .metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.inventory-dashboard-list {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafcff;
}

.inventory-chart-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.inventory-material-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.inventory-material-bars {
  display: grid;
  gap: 10px;
}

.inventory-material-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.inventory-material-row strong {
  display: block;
  color: var(--text);
}

.inventory-material-row span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.inventory-material-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.inventory-material-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #f59fbc);
}

.inventory-chart-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.inventory-chart-head h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.inventory-chart-head p {
  color: var(--text-soft);
  font-size: 12px;
}

.inventory-chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
}

.inventory-chart-legend strong {
  color: var(--text);
  font-size: 15px;
}

.inventory-chart-wrap {
  min-width: 0;
}

.inventory-chart {
  display: block;
  width: 100%;
  min-height: 180px;
}

.inventory-chart-zero {
  stroke: #d9dee8;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.inventory-chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inventory-chart-dot {
  fill: #fff;
  stroke: var(--brand);
  stroke-width: 3;
}

.inventory-chart-dot.down {
  stroke: var(--warn);
}

.inventory-chart-dot.flat {
  stroke: #9ca3af;
}

.inventory-chart-labels {
  position: relative;
  height: 18px;
  margin: -4px 18px 0;
  color: var(--text-soft);
  font-size: 11px;
}

.inventory-chart-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.inventory-chart-table {
  width: 100%;
  border-collapse: collapse;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.inventory-chart-table th,
.inventory-chart-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.inventory-chart-table th:first-child,
.inventory-chart-table td:first-child {
  text-align: left;
}

.inventory-chart-table th {
  color: var(--text-soft);
  background: #f3f6fb;
  font-weight: 800;
}

.inventory-chart-table tr:last-child td {
  border-bottom: 0;
}

.inventory-chart-table .up {
  color: #1f8a5f;
  font-weight: 800;
}

.inventory-chart-table .down {
  color: var(--warn);
  font-weight: 800;
}

.inventory-dashboard-list h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.inventory-dashboard-list p {
  margin-bottom: 8px;
  color: var(--text);
}

.inventory-dashboard-list .empty {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.inventory-model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.inventory-model-chips span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7faf7;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.inventory-bom-line {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f8f5;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-bom-line.warn {
  background: #fff6df;
  color: #8a5a12;
  font-weight: 800;
}

.trend-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: #2f7a64;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.trend-pill.down {
  background: #d97706;
}

.trend-pill.warn {
  background: #dc2626;
}

.inventory-config-form {
  background: linear-gradient(180deg, #fff, #f8fbff);
  border-style: dashed;
}

.inventory-form .full,
.inventory-tools .small,
.inventory-ledger-tools input,
.inventory-ledger-tools select {
  min-width: 0;
}

.inventory-form .full {
  grid-column: 1 / -1;
}

.inventory-operation-form {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.inventory-form-main,
.inventory-form-main--adjust {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(160px, 0.8fr) minmax(150px, 0.7fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.inventory-form-main--stocktake {
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.7fr);
}

.inventory-form-main--config {
  grid-template-columns: minmax(240px, 1.1fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) minmax(180px, 0.9fr);
}

.inventory-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
}

.inventory-field > span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #344054;
}

.inventory-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.inventory-field input,
.inventory-field select,
.inventory-field textarea {
  width: 100%;
  min-width: 0;
  border-color: #dbe3ee;
  background: #fff;
}

.inventory-field--location input {
  text-overflow: ellipsis;
}

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

.inventory-scan-field > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.inventory-form-meta {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(230px, 280px);
  gap: 12px;
  align-items: end;
  min-width: 0;
  padding-top: 2px;
}

.inventory-form-meta .inventory-note-field {
  max-width: none;
}

.inventory-form-meta .full {
  grid-column: auto;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
}

.inventory-form-meta .primary-btn.full {
  min-width: 0;
}

.inventory-submit-area {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: end;
  min-width: 0;
}

.inventory-submit-area span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  text-align: right;
}

.inventory-submit-area .primary-btn,
.inventory-submit-area .ghost-btn {
  min-width: 170px;
  min-height: 42px;
  justify-content: center;
}

.inventory-list-panel .section-head p,
.inventory-ledger-panel .section-head p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.inventory-item-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.inventory-item-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(37, 56, 88, 0.05);
}

.inventory-item-card-head,
.inventory-item-card-meta,
.inventory-model-chips {
  display: flex;
  align-items: center;
}

.inventory-item-card-head {
  justify-content: space-between;
  gap: 10px;
}

.inventory-item-card-head strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.inventory-item-card-head p,
.inventory-item-card .inventory-action-hint {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.inventory-item-card-meta {
  gap: 7px;
  color: var(--text-soft);
}

.inventory-item-card-meta b {
  color: var(--text);
  font-size: 26px;
}

.inventory-item-card-meta small {
  margin-left: auto;
  font-size: 12px;
}

.inventory-model-chips {
  flex-wrap: wrap;
  gap: 6px;
}

.inventory-model-chips span {
  border-radius: 999px;
  background: #eef4ff;
  color: #1f3f76;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
}

.inventory-ledger-panel {
  background:
    radial-gradient(circle at top right, rgba(216, 71, 112, 0.08), transparent 34%),
    #fff;
}

.inventory-ledger-summary {
  background: #fff;
}

.inventory-ledger-list {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.inventory-ledger-list::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 13px;
  width: 2px;
  border-radius: 999px;
  background: #e7edf5;
}

.inventory-ledger-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  border-color: #e4eaf3;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(37, 56, 88, 0.06);
}

.ledger-card-marker {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: 6px auto 0;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #2f7a64;
  box-shadow: 0 0 0 2px rgba(47, 122, 100, 0.18);
}

.inventory-ledger-card.out .ledger-card-marker {
  background: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.18);
}

.ledger-card-body {
  min-width: 0;
}

.ledger-card-head {
  gap: 10px;
}

.ledger-card-head strong {
  min-width: 0;
}

.ledger-card-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.ledger-card-note {
  width: fit-content;
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  color: #6b3a4b;
  background: #fff3f7;
  font-size: 12px;
}

#platform-view .dashboard-grid > .work-panel.inventory-list-panel[data-platform-panel="inventory"] {
  grid-column: span 5;
}

#platform-view .dashboard-grid > .work-panel.inventory-ledger-panel[data-platform-panel="inventory"] {
  grid-column: span 7;
}

.inventory-scan-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
}

.inventory-scan-field input {
  min-width: 0;
}

.inventory-scan-field .small {
  min-width: 58px;
  padding-inline: 12px;
}

.inventory-type-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-note-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.inventory-note-field span {
  color: #344054;
  font-size: 12px;
  font-weight: 850;
}

.inventory-note-field input,
.inventory-note-field textarea {
  min-width: 0;
}

.inventory-note-field textarea {
  width: 100%;
  min-height: 66px;
  resize: vertical;
  line-height: 1.5;
}

.inventory-submit-area {
  display: grid;
  min-width: 0;
  gap: 8px;
  align-content: end;
  justify-items: end;
}

.inventory-submit-area span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  text-align: right;
}

.inventory-item-card {
  border-color: #dbe4f0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.95)),
    var(--surface);
}

.inventory-item-card .line-row strong {
  white-space: normal;
  line-height: 1.3;
}

.inventory-item-card p {
  line-height: 1.5;
}

.inventory-action-hint {
  color: var(--text-soft);
  font-size: 12px;
}

.inventory-item-card--product {
  border-color: #f0c6d0;
  background:
    linear-gradient(180deg, rgba(255, 247, 249, 0.78), rgba(255, 255, 255, 0.96)),
    var(--surface);
}

.inventory-item-card--material {
  border-color: #cfe3d6;
  background:
    linear-gradient(180deg, rgba(244, 251, 246, 0.82), rgba(255, 255, 255, 0.96)),
    var(--surface);
}

.inventory-kind-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #fff0f5;
  color: var(--primary-dark);
}

.inventory-kind-chip.material {
  background: #edf6f0;
  color: #2f6b4f;
}

.inventory-kind-section {
  display: grid;
  gap: 10px;
}

.inventory-kind-section + .inventory-kind-section {
  margin-top: 14px;
}

.inventory-kind-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.inventory-kind-section-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.inventory-kind-section-head p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.inventory-kind-section-head span {
  white-space: nowrap;
  color: var(--text-soft);
  font-weight: 700;
}

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

.cart-total {
  margin-top: 14px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  line-height: 1.2;
}

.cart-total span {
  color: var(--text-soft);
  font-weight: 800;
  white-space: nowrap;
}

.cart-total strong {
  color: var(--brand-2);
  font-size: 26px;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: right;
}

.line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  gap: 8px;
  min-width: 0;
}

.line-row strong {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.line-row strong {
  color: var(--ink);
}

.manage-item p {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-control button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.qty-control .ghost-btn.small {
  width: auto;
  min-width: 58px;
  height: 31px;
}

.checkout-form {
  display: grid;
  gap: 10px;
}

.cart-panel .checkout-form {
  gap: 14px;
  margin-top: 14px;
}

.checkout-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.checkout-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.checkout-card-head p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.checkout-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.checkout-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.checkout-block-head strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}

.checkout-block-head span {
  max-width: 18em;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.checkout-address-preview {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d8e7dc;
  border-radius: var(--radius-sm);
  background: #f4fff8;
}

.checkout-address-preview.empty {
  border-color: #eadfc7;
  background: #fff9eb;
}

.checkout-address-preview strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.checkout-address-preview span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.checkout-address-fields,
.checkout-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.checkout-address-fields input[name="address"] {
  grid-column: 1 / -1;
}

.checkout-summary {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.checkout-summary small {
  display: block;
  min-width: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.checkout-summary .line-row:last-child {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.checkout-summary .line-row:last-child span,
.checkout-summary .line-row:last-child strong {
  color: var(--brand-2);
  font-size: 15px;
  font-weight: 900;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.form-status.error {
  color: #b42318;
}

.form-status.pending {
  color: #8a4b08;
}

.form-status.success {
  color: #047857;
}

.checkout-form.is-submitting button[type="submit"] {
  cursor: progress;
}

.checkout-form label.checkbox-row,
.product-edit-form label.checkbox-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 36px;
  margin-top: 4px;
  padding: 7px 10px;
  border: 1px solid #dfe5ee;
  border-radius: 999px;
  background: #fbfcff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.checkout-form label.checkbox-row:hover,
.product-edit-form label.checkbox-row:hover {
  border-color: #c9d3e2;
  background: #fff;
  box-shadow: 0 6px 16px rgba(18, 24, 40, 0.06);
}

.checkbox-row input[type="checkbox"] {
  position: relative;
  order: -1;
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1.5px solid #b8c3d4;
  border-radius: 6px;
  appearance: none;
  background: #fff;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.checkout-form label.checkbox-row,
.product-edit-form label.checkbox-row {
  text-align: left;
}

.checkbox-row input[type="checkbox"]::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.checkbox-row input[type="checkbox"]:checked {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: none;
}

.checkbox-row input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-row input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(233, 79, 119, 0.42);
  outline-offset: 3px;
}

.checkbox-row:has(input[type="checkbox"]:checked) {
  border-color: color-mix(in srgb, var(--brand), #fff 62%);
  background: #fff5f8;
  color: #8f2348;
}

.form-save-footer,
.product-edit-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.form-save-footer span,
.product-edit-footer span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.form-save-footer .primary-btn,
.product-edit-footer .primary-btn {
  min-width: 112px;
}

.compact-form {
  gap: 8px !important;
}

.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pay-methods label {
  margin: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcff;
  padding: 0 12px;
}

.pay-methods input {
  width: auto;
  min-height: auto;
}

.checkout-readiness {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcff;
}

.checkout-referral-source {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d8e7dc;
  border-radius: var(--radius-sm);
  background: #f4fff8;
}

.checkout-referral-source[hidden] {
  display: none;
}

.checkout-referral-source strong {
  color: #10723d;
  font-size: 13px;
  line-height: 1.25;
}

.checkout-referral-source span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.checkout-coupon-hint {
  min-height: 20px;
  margin: -4px 0 2px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.checkout-coupon-hint.ready,
.checkout-coupon-hint.success {
  color: #10723d;
}

.checkout-coupon-hint.blocked {
  color: #8a4b08;
}

.checkout-readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

.checkout-readiness-head span,
.checkout-readiness-list span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.checkout-readiness-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.checkout-readiness-list span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef2f8;
}

.checkout-readiness.is-ready {
  border-color: #b6e7ca;
  background: #f4fff8;
}

.checkout-readiness.is-ready .checkout-readiness-head strong {
  color: #10723d;
}

.checkout-readiness.is-submitting {
  border-color: #f0d28a;
  background: #fff9eb;
}

.checkout-readiness.is-submitting .checkout-readiness-head strong {
  color: #8a5a00;
}

.checkout-readiness.is-submitting .checkout-readiness-list span {
  color: #755009;
  background: #fff0c7;
}

.checkout-readiness .checkout-warning {
  color: #8a3b08;
  background: #fff4dd;
}

.checkout-submit-stable + .primary-btn.full {
  display: none;
}

.orders-section {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto 38px;
  padding: 18px 0;
}

.status-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.status-step {
  min-height: 28px;
  border-radius: 999px;
  padding: 6px 8px;
  text-align: center;
  background: #e8ebf3;
  color: #6c7382;
  font-size: 12px;
  font-weight: 800;
}

.status-step.done {
  color: #fff;
  background: var(--success);
}

.order-timeline {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #f6f8fd;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 12px;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 15px;
  width: 1px;
  bottom: 0;
  background: var(--line);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #8990a2;
}

.timeline-item.active .timeline-dot {
  background: var(--brand);
}

.timeline-item strong {
  display: block;
  margin-bottom: 2px;
}

.timeline-item p {
  margin: 0;
}

.order-tools {
  width: min(1500px, calc(100% - 40px));
  margin: -4px auto 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px auto;
  align-items: center;
  gap: 10px;
}

.order-tools.compact-tools {
  width: 100%;
  margin: 0 0 12px;
}

.order-tools span {
  font-weight: 800;
  color: var(--text-soft);
}

.review-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.review-form-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.review-form-status.error {
  color: #b42318;
}

.review-form-status.pending {
  color: #8a4b08;
}

.review-form-status.success {
  color: #047857;
}

.review-form.is-submitting {
  opacity: 0.92;
}

.review-form.is-submitting button[type="submit"] {
  cursor: progress;
}

.order-review {
  border: 1px solid #f2bfd1;
  border-radius: var(--radius-sm);
  background: #fff7fb;
  margin: 12px 0;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.order-review p,
.order-review div {
  margin: 0;
}

.customer-order-action-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.customer-order-action-panel.attention {
  border-color: #f2d6a5;
  background: #fff9ed;
}

.customer-order-action-panel.paying {
  border-color: #f0d28a;
  background: #fff6dd;
}

.customer-order-action-panel.paying .customer-order-action-head strong {
  color: #8a5a00;
}

.customer-order-action-panel.ready {
  border-color: #c9e6d7;
  background: #f4fff8;
}

.customer-order-action-panel.warning {
  border-color: #f1d3a9;
  background: #fff8ef;
}

.customer-order-action-panel.done {
  border-color: #dce4ef;
  background: #f7f9fc;
}

.customer-order-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-order-action-head strong {
  color: var(--text);
}

.customer-order-action-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  color: #37507a;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.customer-order-action-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.customer-order-action-list p {
  margin: 0;
  color: var(--text-soft);
}

.customer-order-actions {
  align-items: center;
}

.customer-order-actions .primary-btn {
  order: -2;
}

.customer-order-actions [data-apply-refund] {
  order: -1;
}

.dashboard-head {
  width: min(1500px, calc(100% - 40px));
  margin: 26px auto 16px;
}

.merchant-head {
  align-items: flex-end;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--shadow-sm);
}

.merchant-head h1 {
  margin: 3px 0 0;
  font-size: 30px;
}

.role-summary {
  display: grid;
  min-width: min(360px, 42vw);
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.role-summary span,
.role-summary small {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.role-summary strong {
  color: var(--ink);
  font-size: 16px;
}

.dashboard-head p {
  margin: 0;
  color: #7d2f48;
  font-weight: 700;
}

.dashboard-head select {
  max-width: 260px;
}

.metric-grid,
.dashboard-grid {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto 16px;
}

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

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--text-soft);
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

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

.merchant-workspace-tabs {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.merchant-workspace-tab {
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-weight: 800;
  overflow: hidden;
  padding: 8px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-workspace-tab:hover {
  color: var(--text);
  background: #f7f9ff;
}

.merchant-workspace-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px rgba(233, 79, 119, 0.18);
}

.merchant-workspace-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.merchant-panel {
  display: none;
}

.merchant-panel.active {
  display: block;
  grid-column: span 6;
}

.merchant-panel.profile-orders-panel.active,
.merchant-panel.cashier-panel.active,
.merchant-panel.inventory-list-panel.active,
.merchant-panel.inventory-ledger-panel.active {
  grid-column: 1 / -1;
}

.merchant-workspace-grid .work-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.merchant-workspace-grid .section-head.compact {
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

#platform-view .dashboard-head {
  align-items: flex-end;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f7f9ff);
  box-shadow: var(--shadow-sm);
}

#platform-view .dashboard-head h1 {
  margin: 2px 0 0;
  font-size: 30px;
}

#platform-view .dashboard-head .primary-btn {
  min-width: 150px;
  white-space: nowrap;
}

#platform-view .metric-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.platform-workspace-tabs {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.platform-workspace-tab {
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 10px;
  color: var(--text-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-workspace-tab:hover {
  color: var(--text);
  background: #f7f9ff;
}

.platform-workspace-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px rgba(233, 79, 119, 0.18);
}

#platform-view .dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

#platform-view [data-platform-panel]:not(.active) {
  display: none;
}

#platform-view .work-panel {
  min-width: 0;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

#platform-view .work-panel:nth-child(1),
#platform-view .work-panel:nth-child(2) {
  grid-column: span 6;
}

#platform-view .work-panel:nth-child(3),
#platform-view .work-panel:nth-child(4),
#platform-view .work-panel:nth-child(5),
#platform-view .work-panel:nth-child(6) {
  grid-column: 1 / -1;
}

#platform-view .work-panel:nth-child(n + 7) {
  grid-column: span 4;
}

#platform-view .section-head.compact {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  margin: -2px 0 14px;
  padding-bottom: 10px;
}

#platform-view .section-head.compact > .small {
  flex: 0 0 auto;
  margin-top: 2px;
}

#platform-view .section-head.compact h2 {
  font-size: 20px;
}

#platform-view .section-head.compact p {
  max-width: 72ch;
  line-height: 1.45;
}

#platform-view .checkout-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  align-items: start;
}

#platform-view .checkout-form .full,
#platform-view .checkout-form label.full,
#platform-view .checkout-form textarea,
#platform-view .checkout-form .content-section-editor,
#platform-view .checkout-form .muted {
  grid-column: 1 / -1;
}

#platform-view .dashboard-grid > .work-panel.growth-distribution-panel[data-platform-panel="growth"] {
  grid-column: span 5;
}

#platform-view .dashboard-grid > .work-panel.growth-users-panel[data-platform-panel="growth"] {
  grid-column: span 3;
}

#platform-view .dashboard-grid > .work-panel.growth-campaign-panel[data-platform-panel="growth"] {
  grid-column: span 4;
}

#platform-view .dashboard-grid > .work-panel.growth-coupon-panel[data-platform-panel="growth"] {
  grid-column: span 5;
}

#platform-view .growth-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#platform-view .growth-form label:not(.checkbox-row) {
  min-width: 0;
  margin-top: 0;
}

#platform-view .growth-form input:not([type="checkbox"]),
#platform-view .growth-form select {
  width: 100%;
  min-width: 0;
}

#platform-view .distribution-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#platform-view .growth-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#platform-view .growth-toggle-row .checkbox-row {
  margin-top: 0;
  min-width: 0;
}

#platform-view .growth-toggle-row .checkbox-row input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
}

#platform-view .growth-form button.full {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
}

.growth-result-list {
  margin-top: 14px;
}

.growth-empty {
  border: 1px dashed #d8e0ec;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
  padding: 14px;
}

.content-system-panel {
  grid-column: 1 / -1;
}

#platform-view .dashboard-grid > .work-panel[data-platform-panel="content"],
#platform-view .dashboard-grid > .work-panel[data-platform-panel="launch"] {
  grid-column: 1 / -1;
}

#platform-view .dashboard-grid > .work-panel[data-platform-panel="launch"]:not(.launch-config-panel) {
  grid-column: span 6;
}

#platform-view .dashboard-grid > .work-panel.launch-config-panel[data-platform-panel="launch"] {
  grid-column: 1 / -1;
}

.content-system-head {
  gap: 16px;
}

.content-publish-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.content-publish-state span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  color: #496056;
  background: #f7fbf8;
  font-size: 12px;
  font-weight: 800;
}

.content-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 18px;
  align-items: start;
}

.content-editor-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.content-editor-card,
.content-preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.content-editor-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
}

.content-editor-title,
.content-editor-card .full {
  grid-column: 1 / -1;
}

.content-editor-title {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.content-editor-title strong {
  color: var(--text);
  font-size: 15px;
}

.content-editor-title span,
.content-form-actions p {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.content-editor-card label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.content-editor-card label span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.content-topic-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.content-topic-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid #edf1f6;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.content-preview-card {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
  padding: 14px;
  max-width: 100%;
  box-shadow: 0 14px 36px rgba(18, 24, 40, 0.08);
}

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

.content-preview-head span,
.content-preview-card small {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.content-preview-hero,
.content-preview-topics,
.content-preview-support {
  display: grid;
  gap: 7px;
}

.content-preview-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.content-preview-hero p,
.content-preview-support p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.content-preview-hero em {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #7a4d10;
  background: #fff7e8;
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
}

.content-preview-topics button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
  text-align: left;
}

.content-preview-topics button span {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.content-preview-topics .empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed #dbe4f0;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: #f8fafc;
}

.content-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  bottom: 14px;
  z-index: 5;
  margin-top: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.content-form-actions p {
  margin: 0;
}

.launch-config-panel {
  display: grid;
  gap: 14px;
}

.launch-config-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  padding: 2px 0;
}

.launch-config-form label {
  min-width: 0;
}

.launch-config-form label:not(.checkbox-row) {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.launch-config-form input,
.launch-config-form select {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.launch-config-form .checkbox-row {
  align-self: end;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: #fff;
}

.launch-config-form button.full {
  grid-column: 1 / -1;
  justify-self: end;
  width: min(240px, 100%);
}

.launch-export-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.launch-export-actions .full {
  width: 100%;
}

.checkout-form label.full,
.product-edit-form label.full {
  grid-column: 1 / -1;
}

#platform-product-form,
#product-form,
.product-edit-form {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcff;
}

#platform-product-form label,
#product-form label,
.product-edit-form label {
  min-width: 0;
  min-height: 68px;
  margin-top: 0;
  align-content: end;
}

#platform-product-form label:not(.checkbox-row),
#product-form label:not(.checkbox-row),
.product-edit-form label:not(.checkbox-row) {
  color: var(--text);
}

#platform-product-form input,
#platform-product-form select,
#platform-product-form textarea,
#product-form input,
#product-form select,
#product-form textarea,
.product-edit-form input,
.product-edit-form select,
.product-edit-form textarea {
  min-height: 42px;
}

#platform-product-form .checkbox-row input[type="checkbox"],
#product-form .checkbox-row input[type="checkbox"],
.product-edit-form .checkbox-row input[type="checkbox"],
.checkout-form .checkbox-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
}

#platform-product-form label.full,
#product-form label.full,
.product-edit-form label.full {
  min-height: auto;
}

#platform-product-form .checkbox-row,
#product-form .checkbox-row,
.product-edit-form .checkbox-row {
  min-height: 36px;
  margin-top: 0;
  align-self: end;
}

#platform-product-form > .muted,
#product-form > .muted {
  grid-column: 1 / -1;
  margin: 0;
}

#platform-products {
  margin-top: 14px;
}

.product-manage-card {
  display: grid;
  grid-template-columns: minmax(140px, 188px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  overflow: hidden;
  container-type: inline-size;
}

.product-manage-card.stock-alert-item {
  background:
    linear-gradient(180deg, rgba(255, 247, 249, 0.82), rgba(255, 255, 255, 0.96)),
    #fff;
}

.product-manage-content {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.product-manage-card .product-manage-media {
  position: sticky;
  top: 86px;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: #f7e8ee;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.product-manage-card .product-manage-media::after {
  content: "主图";
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(18, 24, 40, 0.58);
  font-size: 11px;
  font-weight: 800;
}

@container (max-width: 660px) {
  .product-manage-card .product-manage-media {
    position: relative;
    top: auto;
    aspect-ratio: 16 / 9;
  }

  .product-edit-form {
    grid-template-columns: 1fr;
  }

  .product-edit-form .checkbox-row {
    margin-top: 0;
  }
}

@media (max-width: 1240px) {
  .product-manage-card {
    grid-template-columns: 1fr;
  }

  .product-manage-card .product-manage-media {
    position: relative;
    top: auto;
    aspect-ratio: 16 / 9;
  }

  .product-edit-form .checkbox-row {
    margin-top: 0;
  }

  .inventory-form-main,
  .inventory-form-main--adjust,
  .inventory-form-main--config,
  #platform-view .inventory-operation-form .inventory-form-main--adjust,
  #platform-view .inventory-operation-form .inventory-form-main--config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-form-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-submit-area {
    justify-items: start;
  }

  .inventory-submit-area span {
    text-align: left;
  }
}

.product-edit-form + .manage-actions {
  min-width: 0;
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
  flex-wrap: wrap;
}

.product-edit-form + .manage-actions .ghost-btn.small {
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f1f4fa;
  color: var(--text);
  font-weight: 800;
  white-space: normal;
}

.product-edit-form + .manage-actions .ghost-btn.small:hover {
  color: #9a2f56;
  background: #ffeaf1;
}

#platform-view .checkout-form button.full {
  justify-self: end;
  width: auto;
  min-width: 150px;
}

#platform-view .growth-form button.full {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
}

#platform-view .inventory-form,
#platform-view .inventory-tools,
#platform-view .inventory-ledger-tools,
#platform-view .order-tools.compact-tools {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

#platform-view .inventory-operation-form {
  grid-template-columns: minmax(0, 1fr);
}

#platform-view .inventory-form-meta .full {
  justify-self: end;
  width: auto;
}

#platform-view .inventory-tools .small,
#platform-view .order-tools.compact-tools .small {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

#platform-view .order-tools.compact-tools span {
  justify-self: end;
  min-width: max-content;
}

#platform-view .management-list {
  min-width: 0;
}

#platform-view .manage-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

#platform-view .manage-item .line-row {
  flex-wrap: wrap;
  align-items: flex-start;
}

#platform-view .manage-actions {
  justify-content: flex-start;
}

#platform-view .manage-actions .small {
  min-width: max-content;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #40506a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill.success {
  background: #eaf7ef;
  color: #287247;
}

.status-pill.warning {
  background: #fff5dc;
  color: #94610e;
}

.status-pill.danger {
  background: #ffe8ed;
  color: #af2e52;
}

.platform-store-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #fff8fb 100%);
}

.platform-store-head {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.platform-store-card .line-row {
  gap: 10px;
}

.platform-store-card .line-row strong {
  font-size: 18px;
  line-height: 1.35;
}

.platform-store-card p,
.platform-store-rules span {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.platform-store-metrics,
.platform-store-rules {
  display: grid;
  gap: 8px;
}

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

.platform-store-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf0f5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-soft);
  font-size: 12px;
}

.platform-store-metrics b {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
}

.platform-store-rules {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fc;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mini-status {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--surface);
}

.mini-status strong,
.mini-status span,
.mini-status p {
  display: block;
}

.mini-status span {
  color: var(--muted);
  font-size: 12px;
}

.mini-status.warn {
  border-color: color-mix(in srgb, var(--warn), var(--line) 55%);
}

.mini-status.ready {
  border-color: color-mix(in srgb, var(--success), var(--line) 55%);
}

.work-panel {
  padding: 18px;
  background: var(--surface);
}

.profile-orders-panel {
  grid-column: 1 / -1;
}

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

.cashier-section-head {
  align-items: flex-start;
}

.cashier-location-badge {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid #c9d8ea;
  border-radius: 999px;
  color: #174167;
  background: #eef6ff;
  font-size: 12px;
  font-weight: 900;
}

.cashier-pos-flow {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.cashier-sale-column {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.cashier-payment-dock {
  display: grid;
  min-width: 0;
  gap: 10px;
  position: sticky;
  top: 92px;
  padding: 12px;
  border: 1px solid #cbdcf0;
  border-radius: var(--radius);
  background: #f8fbff;
  box-shadow: 0 18px 42px rgba(24, 39, 75, 0.1);
}

.cashier-current-payment {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.cashier-current-stage-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d8e4f2;
  border-radius: var(--radius);
  background: #ffffff;
}

.cashier-current-stage-head strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.cashier-current-stage-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cashier-current-stage-head span {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: #116149;
  background: #e4f8ee;
  font-size: 12px;
  font-weight: 800;
}

.cashier-current-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #cbdcf0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 18px 44px rgba(24, 39, 75, 0.12);
}

.cashier-current-card.is-ready {
  border-color: color-mix(in srgb, var(--success), #cbdcf0 58%);
  background: linear-gradient(180deg, #f7fffb, #ffffff 54%, #fbfdff);
}

.cashier-current-card.is-pending {
  border-color: color-mix(in srgb, var(--warn), #cbdcf0 64%);
  background: linear-gradient(180deg, #fffaf1, #ffffff 56%, #fbfdff);
}

.cashier-current-card.is-empty {
  color: var(--muted);
  background: #f8fafc;
  box-shadow: none;
}

.cashier-current-card h3 {
  margin: 2px 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.cashier-current-card p {
  margin: 0;
  color: var(--muted);
}

.cashier-current-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.cashier-current-placeholder {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.cashier-current-placeholder strong {
  display: block;
  margin-bottom: 4px;
}

.cashier-current-actions {
  padding-top: 2px;
}

.cashier-payment-query-summary,
.cashier-payment-rescan {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #dbe7f5;
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.cashier-payment-query-summary strong,
.cashier-payment-query-summary p {
  display: block;
}

.cashier-payment-query-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.cashier-payment-rescan {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 0.8fr) auto;
  gap: 8px;
  align-items: center;
}

.cashier-payment-rescan input {
  min-width: 0;
}

.cashier-order-payment-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #dbe7f5;
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.cashier-order-payment-summary div {
  min-width: 0;
}

.cashier-order-payment-summary strong,
.cashier-order-payment-summary p {
  display: block;
}

.cashier-order-payment-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.cashier-payment-panel {
  display: grid;
  gap: 14px;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid #bfd2e8;
  border-radius: var(--radius-sm);
  background: #f7fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.cashier-payment-main {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.cashier-qr-box {
  display: grid;
  place-items: center;
  width: 168px;
  aspect-ratio: 1;
  border: 2px solid #19395f;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(31, 42, 68, 0.16);
}

.cashier-qr-img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
}

.cashier-qr-box--cash {
  border-color: #d8eadf;
  background: #f2fbf5;
}

.cashier-cash-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: #12683d;
  background: #dff7e8;
  font-size: 18px;
  font-weight: 900;
}

.cashier-payment-info {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.cashier-payment-location {
  width: max-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  color: #0f5132;
  background: #def7e8;
  font-size: 12px;
  font-weight: 900;
}

.cashier-payment-info .line-row {
  margin-bottom: 0;
}

.cashier-payment-amount {
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
  line-height: 1.1;
}

.cashier-payment-meta {
  font-size: 12px;
  color: var(--muted);
}

.cashier-payment-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cashier-payment-link span {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  color: #334155;
  background: #eef2f8;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: #2f7a64;
  font-size: 12px;
  font-weight: 800;
}

.pill.warn {
  background: var(--warn);
}

.pill.danger {
  background: var(--danger);
}

.muted-pill {
  background: #9ca3af;
}

.stock-alert-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #f4b6c5;
  background: #fff7f9;
}

.store-fulfillment-list {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #f4f6fc;
}

.store-fulfillment-list p {
  margin: 0;
}

.after-sale-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #f5bccd;
  border-radius: var(--radius-sm);
  background: #fff7fa;
}

.after-sale-box p {
  margin: 0;
}

.product-manage-media {
  height: 118px;
  border-radius: var(--radius-sm);
  background: #f6dae2 center / cover no-repeat;
}

.empty {
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text-soft);
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.guest-shopping-intro {
  justify-self: end;
  width: min(100%, 500px);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 12px;
  padding: 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 48px rgba(18, 24, 40, 0.22);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.guest-shopping-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(233, 79, 119, 0.1), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
}

.guest-shopping-intro > * {
  position: relative;
}

.guest-shopping-intro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.guest-shopping-intro-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
  color: #5a2e3f;
  font-weight: 800;
}

.guest-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #8b2f43;
  background: rgba(233, 79, 119, 0.16);
  border: 1px solid #ef9fb1;
}

.guest-shopping-intro-text {
  color: #5f6674;
  line-height: 1.55;
  margin-top: 0;
  font-weight: 600;
}

.guest-shopping-benefits {
  margin: 10px 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: #6c4e5e;
  font-size: 13px;
  font-weight: 700;
}

.guest-shopping-benefits li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guest-shopping-benefits li::before {
  content: "✓";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e94f77;
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
}

.guest-shopping-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

.guest-shopping-actions .primary-btn,
.guest-shopping-actions .ghost-btn {
  min-height: 40px;
}

.guest-shopping-actions .primary-btn {
  flex: 1 1 auto;
  min-width: 174px;
}

.guest-shopping-actions .ghost-btn {
  flex: 0 0 132px;
}

.guest-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid #ecdde3;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #3f4652;
  font-weight: 800;
  line-height: 1.35;
}

.guest-step span {
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.guest-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
}

.product-modal[hidden],
#register-modal[hidden] {
  display: none;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 40, 0.48);
}

.product-modal-card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  z-index: 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: auto;
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.register-modal-card {
  width: min(440px, 100%);
  padding: 28px;
}

.inventory-scanner-card {
  width: min(520px, 100%);
  padding: 24px;
}

.inventory-scanner-copy {
  padding-right: 44px;
}

.inventory-scanner-copy h2 {
  margin: 4px 0 8px;
  font-size: 26px;
}

.inventory-scanner-copy span,
.inventory-scanner-hint {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.inventory-scanner-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #101827;
  object-fit: cover;
}

.inventory-scanner-hint {
  margin: 14px 0 0;
}

.register-form h2 {
  margin: 4px 0 0;
  font-size: 28px;
}

.product-detail-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1fr);
  min-height: 320px;
}

.product-detail-image {
  min-height: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.2)),
    url("assets/flower-market-hero.png") center / cover;
}

.product-detail-summary {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 34px;
}

.product-detail-summary h2 {
  margin: 0;
  font-size: 34px;
}

.product-detail-summary p {
  color: var(--text-soft);
}

.product-detail-price {
  color: var(--brand-2);
  font-size: 34px;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 24px 20px;
}

.product-detail-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
}

.product-detail-actions button {
  flex: 1;
}

.product-detail-actions .ghost-btn {
  max-width: 190px;
}

.platform-user-name-input {
  min-height: 36px;
}

.mobile-cart-cta {
  display: none;
}

@media (max-width: 1024px),
       (max-width: 1024px) and (hover: none),
       (max-width: 1024px) and (pointer: coarse) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .role-tabs,
  .store-context,
  .auth-panel {
    justify-self: stretch;
  }

  .shop-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .hero-content {
    grid-template-columns: 1fr;
    align-items: end;
    gap: 22px;
  }

  .guest-shopping-intro {
    justify-self: start;
    width: min(100%, 620px);
  }

  .filters,
  .cart-panel {
    position: static;
  }
}

@media (max-width: 900px),
       (max-width: 900px) and (hover: none),
       (max-width: 900px) and (pointer: coarse) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    position: relative;
    z-index: 80;
    gap: 10px;
    padding: 10px 12px;
  }

  .guest .topbar {
    grid-template-columns: 1fr;
  }

  .guest .operator-tabs {
    display: none;
  }

  .guest .auth-panel {
    grid-column: auto;
  }

  .auth-panel {
    grid-template-columns: minmax(0, 1fr) repeat(3, minmax(64px, 76px));
    gap: 8px;
  }

  .auth-panel select,
  .auth-panel .small {
    min-height: 34px;
    width: 100%;
    font-size: 13px;
  }

  #login-status {
    grid-column: 1 / -1;
    min-height: 20px;
    font-size: 12px;
  }

  .role-tabs {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(18, 24, 40, 0.24);
  }

  body.signed-in .role-tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    box-shadow: none;
  }

  body.signed-in .auth-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    min-height: 0;
    padding: 4px;
  }

  body.signed-in #login-status {
    max-width: none;
    min-width: 0;
  }

  body.signed-in #logout-btn {
    width: auto;
  }

  .store-context {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-self: stretch;
    align-items: center;
    gap: 2px 8px;
    height: auto;
    min-height: 0;
    padding: 7px 9px;
  }

  .store-context select {
    width: 100%;
    height: auto;
    min-height: 34px;
  }

  .store-context small {
    display: block;
    grid-column: 1 / -1;
  }

  .guest .role-tabs {
    grid-template-columns: 1fr;
    max-width: 220px;
    margin: 0 auto;
  }

  body.guest .topbar {
    padding-bottom: 12px;
  }

  .mobile-cart-cta {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(211, 216, 228, 0.9);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 16px 34px rgba(18, 24, 40, 0.22);
    backdrop-filter: blur(14px);
  }

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

  .mobile-cart-cta .mobile-cart-actions .ghost-btn,
  .mobile-cart-cta .mobile-cart-actions .primary-btn {
    flex: 0 0 auto;
    min-width: 90px;
  }

  .mobile-cart-cta[hidden] {
    display: none;
  }

  .mobile-cart-cta span {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-cart-cta strong {
    color: var(--brand-2);
    font-size: 20px;
  }

  .mobile-cart-cta .primary-btn {
    min-width: 94px;
  }

  .role-tab {
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 768px),
       (max-width: 768px) and (hover: none),
       (max-width: 768px) and (pointer: coarse) {
  body {
    padding-bottom: calc(154px + env(safe-area-inset-bottom));
  }

  .cashier-payment-rescan {
    grid-template-columns: 1fr;
  }

  .guest .operator-tabs {
    display: none;
  }

  .guest .auth-panel {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .auth-identity {
    min-height: 320px;
  }

  .auth-identity-content {
    min-height: 320px;
    padding: 24px;
  }

  .auth-card {
    padding: 16px;
  }

  .auth-card-head,
  .wechat-login-layout,
  .auth-debug-controls {
    grid-template-columns: 1fr;
  }

  .auth-card-head {
    display: grid;
  }

  .auth-identity h1 {
    font-size: 32px;
  }

  .auth-benefits,
  .auth-trust-list {
    gap: 8px;
  }

  .auth-benefits span,
  .auth-trust-list span {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .auth-tabs {
    gap: 4px;
  }

  .auth-tab {
    min-height: 38px;
    font-size: 13px;
  }

  .wechat-login-layout,
  .auth-login-form {
    padding: 14px;
  }

  .wechat-qr {
    width: 168px;
    justify-self: center;
  }

  .phone-code-row {
    grid-template-columns: 1fr;
  }

  .inventory-operation-card {
    padding: 14px;
  }

  .inventory-operation-head {
    display: grid;
  }

  .inventory-operation-head em {
    width: fit-content;
  }

  .inventory-form-main,
  .inventory-form-main--adjust,
  .inventory-form-main--stocktake,
  .inventory-form-main--config,
  #platform-view .inventory-operation-form .inventory-form-main--adjust,
  #platform-view .inventory-operation-form .inventory-form-main--stocktake,
  #platform-view .inventory-operation-form .inventory-form-main--config {
    grid-template-columns: 1fr;
  }

  .inventory-submit-area {
    justify-items: stretch;
  }

  .inventory-submit-area .primary-btn,
  .inventory-submit-area .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .hero {
    min-height: 0;
    padding: 28px 0;
    align-items: flex-end;
    background-position: center top;
  }

  .hero-content {
    width: calc(100% - 28px);
  }

  .hero-copy {
    width: 100%;
    max-width: none;
  }

  .hero-copy h1 {
    max-width: 420px;
    font-size: 36px;
    line-height: 1.1;
  }

  .hero-actions {
    margin-top: 18px;
  }

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

  .guest-shopping-intro {
    padding: 16px;
  }

  .guest-shopping-actions {
    flex-wrap: wrap;
  }

  .guest-shopping-actions .primary-btn,
  .guest-shopping-actions .ghost-btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .guest-steps {
    grid-template-columns: 1fr;
  }

  .content-sections {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0;
  }

  .shop-layout,
  .dashboard-grid,
  .metric-grid {
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
  }

  #platform-view .dashboard-head,
  .merchant-head,
  #platform-view .dashboard-grid,
  #platform-view .metric-grid,
  .platform-workspace-tabs,
  .merchant-workspace-tabs {
    width: calc(100% - 24px);
  }

  #platform-view .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-workspace-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .merchant-workspace-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .platform-workspace-tab {
    flex: 0 0 auto;
    min-width: 96px;
  }

  .merchant-workspace-tab {
    flex: 0 0 auto;
    min-width: 88px;
  }

  #platform-view .dashboard-head {
    align-items: stretch;
    gap: 12px;
  }

  .merchant-head {
    align-items: stretch;
    gap: 12px;
  }

  .role-summary {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  #platform-view .dashboard-head .primary-btn,
  #platform-view .checkout-form button.full {
    width: 100%;
  }

  #platform-view .work-panel,
  #platform-view .work-panel:nth-child(n) {
    grid-column: 1 / -1;
  }

  .merchant-panel.active,
  .merchant-panel.profile-orders-panel.active,
  .merchant-panel.cashier-panel.active,
  .merchant-panel.inventory-list-panel.active,
  .merchant-panel.inventory-ledger-panel.active {
    grid-column: 1 / -1;
  }

  #platform-view .checkout-form,
  #platform-view .growth-form,
  #platform-view .growth-toggle-row,
  .content-console,
  .content-topic-row,
  #platform-view .inventory-form,
  #platform-view .inventory-tools,
  #platform-view .inventory-ledger-tools,
  #platform-view .order-tools.compact-tools {
    grid-template-columns: 1fr;
  }

  .inventory-form-main,
  .inventory-form-main--stocktake,
  .inventory-form-main--config,
  .inventory-form-meta {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .inventory-form-meta .inventory-note-field {
    max-width: none;
  }

  .inventory-form-meta .full,
  #platform-view .inventory-form-meta .full {
    justify-self: stretch;
    width: 100%;
  }

  .content-preview-card {
    position: static;
  }

  .content-console {
    grid-template-columns: 1fr;
  }

  .content-topic-row,
  .launch-config-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .content-editor-card {
    grid-template-columns: 1fr;
  }

  .content-form-actions {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  #platform-product-form,
  #product-form,
  .product-edit-form {
    grid-template-columns: 1fr;
  }

  #platform-product-form .checkbox-row,
  #product-form .checkbox-row,
  .product-edit-form .checkbox-row {
    margin-top: 0;
  }

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

  .product-manage-card .product-manage-media {
    position: relative;
    top: auto;
    aspect-ratio: 16 / 9;
  }

  #platform-view .order-tools.compact-tools span {
    justify-self: start;
  }

  .form-save-footer,
  .product-edit-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .form-save-footer .primary-btn,
  .product-edit-footer .primary-btn {
    width: 100%;
  }

  .shop-layout {
    margin: 18px auto 24px;
    width: calc(100% - 24px);
    gap: 12px;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    margin: 0;
  }

  .filter-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .filters label {
    margin-top: 0;
    gap: 5px;
    font-size: 12px;
  }

  .filters label:first-of-type {
    grid-column: 1 / -1;
  }

  .catalog-panel,
  .orders-section,
  .work-panel,
  .metric-card,
  .dashboard-head,
  .dashboard-grid {
    width: 100%;
    min-width: 0;
    padding: 16px;
  }

  .catalog-panel {
    order: 1;
  }

  .cart-panel {
    order: 3;
  }

  .cart-total {
    align-items: flex-start;
    padding: 12px 0;
  }

  .cart-total strong {
    font-size: 24px;
  }

  .cart-panel .checkout-form {
    gap: 12px;
  }

  .checkout-card-head,
  .checkout-block-head,
  .checkout-readiness-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .checkout-block-head span {
    max-width: none;
    text-align: left;
  }

  .checkout-block {
    padding: 11px;
  }

  .checkout-address-fields,
  .checkout-two-col {
    grid-template-columns: 1fr;
  }

  .checkout-address-preview {
    padding: 10px;
  }

  .checkout-summary .line-row {
    align-items: flex-start;
    gap: 8px;
  }

  .checkout-summary .line-row span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

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

  .inventory-form,
  .inventory-tools,
  .inventory-ledger-tools {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .inventory-summary {
    font-size: 12px;
  }

  .inventory-dashboard {
    grid-template-columns: 1fr;
  }

  .inventory-chart-panel {
    grid-template-columns: 1fr;
  }

  .inventory-material-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .inventory-ledger-card {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .inventory-ledger-list::before {
    left: 10px;
  }

  #platform-view .dashboard-grid > .work-panel.inventory-list-panel[data-platform-panel="inventory"],
  #platform-view .dashboard-grid > .work-panel.inventory-ledger-panel[data-platform-panel="inventory"] {
    grid-column: 1 / -1;
  }

  .inventory-chart-head {
    flex-direction: column;
  }

  .inventory-custom-adjust {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .inventory-scan-field > div {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .product-card {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .product-image {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;
  }

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

  .product-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .product-title-row h3 {
    font-size: 16px;
  }

  .price {
    font-size: 18px;
  }

  .product-body p {
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    display: -webkit-box;
    font-size: 13px;
  }

  .product-action-buttons {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .product-action-buttons .primary-btn {
    grid-column: 1 / -1;
  }

  .line-row,
  .status-track {
    font-size: 14px;
  }

  .order-list,
  .management-list {
    min-width: 0;
  }

  .order-card,
  .order-card > *,
  .customer-order-action-panel,
  .order-timeline,
  .store-fulfillment-list,
  .manage-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .order-card .line-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .order-card .line-row span,
  .order-card .line-row strong,
  .order-card p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .customer-order-action-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .status-track {
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  }

  .pay-methods {
    grid-template-columns: 1fr;
  }

  .order-tools {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    margin: -2px auto 12px;
  }

  .sort-control {
    grid-template-columns: 1fr;
  }

  .review-form {
    grid-template-columns: 1fr;
  }

  .dashboard-head h1,
  .dashboard-head p {
    margin: 0;
  }

  .dashboard-head h1 {
    font-size: 30px;
  }

  .metric-card strong {
    font-size: 24px;
  }

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

  .product-modal {
    align-items: end;
    padding: 10px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .product-modal-card {
    width: 100%;
    max-height: calc(100vh - 112px - env(safe-area-inset-bottom));
  }

  .inventory-scanner-card {
    padding: 18px;
  }

  .product-detail-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .product-detail-image {
    min-height: 188px;
  }

  .product-detail-summary {
    gap: 10px;
    padding: 20px 16px 16px;
  }

  .product-detail-summary h2 {
    font-size: 26px;
  }

  .product-detail-price {
    font-size: 30px;
  }

  .product-detail-grid {
    grid-template-columns: 1fr;
    padding: 0 14px 14px;
  }

  .product-detail-actions {
    position: sticky;
    bottom: 0;
    padding: 10px 14px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), #fff 35%);
  }
}

@media (max-width: 480px),
       (max-width: 480px) and (hover: none),
       (max-width: 480px) and (pointer: coarse) {
  .content-topic-row,
  .launch-config-form {
    grid-template-columns: 1fr !important;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

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

  .product-image {
    min-height: 154px;
  }

  .primary-btn,
  .ghost-btn,
  .icon-btn,
  button[type="submit"] {
    white-space: normal;
    padding-inline: 12px;
  }

  .product-action-buttons .primary-btn,
  .product-action-buttons .ghost-btn {
    font-size: 12px;
  }

  .inventory-scan-field > div {
    grid-template-columns: 1fr;
  }

  .inventory-scan-field .small {
    width: 100%;
  }

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

@media (max-width: 640px) {
  .cashier-pos-flow {
    grid-template-columns: 1fr;
  }

  .cashier-payment-dock {
    order: -1;
    position: static;
    padding: 10px;
  }

  .cashier-payment-main,
  .cashier-payment-link {
    grid-template-columns: 1fr;
  }

  .cashier-current-head {
    display: grid;
  }

  .cashier-current-stage-head {
    display: grid;
  }

  .cashier-section-head {
    display: grid;
  }

  .cashier-location-badge {
    width: max-content;
    max-width: 100%;
  }

  .cashier-current-stage-head span {
    width: max-content;
  }

  .cashier-current-card {
    padding: 14px;
  }

  .cashier-order-payment-summary {
    display: grid;
  }

  .cashier-qr-box {
    width: min(180px, 100%);
    justify-self: center;
  }

  .cashier-payment-info {
    text-align: center;
  }

  .cashier-payment-info .line-row {
    justify-content: center;
  }
}

.checkout-card-head {
  gap: 16px;
}

.checkout-step-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.checkout-step-rail span,
.checkout-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.checkout-step-rail span {
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(101, 85, 63, .16);
  border-radius: 999px;
  background: rgba(255, 250, 241, .78);
  color: var(--text);
  font-size: 12px;
}

.checkout-step-rail b,
.checkout-step-badge {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.checkout-block-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-panel #checkout-form {
  gap: 10px;
  margin-top: 16px;
}

.cart-panel #checkout-form .checkout-card-head,
.cart-panel #checkout-form .checkout-step-rail {
  display: none;
}

.cart-panel .checkout-block {
  gap: 12px;
  padding: 14px;
  border-color: #eef1f6;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.cart-panel .checkout-block-head {
  display: grid;
  grid-template-columns: minmax(86px, max-content) minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
}

.cart-panel .checkout-block-head strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
}

.cart-panel .checkout-block-head > span {
  max-width: none;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.cart-panel .checkout-step-badge {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
}

.cart-panel .checkout-two-col {
  grid-template-columns: 1fr;
  gap: 8px;
}

.cart-panel .checkout-summary {
  border-color: #edf0f5;
  background: #fffdfd;
}

.member-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.member-focus-card {
  border: 1px solid rgba(101, 85, 63, .14);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,247,235,.82));
  box-shadow: 0 18px 45px rgba(82, 57, 38, .08);
  color: var(--text);
  cursor: pointer;
  padding: 18px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.member-focus-card:hover,
.member-focus-card:focus-visible {
  border-color: rgba(186, 103, 55, .42);
  box-shadow: 0 22px 52px rgba(82, 57, 38, .13);
  transform: translateY(-2px);
}

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

.member-focus-card strong {
  margin-bottom: 6px;
  font-size: 16px;
}

.member-focus-card span {
  color: var(--muted-text);
  font-size: 13px;
  line-height: 1.55;
}

.access-summary-grid {
  display: grid;
  gap: 12px;
}

#platform-view .dashboard-grid > .work-panel.access-summary-panel[data-platform-panel="access"] {
  grid-column: 1 / -1;
}

#platform-view .dashboard-grid > .work-panel.access-role-panel[data-platform-panel="access"] {
  grid-column: 1 / -1;
}

#platform-view .dashboard-grid > .work-panel.access-governance-panel[data-platform-panel="access"],
#platform-view .dashboard-grid > .work-panel.access-store-panel[data-platform-panel="access"] {
  grid-column: 1 / -1;
}

.access-command-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fafbff);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.access-command-head,
.access-command-metrics,
.access-account-row,
.access-store-head {
  display: flex;
  align-items: center;
}

.access-command-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.access-command-head strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 18px;
}

.access-state-pill {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.access-state-pill.ready {
  background: rgba(34, 197, 94, .12);
  color: #166534;
}

.access-state-pill.warn {
  background: rgba(245, 158, 11, .14);
  color: #92400e;
}

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

.access-command-metrics div {
  border: 1px solid rgba(210, 216, 227, .8);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.access-command-metrics span,
.access-role-card span,
.access-account-main span {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
}

.access-command-metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 20px;
}

.access-role-grid,
.access-store-grid {
  display: grid;
  gap: 12px;
}

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

.access-store-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.access-role-card,
.access-store-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.access-role-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.access-role-card strong,
.access-store-card strong {
  color: var(--text);
}

.access-account-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.access-account-list .empty {
  margin: 0;
  border: 0;
  background: transparent;
}

.access-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 160px 160px auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 12px 14px;
}

.access-filter-bar input,
.access-filter-bar select,
.access-account-actions input,
.access-account-actions select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  padding: 7px 9px;
  font-size: 13px;
}

.access-filter-bar span {
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

.access-account-row {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(100px, .6fr) minmax(100px, .6fr) minmax(0, 2.8fr);
  gap: 14px;
  padding: 12px 14px;
}

.access-account-row + .access-account-row {
  border-top: 1px solid var(--line);
}

.access-account-row.warn {
  background: #fff8ed;
}

.access-account-main strong {
  display: block;
  color: var(--text);
}

.access-account-main span {
  overflow-wrap: anywhere;
}

.access-source-line {
  color: #7a414a !important;
  font-weight: 700;
}

.access-account-scope {
  color: var(--text);
  font-size: 13px;
}

.access-account-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.access-account-status small {
  font-size: 12px;
}

.access-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.access-account-actions input {
  flex: 1 1 140px;
}

.access-account-actions select {
  flex: 1 1 112px;
}

.access-account-actions button {
  flex: 0 0 auto;
}

.access-store-card p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.access-permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.access-permission-tags span {
  border: 1px solid rgba(154, 63, 120, .16);
  border-radius: 999px;
  background: #f8f1f6;
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
}

.access-risk-line {
  color: #9a3412;
  font-weight: 700;
}

.access-safe-line {
  color: var(--text-soft);
}

.access-store-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

@media (max-width: 760px) {
  .checkout-step-rail,
  .member-focus-grid,
  .access-command-metrics,
  .access-role-grid,
  .access-filter-bar,
  .access-account-row,
  .access-store-grid {
    grid-template-columns: 1fr;
  }

  .checkout-step-rail {
    justify-content: flex-start;
  }

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