:root {
  --bg: #f4f2ea;
  --card: #ffffff;
  --ink: #2f3a2a;
  --muted: #87907a;
  --muted-ink: #5f6855;
  --accent: #6b7d55;
  --btn: #55663f;
  --btn-ink: #f7f6ef;
  --chip: #ebeee2;
  --line: #d3d9c4;
  --danger: #9a4a3a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(47, 58, 42, .05), 0 6px 18px rgba(47, 58, 42, .07);
  --shadow-up: 0 -8px 24px rgba(47, 58, 42, .08);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
  color-scheme: light only;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/1.5 var(--sans);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.is-locked { overflow: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; flex: none; }

.shell { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); }
.shell.has-cart { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }
.view { padding: 20px 16px 8px; max-width: 640px; margin: 0 auto; outline: none; }
.view.is-entering { animation: view-in .32s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.title { font: 600 var(--fs-2xl)/1.15 var(--serif); margin: 4px 0 16px; letter-spacing: -.01em; }
.subtitle { font: 600 var(--fs-xl)/1.2 var(--serif); margin: 28px 0 12px; }
.lead { color: var(--muted-ink); margin: -8px 0 18px; }

.search {
  display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 16px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.search .icon { color: var(--muted); }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 16px; }
.search-input::placeholder { color: var(--muted); }
.search-clear { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); margin-right: -8px; border-radius: 50%; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips + .chips { margin-top: 8px; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--chip); color: var(--ink); font-size: var(--fs-sm); font-weight: 600;
  transition: background-color .2s, color .2s, transform .15s;
}
.chip:active { transform: scale(.97); }
.chip.is-on { background: var(--btn); color: var(--btn-ink); }
.chip-type { background: transparent; color: var(--muted-ink); font-weight: 500; }
.chip-type.is-on { background: var(--accent); color: var(--btn-ink); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-align: left;
  transition: transform .2s var(--ease), box-shadow .2s;
  animation: card-in .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card:active { transform: scale(.985); }
.card-open { display: flex; flex-direction: column; flex: 1; text-align: left; width: 100%; }
.card-media { position: relative; aspect-ratio: 4 / 5; background: var(--chip); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.card-media img.is-loaded { opacity: 1; }
.card-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.card-noimg .icon { width: 40px; height: 40px; }
.card-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; flex: 1; }
.card-code { font: 600 var(--fs-lg)/1.2 var(--serif); }
.card-orig {
  color: var(--muted-ink); font-size: var(--fs-sm); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 8px; }
.card-price { font-weight: 700; font-size: var(--fs-md); white-space: nowrap; }
.card.is-out .card-price { color: var(--muted-ink); }
.stock { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--btn); white-space: nowrap; }
.stock-out { color: var(--muted-ink); }
.card-heart {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
}
.card-heart span {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 1px 4px rgba(47, 58, 42, .12);
  transition: transform .2s var(--ease), color .2s;
}
.card-heart .icon { width: 19px; height: 19px; }
.card-heart.is-on span, .heart-btn.is-on { color: var(--btn); }
.heart-pop { animation: heart-pop .35s var(--ease); }
@keyframes heart-pop { 40% { transform: scale(1.22); } }
.marks { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; z-index: 1; }
.mark { font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 4px 8px; border-radius: 8px; background: var(--btn); color: var(--btn-ink); }
.mark-new { background: var(--card); color: var(--btn); }

