:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --surface: #fffdf9;
  --ink: #1f2825;
  --muted: #6f7874;
  --line: #dedfd8;
  --brand: #153f36;
  --brand-soft: #dce9e3;
  --accent: #c96b43;
  --danger: #b4483e;
  --shadow: 0 18px 50px rgba(31, 40, 37, 0.09);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img, video { display: block; max-width: 100%; }

.shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; min-height: 66px; padding: 10px clamp(16px, 4vw, 34px);
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--ink);
  border-radius: 13px; font-family: Georgia, serif; font-size: 21px; background: var(--surface);
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-button, .small-button, .ghost-button, .primary-button, .danger-button {
  border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .18s ease, background .18s ease, opacity .18s ease;
}
.icon-button:active, .small-button:active, .ghost-button:active, .primary-button:active { transform: scale(.97); }
.icon-button { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.icon-button svg, .small-button svg { width: 19px; height: 19px; }
.small-button { min-height: 40px; padding: 0 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.primary-button { min-height: 50px; padding: 0 20px; border-radius: 15px; background: var(--brand); color: white; font-weight: 800; }
.primary-button[disabled] { opacity: .42; cursor: not-allowed; }
.ghost-button { min-height: 46px; padding: 0 18px; border-radius: 14px; background: #edeae4; font-weight: 700; }
.danger-button { min-height: 42px; padding: 0 14px; border-radius: 13px; background: #f7e6e3; color: var(--danger); font-weight: 700; }
.link-button { border: 0; background: none; padding: 6px; color: var(--brand); font-weight: 750; cursor: pointer; }

.public-main { width: min(1120px, 100%); margin: 0 auto; padding: 34px clamp(16px, 4vw, 34px) calc(112px + var(--safe-bottom)); }
.shop-hero { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 18px 0 30px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.shop-hero h1 { margin-bottom: 8px; font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 6vw, 58px); line-height: 1.08; font-weight: 650; }
.shop-hero p { margin-bottom: 0; color: var(--muted); }
.contact-link { text-decoration: none; flex: none; }
.view-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; }
.view-title h1, .view-title h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(27px, 4vw, 38px); }
.view-title > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.page-view-title { padding-top: 18px; margin-bottom: 24px; }
.category-view-filters { padding-bottom: 22px; }

.customer-tabs {
  position: fixed; z-index: 35; left: 50%; bottom: calc(16px + var(--safe-bottom)); transform: translateX(-50%);
  width: min(390px, calc(100% - 28px)); display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent); border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 14px 42px rgba(22,35,31,.18); backdrop-filter: blur(18px);
}
.customer-tabs button { position: relative; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
.customer-tabs button.active { color: white; background: var(--brand); }
.customer-tabs svg { width: 21px; height: 21px; }
.customer-tabs em { position: absolute; top: 5px; right: calc(50% - 25px); min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; background: var(--accent); color: white; font-size: 10px; font-style: normal; }
.customer-tabs em:empty { display: none; }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 20px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 15px; cursor: pointer; }
.filter-chip.active { background: var(--ink); color: white; border-color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 22px); }
.product-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.product-media { position: relative; aspect-ratio: 4 / 5; background: #e8e5df; overflow: hidden; }
.product-media img, .product-media video { width: 100%; height: 100%; object-fit: cover; }
.product-media video { pointer-events: none; }
.video-badge { position: absolute; top: 12px; right: 12px; padding: 6px 9px; border-radius: 999px; color: white; background: rgba(20, 28, 26, .72); font-size: 12px; backdrop-filter: blur(8px); }
.media-count { position: absolute; left: 12px; bottom: 12px; padding: 6px 9px; border-radius: 999px; color: white; background: rgba(20, 28, 26, .72); font-size: 12px; backdrop-filter: blur(8px); }
.favorite-button { position: absolute; z-index: 3; right: 10px; top: 10px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(24,35,31,.13); backdrop-filter: blur(9px); cursor: pointer; }
.favorite-button svg { width: 19px; height: 19px; }
.favorite-button.active { color: #b64c45; background: #fff7f5; }
.favorite-button.active svg { fill: currentColor; }
.product-copy { padding: 14px 15px 17px; }
.product-copy:empty { display: none; }
.product-copy h3 { margin-bottom: 5px; font-size: 16px; line-height: 1.35; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.product-price { color: var(--accent); font-weight: 850; font-size: 16px; }
.empty-state { grid-column: 1 / -1; padding: 70px 24px; text-align: center; border: 1px dashed #c9cbc4; border-radius: var(--radius); color: var(--muted); }
.empty-state .empty-icon { font-size: 34px; margin-bottom: 14px; }
.favorites-empty .empty-heart { margin-bottom: 12px; color: var(--accent); font-size: 48px; line-height: 1; }
.favorites-empty .small-button { margin: 14px auto 0; }
.empty-upload { width: 100%; background: transparent; cursor: pointer; font: inherit; }
.empty-upload strong, .empty-upload span { display: block; }
.empty-upload strong { margin-bottom: 8px; color: var(--ink); font-size: 16px; }
.empty-source-actions { width: min(300px, 100%); display: grid; grid-template-columns: 1fr; gap: 9px; margin: 22px auto 0; }
.empty-source-actions button, .quick-upload-bar button { min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--brand); font-weight: 800; cursor: pointer; }

.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-intro { padding: clamp(38px, 8vw, 96px); display: flex; flex-direction: column; justify-content: space-between; background: var(--brand); color: white; }
.auth-intro .brand-mark { border-color: rgba(255,255,255,.6); background: transparent; }
.auth-intro h1 { margin: 70px 0 18px; font-family: Georgia, "Songti SC", serif; font-size: clamp(44px, 7vw, 80px); line-height: 1.06; font-weight: 500; max-width: 760px; }
.auth-intro p { max-width: 520px; color: rgba(255,255,255,.75); font-size: 18px; line-height: 1.7; }
.auth-note { color: rgba(255,255,255,.55); font-size: 13px; }
.auth-panel { display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(430px, 100%); padding: clamp(24px, 5vw, 38px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card h2 { margin-bottom: 8px; font-size: 28px; }
.auth-card > p { margin-bottom: 26px; color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 760; }
.input, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 15px; background: #faf8f4; color: var(--ink);
  outline: none; padding: 14px 15px; min-height: 50px; transition: border .18s, box-shadow .18s;
}
.input:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.textarea { min-height: 98px; resize: vertical; }
.form-error { min-height: 22px; color: var(--danger); font-size: 14px; }
.auth-card .primary-button { width: 100%; margin-top: 4px; }

.dashboard-main { width: min(1160px, 100%); margin: 0 auto; padding: 28px clamp(16px, 4vw, 34px) 120px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 26px; }
.dashboard-head h1 { margin-bottom: 7px; font-size: clamp(29px, 5vw, 42px); }
.dashboard-head p { margin-bottom: 0; color: var(--muted); }
.share-box { display: flex; align-items: center; gap: 8px; padding: 8px 9px 8px 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--muted); font-size: 13px; }
.share-box span { max-width: 260px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.manage-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.manage-card .product-media { aspect-ratio: 1; }
.manage-copy { padding: 12px 13px; min-height: 62px; }
.manage-filter { margin-bottom: 8px; }
.manage-copy h3 { margin-bottom: 4px; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.manage-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.manage-actions { display: flex; gap: 7px; padding: 0 11px 11px; }
.manage-actions button { flex: 1; min-height: 36px; border-radius: 11px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px; }
.manage-actions .delete { color: var(--danger); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #57a780; display: inline-block; margin-right: 5px; }
.status-dot.off { background: #aaa; }
.fab {
  position: fixed; z-index: 25; right: max(20px, calc((100vw - 1160px) / 2 + 30px)); bottom: calc(22px + var(--safe-bottom));
  min-height: 58px; padding: 0 24px; border: 0; border-radius: 18px; color: white; background: var(--brand);
  box-shadow: 0 14px 36px rgba(21, 63, 54, .28); font-weight: 850; cursor: pointer; font-size: 16px;
}
.quick-upload-bar {
  position: fixed; z-index: 25; right: max(20px, calc((100vw - 1160px) / 2 + 30px)); bottom: calc(22px + var(--safe-bottom));
  width: min(390px, calc(100% - 32px)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 8px;
  border-radius: 18px; background: var(--brand); box-shadow: 0 14px 36px rgba(21, 63, 54, .28);
}
.quick-upload-bar button { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.96); }
.quick-media-input { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; background: rgba(19, 27, 24, .45); backdrop-filter: blur(5px); }
.modal-backdrop.dialog-layer { place-items: center; }
.sheet { width: min(680px, 100%); max-height: 94dvh; overflow-y: auto; margin: 0 auto; border-radius: 28px 28px 0 0; background: var(--surface); box-shadow: 0 -20px 70px rgba(0,0,0,.18); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 21px; }
.sheet-body { padding: 20px 20px calc(28px + var(--safe-bottom)); }
.media-picker { position: relative; display: grid; place-items: center; gap: 16px; min-height: 280px; padding: 22px; border: 1.5px dashed #aeb7b2; border-radius: 21px; background: #f0eee8; overflow: hidden; text-align: center; }
.media-picker .picker-copy strong { display: block; font-size: 19px; margin-bottom: 8px; }
.media-picker .picker-copy span { color: var(--muted); font-size: 14px; }
.media-picker .picker-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 18px; background: var(--surface); font-size: 27px; }
.media-preview { width: 100%; max-height: 56dvh; object-fit: contain; }
.media-change { position: absolute; right: 12px; bottom: 12px; padding: 9px 13px; border-radius: 12px; background: rgba(20,28,26,.76); color: white; font-weight: 750; font-size: 13px; }
.media-source-actions { width: min(420px, 100%); display: grid; grid-template-columns: 1fr; gap: 9px; }
.media-source-button { position: relative; min-height: 46px; display: grid; place-items: center; padding: 8px 12px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); font-weight: 800; cursor: pointer; }
.media-source-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.media-editor { padding: 15px; border: 1px solid var(--line); border-radius: 20px; background: #f7f4ee; }
.media-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.media-editor-head > div { display: flex; align-items: center; gap: 8px; }
.media-editor-head strong { font-size: 15px; }
.media-editor-head span, .media-editor-head small { color: var(--muted); font-size: 12px; }
.media-editor-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 1px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.media-edit-item, .media-add-tile { flex: 0 0 138px; scroll-snap-align: start; }
.media-edit-item { padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.media-edit-preview { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 11px; background: #e8e5df; }
.media-edit-preview img, .media-edit-preview video { width: 100%; height: 100%; object-fit: cover; }
.media-edit-preview video { pointer-events: none; }
.cover-badge { position: absolute; left: 7px; top: 7px; padding: 4px 7px; border-radius: 999px; color: white; background: var(--brand); font-size: 11px; font-weight: 800; }
.media-remove { position: absolute; right: 6px; top: 6px; width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 50%; color: white; background: rgba(20,28,26,.72); font-size: 19px; line-height: 1; cursor: pointer; }
.media-order-actions { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; gap: 3px; margin-top: 7px; }
.media-order-actions button { min-height: 29px; border: 0; border-radius: 8px; background: #efede8; color: var(--brand); font-weight: 800; cursor: pointer; }
.media-order-actions button[disabled] { opacity: .28; cursor: default; }
.media-order-actions .set-cover { padding: 0 3px; font-size: 11px; white-space: nowrap; }
.media-order-actions span { text-align: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.media-add-tile { position: relative; min-height: 174px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed #aeb7b2; border-radius: 15px; color: var(--brand); background: rgba(255,255,255,.62); cursor: pointer; text-align: center; }
.media-add-tile > span { font-size: 28px; line-height: 1; }
.media-add-tile strong { font-size: 13px; }
.media-add-tile small { color: var(--muted); font-size: 11px; }
.media-add-tile input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.media-editor .upload-hint { margin-bottom: 0; line-height: 1.55; }
.optional-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: none; padding: 20px 2px 14px; font-weight: 800; cursor: pointer; }
.optional-fields { display: none; }
.optional-fields.open { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.single { grid-template-columns: 1fr; }
.form-actions { display: grid; grid-template-columns: .72fr 1.28fr; gap: 10px; margin-top: 22px; }
.form-actions .primary-button, .form-actions .ghost-button { width: 100%; }
.upload-hint { margin: 11px 2px 0; color: var(--muted); font-size: 12px; }
.category-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.category-option {
  width: auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer; font-weight: 700; text-align: center;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.category-option.selected { border-color: var(--brand); background: var(--brand); color: white; }
.category-option.selected::after { content: "✓"; font-size: 16px; font-weight: 900; }
.category-option.add-category { border-style: dashed; color: var(--brand); background: var(--brand-soft); }
.category-help { margin: 9px 2px 0; color: var(--muted); font-size: 12px; }
.category-list { display: grid; gap: 9px; }
.category-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: #faf8f4; }
.category-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-row-actions { display: flex; gap: 7px; flex: none; }
.category-row-actions button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.category-row-actions .delete { color: var(--danger); }
.dashboard-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 22px; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 20px; }
.preset-button { min-height: 62px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #faf8f4; cursor: pointer; font-weight: 800; }
.preset-button small { display: block; margin-top: 3px; color: var(--muted); font-weight: 500; }
.settings-list { display: grid; gap: 10px; }
.setting-row { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(280px, 1.3fr); gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.setting-label strong { display: block; margin-bottom: 3px; }
.setting-label small { color: var(--muted); }
.state-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; border-radius: 13px; background: #edeae4; }
.state-option { min-height: 37px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-weight: 700; color: var(--muted); }
.state-option.active { color: var(--brand); background: var(--surface); box-shadow: 0 2px 8px rgba(31,40,37,.08); }
.field-required { color: var(--accent); margin-left: 3px; }
.confirm-dialog { width: min(430px, calc(100% - 32px)); padding: 24px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.confirm-dialog h2 { margin-bottom: 10px; font-size: 21px; }
.confirm-dialog > p { margin-bottom: 20px; color: var(--muted); line-height: 1.65; }
.confirm-dialog .form-actions { margin-top: 18px; }
.confirm-dialog .danger-confirm { background: var(--danger); }

.detail-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(19,27,24,.68); backdrop-filter: blur(6px); }
.detail-card { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); width: min(920px, 100%); max-height: 90dvh; overflow: hidden; border-radius: 25px; background: var(--surface); }
.detail-media { position: relative; min-height: 460px; background: #e8e5df; overflow: hidden; }
.detail-gallery { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.detail-gallery::-webkit-scrollbar { display: none; }
.detail-slide { flex: 0 0 100%; min-width: 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: start; }
.detail-slide img, .detail-slide video { width: 100%; height: 100%; object-fit: contain; }
.gallery-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; padding: 7px 11px; border-radius: 999px; background: rgba(20,28,26,.72); color: white; font-size: 12px; white-space: nowrap; }
.detail-copy { padding: 34px; overflow-y: auto; }
.detail-copy h2 { font-size: 28px; line-height: 1.3; }
.detail-copy .product-price { margin-bottom: 20px; font-size: 24px; }
.detail-copy p { color: var(--muted); line-height: 1.7; white-space: pre-wrap; }
.detail-actions { position: absolute; top: 13px; right: 13px; z-index: 4; display: flex; gap: 8px; }
.detail-actions .favorite-button, .detail-actions .detail-close { position: static; }

.admin-list { display: grid; gap: 11px; }
.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.admin-row h3 { margin-bottom: 4px; font-size: 16px; }
.admin-row p { margin: 0; color: var(--muted); font-size: 13px; }
.admin-actions { display: flex; gap: 7px; }
.create-panel { margin-bottom: 24px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.create-panel h2 { margin-bottom: 16px; font-size: 20px; }
.admin-fields { display: grid; grid-template-columns: 1.15fr .8fr .9fr 1.1fr auto; gap: 10px; align-items: end; }
.admin-fields .field { margin: 0; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translate(-50%, 18px); padding: 11px 16px; border-radius: 999px; background: #17201d; color: white; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); font-size: 14px; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { min-height: 60dvh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { min-height: 38dvh; padding: 30px 26px; }
  .auth-intro h1 { margin: 42px 0 10px; font-size: 43px; }
  .auth-intro p { font-size: 15px; }
  .auth-note { display: none; }
  .auth-panel { margin-top: -28px; align-items: start; }
  .detail-card { grid-template-columns: 1fr; overflow-y: auto; }
  .detail-media { min-height: 0; aspect-ratio: 1; }
  .detail-copy { padding: 24px; overflow: visible; }
  .admin-fields { grid-template-columns: 1fr 1fr; }
  .admin-fields .primary-button { min-height: 50px; }
}

@media (max-width: 580px) {
  .topbar { min-height: 58px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card { border-radius: 16px; }
  .product-copy { padding: 11px 12px 13px; }
  .shop-hero { align-items: start; flex-direction: column; padding-top: 8px; }
  .shop-hero h1 { font-size: 38px; }
  .dashboard-head { flex-direction: column; }
  .share-box { width: 100%; justify-content: space-between; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fab, .quick-upload-bar { left: 16px; right: 16px; width: calc(100% - 32px); }
  .sheet { border-radius: 22px 22px 0 0; }
  .sheet-body { padding-inline: 15px; }
  .media-picker { min-height: 230px; }
  .media-editor { padding: 12px; }
  .media-edit-item, .media-add-tile { flex-basis: 126px; }
  .media-add-tile { min-height: 162px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .admin-row { grid-template-columns: 1fr; }
  .admin-fields { grid-template-columns: 1fr; }
  .admin-actions { width: 100%; }
  .admin-actions button { flex: 1; }
  .preset-row { grid-template-columns: 1fr; }
  .preset-button { min-height: 52px; }
  .setting-row { grid-template-columns: 1fr; gap: 9px; }
}