.skeleton { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.skeleton-media { aspect-ratio: 4 / 5; }
.skeleton-line { height: 12px; margin: 12px 12px 0; border-radius: 6px; }
.skeleton-line:last-child { width: 50%; margin-bottom: 14px; }
.shimmer { background: linear-gradient(90deg, var(--chip) 0%, #f3f5ec 50%, var(--chip) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty { text-align: center; padding: 48px 16px; color: var(--muted-ink); }
.empty .icon { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--muted); }
.empty-title { font: 600 var(--fs-xl)/1.25 var(--serif); color: var(--ink); margin: 0 0 6px; }
.empty .btn { margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: var(--radius);
  font-weight: 700; font-size: var(--fs-md);
  transition: background-color .2s, transform .15s, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn-main { background: var(--btn); color: var(--btn-ink); box-shadow: 0 4px 14px rgba(47, 58, 42, .16); }
.btn-soft { background: var(--chip); color: var(--ink); }
.btn-danger { background: var(--danger); color: var(--btn-ink); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--radius-sm); }

.cartbar {
  position: fixed; left: 12px; right: 12px; z-index: 20;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  max-width: 616px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px;
  border-radius: var(--radius); background: var(--btn); color: var(--btn-ink);
  box-shadow: 0 8px 24px rgba(47, 58, 42, .22); text-align: left;
  animation: rise .35s var(--ease);
}
.cartbar-text { flex: 1; font-weight: 600; }
.cartbar-go { font-weight: 700; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--card); box-shadow: var(--shadow-up);
}
.tab {
  position: relative; flex: 1; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted-ink); font-size: 12px; font-weight: 600; transition: color .2s;
}
.tab.is-on { color: var(--btn); }
.tab-badge {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 12px; line-height: 18px; text-align: center;
}

.screen {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); -webkit-overflow-scrolling: touch;
}
.screen.is-entering { animation: screen-in .38s var(--ease); }
.screen.is-leaving { animation: screen-out .26s ease-in forwards; }
@keyframes screen-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes screen-out { to { transform: translateX(24px); opacity: 0; } }

.gallery { position: sticky; top: 0; height: min(62dvh, 125vw); background: var(--chip); }
.gallery-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gallery .card-noimg .icon { width: 64px; height: 64px; }
.gallery-dots { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; gap: 6px; }
.gallery-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .6); transition: background-color .2s, width .2s; }
.gallery-dot.is-on { background: #fff; width: 18px; border-radius: 4px; }
.float-btn {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 3;
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 2px 8px rgba(47, 58, 42, .14);
}
.float-back { left: 12px; }
.float-share { right: 64px; }
.float-heart { right: 12px; }

.panel {
  position: relative; z-index: 2; margin-top: -24px; min-height: 40dvh;
  background: var(--card); border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px 18px calc(110px + var(--safe-b));
  box-shadow: var(--shadow-up);
  animation: panel-up .5s var(--ease);
}
@keyframes panel-up { from { transform: translateY(60px); } to { transform: none; } }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-code { font: 600 var(--fs-3xl)/1.05 var(--serif); margin: 0; letter-spacing: -.01em; }
.gender { font-size: var(--fs-sm); font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--chip); color: var(--btn); }
.panel-marks { display: flex; gap: 6px; }
.panel-marks .mark { font-size: 12px; }
.panel-marks .mark-new { background: var(--chip); }
.panel-orig { margin: 8px 0 0; color: var(--muted-ink); font-size: var(--fs-md); }
.panel-orig b { color: var(--ink); font-weight: 600; }
.panel-types { margin: 4px 0 0; color: var(--muted-ink); font-size: var(--fs-sm); }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted-ink); margin: 24px 0 10px; }
.notes { display: grid; gap: 12px; }
.note-row { display: grid; grid-template-columns: 66px 1fr; gap: 10px; align-items: start; }
.note-name { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--btn); padding-top: 8px; }
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.note-chip { padding: 6px 12px; border-radius: 999px; background: var(--chip); font-size: var(--fs-sm); }
.volumes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.vol {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 64px; padding: 8px; border-radius: var(--radius-sm); background: var(--chip);
  transition: background-color .2s, color .2s, transform .15s;
}
.vol:active:not(:disabled) { transform: scale(.97); }
.vol-ml { font-weight: 700; font-size: var(--fs-md); }
.vol-price { font-size: var(--fs-sm); color: var(--muted-ink); }
.vol.is-on { background: var(--btn); color: var(--btn-ink); }
.vol.is-on .vol-price { color: var(--btn-ink); }
.vol:disabled { opacity: .45; }
.vol:disabled .vol-ml, .vol:disabled .vol-price { text-decoration: line-through; }
.vol-note { margin: 10px 0 0; color: var(--muted-ink); font-size: var(--fs-sm); }
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--card); box-shadow: var(--shadow-up);
}
.buybar .btn { width: 100%; max-width: 608px; margin: 0 auto; display: flex; }

.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(47, 58, 42, .38); animation: fade .25s ease; }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 18px calc(18px + var(--safe-b)); animation: sheet-up .4s var(--ease);
  -webkit-overflow-scrolling: touch;
}
.sheet-wrap.is-leaving .sheet { animation: sheet-down .25s ease-in forwards; }
.sheet-wrap.is-leaving .sheet-backdrop { animation: fade .25s ease reverse forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 14px; }
.sheet-title { font: 600 var(--fs-xl)/1.2 var(--serif); margin: 0 0 14px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; }
.line + .line { box-shadow: inset 0 1px 0 var(--line); }
.line-img { width: 56px; height: 70px; border-radius: 10px; object-fit: cover; background: var(--chip); }
.line-noimg { width: 56px; height: 70px; border-radius: 10px; background: var(--chip); display: grid; place-items: center; color: var(--muted); }
.line-code { font: 600 var(--fs-lg)/1.2 var(--serif); }
.line-meta { font-size: var(--fs-sm); color: var(--muted-ink); }
.line-price { font-weight: 700; margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 999px; padding: 2px; }
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.stepper button .icon { width: 18px; height: 18px; }
.stepper span { min-width: 18px; text-align: center; font-weight: 700; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; box-shadow: inset 0 1px 0 var(--line); font-weight: 700; font-size: var(--fs-lg); }
.total small { font-weight: 500; color: var(--muted-ink); font-size: var(--fs-sm); display: block; }
.field { display: block; margin-top: 16px; }
.field-label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.field-hint { display: block; color: var(--muted-ink); font-size: var(--fs-sm); margin-top: 6px; }
.field-input {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--chip); font-size: 16px; outline: none; transition: box-shadow .2s, background-color .2s;
}
.field-input:focus { background: #f2f4ec; box-shadow: inset 0 0 0 2px var(--accent); }
textarea.field-input { resize: vertical; min-height: 88px; line-height: 1.45; }
.field-error { color: var(--danger); font-size: var(--fs-sm); font-weight: 600; margin: 10px 0 0; }
.sheet-actions { display: grid; gap: 8px; margin-top: 18px; }
.done { text-align: center; padding: 18px 0 6px; }
.done-mark { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--btn); animation: heart-pop .5s var(--ease); }
.done-mark .icon { width: 30px; height: 30px; }
.done p { color: var(--muted-ink); margin: 0 auto; max-width: 300px; }

.order { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; animation: card-in .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-num { font: 600 var(--fs-lg)/1.2 var(--serif); }
.order-date { color: var(--muted-ink); font-size: var(--fs-sm); }
.status { font-size: var(--fs-xs); font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.status-new { background: var(--btn); color: var(--btn-ink); }
.status-work { background: #e4e9d6; color: var(--btn); }
.status-sent { background: var(--chip); color: var(--btn); }
.status-cancelled { background: #f1e6e2; color: var(--danger); }
.order-items { margin: 10px 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.order-items li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.order-items li span:first-child { color: var(--muted-ink); }
.order-comment { margin: 8px 0 0; font-size: var(--fs-sm); background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.order-total { display: flex; justify-content: space-between; margin-top: 10px; font-weight: 700; }
.order-buyer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.order-buyer-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.order-buyer-name small { display: block; color: var(--muted-ink); font-weight: 500; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 12px; }
.seg button { min-height: 44px; border-radius: var(--radius-sm); background: var(--chip); font-weight: 600; font-size: var(--fs-sm); transition: background-color .2s, color .2s; }
.seg button.is-on { background: var(--btn); color: var(--btn-ink); }
.seg button.is-on.seg-cancel { background: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px 10px 12px; box-shadow: var(--shadow); text-align: center; }
.stat-num { font: 600 var(--fs-2xl)/1 var(--serif); }
.stat-label { font-size: var(--fs-xs); color: var(--muted-ink); margin-top: 6px; font-weight: 600; }
.switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 18px 0 14px; background: var(--chip); border-radius: var(--radius); }
.switcher button { min-height: 44px; border-radius: 14px; font-weight: 700; color: var(--muted-ink); transition: background-color .2s, color .2s; }
.switcher button.is-on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.adm-row { display: grid; grid-template-columns: 60px 1fr; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); margin-bottom: 10px; animation: card-in .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.adm-thumb { width: 60px; height: 75px; border-radius: 10px; object-fit: cover; background: var(--chip); }
.adm-noimg { width: 60px; height: 75px; border-radius: 10px; background: var(--chip); display: grid; place-items: center; color: var(--muted); }
.adm-info { min-width: 0; }
.adm-code { font: 600 var(--fs-lg)/1.2 var(--serif); display: flex; gap: 8px; align-items: center; }
.adm-hidden { font: 700 12px/1 var(--sans); color: var(--muted-ink); background: var(--chip); padding: 4px 7px; border-radius: 6px; }
.adm-orig { font-size: var(--fs-sm); color: var(--muted-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.adm-actions .btn { flex: 1; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: var(--fs-sm); min-height: 44px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--line); transition: background-color .2s; flex: none; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(47, 58, 42, .25); transition: transform .25s var(--ease); }
.toggle input:checked + .toggle-track { background: var(--btn); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.adm-stock { margin-top: 4px; }

.editor-top {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: var(--bg);
}
.editor-top h1 { font: 600 var(--fs-xl)/1.2 var(--serif); margin: 0; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.editor-form { padding: 0 16px calc(110px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.ed-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-top: 12px; }
.ed-card > .field:first-child { margin-top: 0; }
.ed-card-title { font-weight: 700; margin: 0 0 4px; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.photo { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); overflow: hidden; background: var(--chip); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-del { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; display: grid; place-items: center; }
.photo-del span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .94); }
.photo-del .icon { width: 16px; height: 16px; }
.photo-first { position: absolute; left: 6px; bottom: 6px; font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--card); color: var(--btn); }
.photo-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); background: var(--chip); color: var(--btn); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; text-align: center; padding: 6px; }
.photo-add input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-add .icon { width: 28px; height: 28px; }
.photo-busy { display: grid; place-items: center; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vol-rows { display: grid; gap: 10px; margin-top: 10px; }
.vol-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto 44px; gap: 8px; align-items: center; }
.vol-row .field-input { min-height: 48px; padding: 10px 12px; }
.vol-row .toggle { font-size: var(--fs-xs); gap: 6px; flex-direction: column; min-height: 0; }
.vol-row .toggle-track { width: 44px; height: 26px; }
.vol-row .toggle-track::after { width: 20px; height: 20px; }
.vol-row .toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.vol-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto 44px; gap: 8px; font-size: var(--fs-xs); color: var(--muted-ink); font-weight: 600; margin-top: 12px; }
.marks-row { display: grid; gap: 4px; margin-top: 6px; }
.ed-addvol { margin-top: 12px; }
.adm-add { margin-bottom: 14px; }

.confirm { border: 0; padding: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); width: min(360px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(47, 58, 42, .25); }
.confirm[open] { animation: pop .25s var(--ease); }
.confirm::backdrop { background: rgba(47, 58, 42, .4); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.confirm-box { padding: 22px 20px 18px; margin: 0; }
.confirm-title { font: 600 var(--fs-xl)/1.25 var(--serif); margin: 0 0 8px; }
.confirm-text { margin: 0 0 18px; color: var(--muted-ink); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-actions .btn { width: 100%; padding: 0 12px; }
.linkbox-input { margin-bottom: 16px; font-size: var(--fs-sm); }
#linkbox .confirm-actions { grid-template-columns: 1fr; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); z-index: 80;
  transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg);
  font-weight: 600; font-size: var(--fs-sm); box-shadow: 0 8px 24px rgba(47, 58, 42, .25);
  animation: toast-in .3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: currentColor; animation: spin .8s linear infinite; }
.spinner-dark { border-color: var(--line); border-top-color: var(--btn); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .grid { gap: 8px; }
  .chips { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .card-body { padding: 8px 10px 10px; }
  .card-price { font-size: var(--fs-sm); }
  .stock { padding: 2px 7px; }
  .note-row { grid-template-columns: 58px 1fr; }
  .vol-row, .vol-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto 40px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
