@import url("./catalog-layout.css");
:root{--paper:#fff;--base:#f5f5f7;--ink:#17171a;--solid:#19191c;--on:#fff;--soft:#ededf0;color-scheme:light}
:root{color:var(--ink);background:var(--base);font:15px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;--line:#e4e4ea;--sub:#65656d}*{box-sizing:border-box}body{margin:0}a{color:inherit;text-decoration:none}button,input,select{font:inherit;color:inherit}button,a,input,select{touch-action:manipulation}header{height:66px;background:var(--paper);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 clamp(16px,4vw,48px)}header a{font-weight:700;display:flex;align-items:center;gap:9px}.mark{display:grid;place-items:center;background:var(--solid);color:var(--on);width:32px;height:32px;border-radius:9px}.account,.hint,small{color:var(--sub)}.shell{display:grid;grid-template-columns:200px minmax(0,1fr);min-height:calc(100vh - 66px)}nav{padding:20px 15px;border-right:1px solid var(--line)}nav a{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;border-radius:10px;margin-bottom:3px}nav a[aria-current]{background:var(--solid);color:var(--on)}main{width:100%;max-width:1220px;padding:28px clamp(16px,4vw,46px);margin:0 auto}h1{font-size:clamp(25px,4vw,36px);letter-spacing:-.06em;margin:0 0 20px}h2{font-size:19px;margin:0 0 10px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr));gap:12px;margin-bottom:22px}.tile,.panel{background:var(--paper);border:1px solid var(--line);border-radius:16px;padding:16px}.tile{display:flex;flex-direction:column;gap:8px}.tile:hover{border-color:#73737b}.tile b{font-size:17px}.tile strong{font-size:23px}.panel{margin-bottom:14px}.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0}button,.action,input,select{border:1px solid var(--line);background:var(--paper);border-radius:9px;min-height:44px;padding:8px 11px}button,.action{cursor:pointer;text-align:center}.primary{background:var(--solid);color:var(--on);border-color:var(--solid)}label{display:grid;gap:4px;color:var(--sub);min-width:0}input,select{width:100%;color:var(--ink)}form{display:grid;gap:12px}.fields,.line{display:grid;gap:9px;align-items:end;grid-template-columns:repeat(auto-fit,minmax(min(130px,100%),1fr))}.table{overflow:auto}table{border-collapse:collapse;width:100%;min-width:380px;text-align:left;font-variant-numeric:tabular-nums}td,th{padding:10px;border-bottom:1px solid var(--line);white-space:nowrap}th{color:var(--sub);font-weight:500;font-size:13px}.error{color:#9d1e1e;min-height:1em;margin:0}.status{padding:3px 8px;border-radius:999px;background:var(--soft)}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:13px}.tabs a{min-height:44px;display:flex;align-items:center;padding:6px 12px;border-radius:9px;background:var(--paper);border:1px solid var(--line)}.tabs a.active{background:var(--solid);color:var(--on)}@media(max-width:680px){.shell{display:block}header{height:56px}nav{display:flex;overflow:auto;white-space:nowrap;padding:7px 10px;border-right:0;border-bottom:1px solid var(--line)}nav a{margin:0 3px 0 0}main{padding:17px 12px}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tile,.panel{padding:12px}.line{grid-template-columns:1fr 1fr}.line label:first-child{grid-column:1/-1}}
.reference-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.reference-grid a{min-height:103px;display:grid;place-items:center;align-content:center;gap:8px;text-align:center}.reference-grid a span{display:grid;place-items:center;border-radius:13px;width:43px;height:43px;background:var(--solid);color:var(--on);font-size:21px}.reference-grid a b{font-size:15px}.home-tab{display:flex;justify-content:center;padding:12px;font-weight:600;color:var(--ink)}@media(max-width:680px){.reference-grid{gap:7px}.reference-grid a{min-height:86px;padding:5px}.reference-grid a b{font-size:13px}.reference-grid a span{width:36px;height:36px}}
.shell.landing{display:block}.landing nav[hidden]{display:none}
.bottom{display:flex;justify-content:center;gap:12px;border:0;margin-top:17px;padding:10px;border-top:1px solid var(--line);overflow:visible}.bottom a{justify-content:center;min-width:110px;text-align:center}.profile-account,.profile-list a{min-height:48px;display:grid;align-items:center;gap:12px;grid-template-columns:auto 1fr auto}.profile-list a+a{border-top:1px solid var(--line)}.profile-list a>span,.profile-account>span:last-child{color:var(--sub)}.avatar{border-radius:13px;width:52px;height:52px;display:grid;place-items:center;background:var(--solid);color:var(--on);font-weight:600;font-size:24px}

:root[data-theme="dark"]{--paper:#1c1c1e;--base:#000;--ink:#f5f5f7;--solid:#f5f5f7;--on:#17171a;--soft:#29292d;--line:#38383a;--sub:#aaaab1;color-scheme:dark}.header-actions{display:flex;align-items:center;gap:10px}.reference-grid svg,.profile-list svg{width:23px;height:23px;display:block}.profile-list svg{width:18px;height:18px}.reference-grid a span{background:var(--soft);color:var(--ink)}.error{color:#b42424}:root[data-theme="dark"] .error{color:#ff8888}.error:empty{display:none}.shell.landing main{max-width:1080px}
.spread{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.page-title{margin-bottom:18px}.page-title h1{margin:0}.group-title{color:var(--sub);font-size:15px;margin:20px 0 10px}.search{display:flex;gap:8px;margin-bottom:16px}.search input{min-width:0}.product-card{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.product-card>div{flex:1;min-width:120px}.thumb{width:66px;height:66px;border-radius:12px;object-fit:cover;display:inline-flex;align-items:center;justify-content:center;background:var(--soft);flex:none}.thumb svg{width:28px;height:28px;color:var(--sub)}.thumbnails{display:flex;gap:7px;margin:12px 0}.order-heading{font-size:17px;font-weight:600}.picker{position:fixed;inset:6vh 12px auto;margin:0 auto;max-width:760px;width:calc(100% - 24px);max-height:85vh;overflow:auto;border:1px solid var(--line);border-radius:20px;background:var(--paper);color:var(--ink);padding:20px;box-shadow:0 0 0 100vmax #0008;z-index:10}.picker .product-card{padding:12px 0;border-bottom:1px solid var(--line)}.picker h3{font-size:15px;color:var(--sub);margin:20px 0 8px}.picker h3~button{margin:4px}.empty{padding:36px 0;text-align:center;color:var(--sub)}.discount{margin:20px 0;padding-top:16px;border-top:1px solid var(--line)}.contact-row button{width:100%;text-align:left}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}textarea{font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:10px;min-height:80px;padding:10px;width:100%}.check{display:flex;align-items:center;gap:8px}.check input,input[type=checkbox]{width:22px;min-height:22px;accent-color:var(--solid)}.picker input{min-width:88px}.error{overflow-wrap:anywhere}.panel p{margin:9px 0}.table small{white-space:normal}button:focus-visible,a:focus-visible{outline:2px solid var(--ink);outline-offset:3px}@media(max-width:680px){.account{display:none}.product-card .action,.product-card button{min-width:64px}.page-title .action{font-size:12px}.picker{inset:20px 8px auto;width:calc(100% - 16px);padding:14px;max-height:90vh}.spread{gap:8px}.thumb{width:53px;height:53px}.table{max-width:100%}}@media print{header,nav,.page-title,.actions,button,form,.error{display:none!important}.shell{display:block}main{padding:0;max-width:none}.panel{border:0;padding:0}body{background:white;color:black}}

/* Reference appearance uses the observed mini-program palette and spacing. */
:root[data-theme="reference"] {
  --paper: #fff;
  --base: #f2f8fa;
  --ink: #242424;
  --solid: #62acf3;
  --on: #fff;
  --soft: #f6f7f8;
  --line: #ededed;
  --sub: #898989;
  color-scheme: light;
}
.bottom svg { width: 28px; height: 28px; flex: none; }
.bottom a { flex-direction: column; gap: 4px; }
.reference-grid .reference-icon { width: 40px; height: 40px; }
:root[data-theme="reference"] body { background: var(--base); }
:root[data-theme="reference"] body > header { display: none; }
:root[data-theme="reference"] .shell { min-height: 100dvh; display: block; }
:root[data-theme="reference"] .shell > nav { display: none; }
:root[data-theme="reference"] main {
  padding: 0 0 calc(76px + env(safe-area-inset-bottom));
  max-width: 1024px;
}
:root[data-theme="reference"] .page-title {
  height: 64px;
  margin: 0;
  padding: 0 18px;
  background: #fff;
  position: relative;
  display: flex;
  justify-content: center;
}
:root[data-theme="reference"] .page-title h1 { font-size: 18px; letter-spacing: 0; font-weight: 600; }
:root[data-theme="reference"] .page-title > a {
  position: absolute;
  left: 14px;
  top: 10px;
  border: 0;
  font-size: 0;
  padding: 7px;
}
:root[data-theme="reference"] .page-title > a::before { content: "‹"; font-size: 32px; line-height: 1; }
:root[data-theme="reference"] .panel {
  border: 0;
  border-radius: 0;
  background: #fff;
  margin: 0 0 16px;
  padding: 20px 24px;
}
:root[data-theme="reference"] .panel h2 { font-size: 17px; font-weight: 500; }
:root[data-theme="reference"] .actions { padding: 0 16px; }
:root[data-theme="reference"] .panel .actions { padding: 0; }
:root[data-theme="reference"] button,
:root[data-theme="reference"] .action { border-radius: 2px; }
:root[data-theme="reference"] .primary { background: #62acf3; border-color: #62acf3; color: #fff; }
:root[data-theme="reference"] .search { background: #fff; padding: 7px 16px; margin: 0; }
:root[data-theme="reference"] .search input {
  background: #f7f8fa;
  border: 0;
  border-radius: 0;
  text-align: center;
  min-height: 40px;
}
:root[data-theme="reference"] .search button { background: transparent; color: #888; border: 0; }
:root[data-theme="reference"] .group-title {
  margin: 0;
  padding: 20px 26px 12px;
  background: var(--base);
  color: #888;
}
:root[data-theme="reference"] .product-card { padding: 18px 24px; margin-bottom: 0; border-bottom: 1px solid #eee; }
:root[data-theme="reference"] .product-card strong { font-size: 16px; font-weight: 500; }
:root[data-theme="reference"] .product-card p:last-child { color: #ce6854; }
:root[data-theme="reference"] .product-card .thumb { width: 76px; height: 76px; border-radius: 0; }
:root[data-theme="reference"] .thumb.placeholder { background: #f7f7f7; color: #e7e7e7; }
:root[data-theme="reference"] .thumb.placeholder svg { width: 43px; height: 43px; color: #dedede; }
:root[data-theme="reference"] .order-heading { font-size: 16px; font-weight: 500; }
:root[data-theme="reference"] .order-heading small { color: inherit; font-size: 14px; }
:root[data-theme="reference"] .thumbnails { background: #f2f2f2; padding: 10px 16px; min-height: 70px; }
:root[data-theme="reference"] .thumbnails .thumb { border-radius: 0; }
:root[data-theme="reference"] .tabs { background: #fff; padding: 0; gap: 0; }
:root[data-theme="reference"] .tabs a {
  border: 0;
  flex: 1;
  justify-content: center;
  background: #fff;
  border-radius: 0;
  color: #666;
}
:root[data-theme="reference"] .tabs a.active {
  color: #222;
  border-bottom: 2px solid #ffc23c;
}
:root[data-theme="reference"] .bottom {
  position: fixed;
  z-index: 5;
  inset: auto 0 0;
  margin: 0;
  padding: 7px 0 calc(5px + env(safe-area-inset-bottom));
  display: flex;
  border: 0;
  border-top: 1px solid #526070;
  background: #3e4b5d;
  gap: 0;
}
:root[data-theme="reference"] .bottom a {
  flex: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  min-height: 44px;
  font-size: 12px;
  color: #a5adb5;
  background: transparent;
}
:root[data-theme="reference"] .bottom a[aria-current] { color: #ffcb37; background: transparent; }
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]),
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) body,
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main { background: #3e4b5d; }
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .page-title h1,
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .page-title > a { visibility: hidden; }
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .reference-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 42px 12px 8px;
  margin: 0;
}
:root[data-theme="reference"] .reference-grid .tile {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  display: grid;
  grid-template-rows: 36px auto;
  align-content: start;
  justify-items: center;
  gap: 13px;
  min-height: 96px;
  padding: 0 2px;
}
:root[data-theme="reference"] .reference-grid .tile:hover { background: #ffffff08; }
:root[data-theme="reference"] .reference-grid .tile > span { background: transparent; width: 36px; height: 36px; border-radius: 0; }
:root[data-theme="reference"] .reference-grid .reference-icon { width: 36px; height: 36px; }
:root[data-theme="reference"] .reference-grid .tile b { font-size: 16px; font-weight: 600; }
:root[data-theme="reference"][data-page="profile"][data-view=""] body { background: #3e4b5d; }
:root[data-theme="reference"][data-page="profile"][data-view=""] main { max-width: 1024px; }
:root[data-theme="reference"][data-page="profile"][data-view=""] .panel { background: #465365; color: #fff; }
:root[data-theme="reference"][data-page="profile"][data-view=""] .panel .hint,
:root[data-theme="reference"][data-page="profile"][data-view=""] .panel small,
:root[data-theme="reference"][data-page="profile"][data-view=""] .profile-list a > span { color: #adb4bd; }
:root[data-theme="reference"] .profile-account { min-height: 102px; grid-template-columns: auto 1fr auto; }
:root[data-theme="reference"] .profile-account strong { font-size: 22px; font-weight: 600; }
:root[data-theme="reference"] .profile-account small { font-size: 15px; }
:root[data-theme="reference"] .profile-account .avatar {
  width: 74px;
  height: 74px;
  border: 1px solid #aaa;
  border-radius: 8px;
  background: #fff3e4;
  color: #db9a4e;
}
:root[data-theme="reference"] .profile-list a { min-height: 48px; font-size: 17px; }
:root[data-theme="reference"] .profile-list a strong { font-weight: 500; }
:root[data-theme="reference"] .profile-list a + a { border-color: #526070; }
:root[data-theme="reference"] .profile-list a:nth-child(1) svg { color: #65abff; }
:root[data-theme="reference"] .profile-list a:nth-child(2) svg { color: #43c7a9; }
:root[data-theme="reference"] .profile-list a:nth-child(3) svg { color: #ff7c7b; }
:root[data-theme="reference"] .profile-list a:nth-child(4) svg { color: #65abff; }
:root[data-theme="reference"] .picker { border-radius: 12px 12px 0 0; }
:root[data-theme="reference"] .error:not(:empty) { padding: 8px 16px; background: #fff4e5; margin: 0; color: #9d5d1d; }
@media (min-width: 900px) {
  :root[data-theme="reference"] .reference-grid .tile { min-height: 116px; }
  :root[data-theme="reference"] .reference-grid .tile b { font-size: 18px; }
  :root[data-theme="reference"] .reference-grid .reference-icon { width: 42px; height: 42px; }
  :root[data-theme="reference"] .reference-grid .tile > span { width: 42px; height: 42px; }
}
@media print {
  :root[data-theme="reference"] .page-title,
  :root[data-theme="reference"] .bottom { display: none; }
  :root[data-theme="reference"] main { max-width: none; padding: 0; }
}
.avatar > svg { width: 90%; height: 90%; }
:root[data-theme="reference"] .profile-list svg { width: 25px; height: 25px; }
@media (min-width: 900px) {
  :root[data-theme="reference"] .reference-grid .tile {
    min-height: clamp(88px, calc((100dvh - 150px) / 6), 116px);
  }
}

.attribute-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  min-height: 44px;
}
.attribute-trigger:disabled { opacity: .65; cursor: default; }
.material-unit-summary { margin:0 0 12px; }
.material-unit-conversion { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.material-unit-equation { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) minmax(0,auto); gap:8px; align-items:center; margin-top:6px; }
.material-unit-equation input { min-width:0; }
.material-unit-equation span { overflow-wrap:anywhere; }
.material-unit-equation span:first-child { background:var(--soft); color:var(--ink); border-radius:10px; padding:11px 10px; }
.attribute-picker {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 824px);
  max-width: 100%;
  min-height: min(420px, 75dvh);
  max-height: 85dvh;
  overflow: auto;
  margin: auto auto 0;
  border: 0;
  border-radius: 16px 16px 0 0;
  padding: 28px 25px 24px;
  background: var(--paper);
  color: var(--ink);
}
.attribute-picker::backdrop { background: #0006; }
.attribute-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--line);
}
.attribute-heading h2 { margin: 0; font-size: 22px; font-weight: 600; }
.attribute-heading > button { border: 0; background: transparent; color: #626d8b; font-weight: 600; }
.attribute-close {
  position: absolute;
  top: 3px;
  right: 6px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #555;
  color: #ddd;
  font-size: 27px;
}
.attribute-tags { display: flex; flex-wrap: wrap; gap: 20px 16px; }
.attribute-option { display: flex; align-items: center; gap: 4px; }
.attribute-option > button:first-child {
  min-width: 74px;
  min-height: 38px;
  padding: 5px 14px;
  border: 1px solid #999daa;
  border-radius: 3px;
  background: transparent;
  color: #8b8e9b;
}
.attribute-option > button[aria-pressed="true"] {
  border-color: #62acf3;
  background: #eaf5ff;
  color: #3889d5;
}
.attribute-footer { margin-top: 35px; display: flex; justify-content: flex-end; }
.attribute-add { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.attribute-add label { flex: 1; min-width: 150px; }
.attribute-picker .attribute-status:empty { display: none; }
:root[data-theme="dark"] .attribute-option > button[aria-pressed="true"] {
  background: #263d51; color: #add8ff;
}
@media(max-width:480px) {
  .attribute-picker { padding: 25px 24px; }
  .attribute-heading h2 { font-size: 20px; }
  .attribute-tags { gap: 16px; }
  .attribute-option > button:first-child { min-width: 55px; padding: 3px 12px; }
}
.attribute-picker { min-height: min(300px, 65dvh); }
.attribute-picker > .attribute-close { border-radius: 50%; }
.floating-add {
  position: fixed;
  right: 24px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 4;
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #65a9e4;
  box-shadow: 0 3px 10px #0003;
  font-size: 38px;
  font-weight: 400;
  touch-action: none;
  user-select: none;
}
:root[data-theme="reference"] .floating-add { border-radius: 50%; }
.variant-price-table input { min-width: 90px; }
.variant-price-table th, .variant-price-table td { vertical-align: middle; }

/* Desktop module cards, following the user's latest home-page reference. */
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .page-title { display: none; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main {
  max-width: 1440px;
  padding: 24px 32px calc(88px + env(safe-area-inset-bottom));
}
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]),
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) body,
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main { background: #fdfdfd; }
.module-group { margin: 0 0 32px; }
.module-group > summary {
  width: fit-content;
  min-height: 44px;
  color: var(--sub);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 15px;
}
.module-group > summary::marker { color: #999; font-size: 13px; }
.module-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(18px, 3vw, 54px);
  row-gap: 26px;
  padding: 0 12px;
}
.module-card {
  min-width: 0;
  min-height: 100px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}
.module-card:hover { box-shadow: none; border-color: #c7cbd1; }
.module-icon { display: flex; flex: none; }
.module-icon svg { width: 42px; height: 42px; }
.module-copy { display: grid; gap: 9px; min-width: 0; }
.module-copy strong { font-size: 17px; font-weight: 400; overflow-wrap: anywhere; }
.module-copy small { font-size: 14px; color: var(--sub); }
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .bottom {
  background: #fff;
  border-top-color: #e8e8e8;
}
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .bottom a { color: #9299a3; }
:root[data-theme="reference"]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .bottom a[aria-current] { color: #4f9fea; }
@media(max-width:900px) {
  :root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main { padding-right: 20px; padding-left: 20px; }
  .module-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 0; }
}
@media(max-width:480px) {
  :root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main { padding: 18px 14px 90px; }
  .module-group { margin-bottom: 25px; }
  .module-cards { gap: 12px; }
  .module-card { min-height: 86px; padding: 14px 12px; gap: 12px; }
  .module-icon svg { width: 34px; height: 34px; }
  .module-copy strong { font-size: 15px; }
  .module-copy small { font-size: 12px; }
}
@media(max-width:350px) {
  .module-cards { grid-template-columns: 1fr; }
}
.search > button { white-space: nowrap; flex-shrink: 0; }

.product-image-preview { position: relative; display: inline-block; margin: 12px 10px 12px 0; }
.product-image-preview .thumb { display: block; width: 100px; height: 100px; object-fit: contain; }
.product-image-preview .remove-product-image { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; min-height: 28px; padding: 0; border: 2px solid var(--paper); border-radius: 50%; background: #444; color: #fff; font-size: 22px; line-height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.price-picker { max-width: 900px; }

.variant-price-table input[type="text"] { min-width: 150px; }
.price-picker { width: min(1100px, calc(100vw - 32px)); max-width: 1100px; }

.goods-detail-entry { width: 100%; display: grid; grid-template-columns: 90px 1fr 20px; align-items: center; gap: 12px; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 17px 0; color: var(--sub); background: var(--paper); }
.goods-detail-entry > :last-child { font-size: 28px; line-height: 1; color: #b5b5b5; text-align: right; }
.stock-picker { width: min(800px, 100%); }
.bag-avatar { display: block; width: 76px; height: 76px; border-radius: 12px; flex: none; }
.avatar-options { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.avatar-options button { position: relative; padding: 7px; display: grid; gap: 7px; justify-items: center; font-size: 12px; }
.avatar-options button[aria-pressed="true"] { border-color: #5ea8ed; box-shadow: 0 0 0 2px #5ea8ed; }
.avatar-options button[aria-pressed="true"]::after { content: '✓'; position: absolute; right: 1px; top: 63px; color: #fff; background: #5ea8ed; border-radius: 50%; width: 22px; height: 22px; line-height: 22px; }
.avatar-upload { display: grid; align-content: center; justify-items: center; width: 92px; min-height: 115px; border: 1px dashed var(--sub); border-radius: 10px; cursor: pointer; font-size: 12px; }
.avatar-upload > span:first-child { font-size: 34px; }
.material-avatar-options { display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); }
.material-avatar-options > button { border-radius:12px; align-content:start; }
.material-avatar-options > button > .material-avatar { width:min(100%,100px); height:auto; aspect-ratio:1; }
.material-avatar-options > button[aria-pressed="true"]::after { top:auto; bottom:28px; right:2px; }
.material-avatar-options > .avatar-upload { width:auto; min-height:0; border-radius:12px; color:var(--sub); }
.material-avatar-options + .avatar-preview:empty { display:none; }
.material-thumb > .material-avatar { width:100%; height:100%; }
.material-image-controls { display:flex; align-items:center; gap:20px; margin-bottom:12px; }
.material-image-picker .material-avatar-options > button { min-width:0; }
.material-image-picker .material-avatar-options > button[aria-pressed="true"] { border-color:var(--ink); box-shadow:none; }
.material-image-picker .material-avatar-options > button[aria-pressed="true"]::after { color:var(--on); background:var(--solid); }
@media(max-width:560px) {
  .material-avatar-options { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
}
.avatar-preview { position: relative; display: inline-flex; margin: 4px 0 10px; }
.avatar-preview .thumb { width: 76px; height: 76px; }
.avatar-preview button { position: absolute; right: -10px; top: -8px; min-height: 26px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: #444; color: #fff; }
.contact-avatar { display: inline-flex; vertical-align: middle; margin-right: 9px; }
.contact-avatar .bag-avatar, .contact-avatar .thumb { width: 42px; height: 42px; border-radius: 8px; }
.customer-editor { --contact-label-width: 115px; --contact-label-gap: 10px; }
.customer-editor .fields { display: block; }
.customer-editor :is(.fields,[data-birthday-solar],[data-birthday-lunar]) > label:not(.check), .customer-editor form > label { display: grid; grid-template-columns: var(--contact-label-width) minmax(0,1fr); align-items: center; gap: var(--contact-label-gap); padding: 12px 0; border-bottom: 1px solid var(--line); }
.customer-editor [data-birthday-lunar] { border-bottom: 1px solid var(--line); }
.customer-editor [data-birthday-lunar] > label:not(.check) { border-bottom: 0; }
.customer-editor [data-birthday-lunar] > .check { margin-inline-start: calc(var(--contact-label-width) + var(--contact-label-gap)); margin-bottom: 12px; }
.customer-editor input:not([type="hidden"]), .customer-editor select { min-width: 0; }
.customer-editor .customer-avatar-section { border-top: 10px solid var(--soft); border-bottom: 10px solid var(--soft); padding-top: 16px; }
.customer-avatar-section h3 { margin: 0; font-size: 16px; color: var(--sub); font-weight: 500; }
@media(max-width:400px) { .customer-editor { --contact-label-width: 95px; --contact-label-gap: 6px; } .avatar-options { gap: 8px; } .avatar-options .bag-avatar { width: 64px; height: 64px; } }

:root[data-editor="return"] .bottom { display: none; }
:root[data-page="returns"] main { padding-bottom: 90px; }
.return-editor { min-height: calc(100dvh - 180px); background: var(--base); }
.return-contact { background: var(--paper); border-bottom: 18px solid var(--base); }
.return-contact button { display: grid; width: 100%; grid-template-columns: 95px 1fr 18px; text-align: left; gap: 12px; border: 0; border-radius: 0; padding: 22px 18px; color: var(--sub); }
.return-contact button > :last-child { font-size: 26px; line-height: 1; color: #bbb; }
.return-tools { display: flex; align-items: center; background: var(--paper); padding: 18px 0; }
.return-tools > button,.return-tools > label { display: flex; align-items: center; justify-content: center; gap: 12px; width: 50%; border: 0; border-radius: 0; background: transparent; color: var(--sub); min-height: 38px; cursor: pointer; font-size: 17px; padding: 0 10px; }
.return-tools > :first-child { border-right: 1px solid var(--line); }
.return-tools > button > span { font-size: 26px; line-height: 1; }
.return-tools svg { width: 24px; height: 24px; display: block; }
.return-photo { background: var(--paper); padding: 15px; margin-top: 18px; display: flex; gap: 12px; align-items: center; }
.return-history-link { text-align: right; padding: 15px; font-size: 13px; color: var(--sub); }
.return-history-link button { margin-left: 12px; }
.return-bar { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr minmax(80px,20%) minmax(110px,30%); height: calc(64px + env(safe-area-inset-bottom,0px)); padding-bottom: env(safe-area-inset-bottom,0px); background: #fff7da; z-index: 8; }
.return-bar strong { display: flex; align-items: center; padding: 0 24px; font-size: 25px; font-weight: 500; color: #df674b; font-variant-numeric: tabular-nums; }
.return-bar button { background: #f7a41b; color: white; border: 0; border-radius: 0; font-size: 17px; }
.return-bar button.primary { background: #60a8f2; }
:root[data-theme="dark"] .return-bar { background: #332e20; }
@media(min-width:900px) { .return-bar { max-width: 1220px; margin: auto; } }

.product-detail-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: min(200px,100%); border: 0; padding: 0; background: transparent; text-align: left; }
.product-detail-open .product-summary { display: grid; gap: 8px; min-width: 0; }
.product-detail-open .product-summary > * { overflow-wrap: anywhere; }
.goods-warehouse-summary { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.goods-warehouse-summary > span { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; min-width: 0; }
.goods-warehouse-quantity { white-space: nowrap; }
.product-detail-open p { margin: 0; color: #df6550; }
.goods-detail-dialog { inset: 0; width: min(640px,calc(100% - 24px)); max-width: none; max-height: min(90dvh,920px); border: 0; border-radius: 20px; padding: 0; margin: auto; background: var(--paper); color: var(--ink); box-shadow: 0 10px 50px #0003; }
.goods-detail-dialog[open] { display: flex; flex-direction: column; }
.goods-detail-dialog::backdrop { background: #0006; }
.goods-detail-dialog [hidden] { display: none !important; }
.goods-detail-dialog .gd-top { display: flex; align-items: center; justify-content: space-between; padding: 17px 22px 0; color: var(--sub); font-size: 14px; flex: none; }
.goods-detail-dialog .gd-top button { border: 0; border-radius: 50%; background: var(--soft); width: 34px; min-height: 34px; height: 34px; padding: 0; font-size: 24px; line-height: 30px; }
.goods-detail-dialog .gd-content { padding: 0 25px; overflow: auto; min-height: 0; }
.goods-detail-dialog .gd-product { display: flex; gap: 22px; align-items: center; padding: 12px 0 22px; }
.goods-detail-dialog .gd-product .thumb { width: 100px; height: 120px; object-fit: contain; background: transparent; border-radius: 10px; }
.goods-detail-dialog .gd-product h2 { font-size: 25px; font-weight: 500; margin: 0; overflow-wrap: anywhere; }
.goods-detail-dialog .gd-product p { color: var(--sub); margin: 10px 0 13px; }
.goods-detail-dialog .gd-state { font-size: 12px; padding: 3px 9px; background: var(--soft); color: var(--sub); border-radius: 6px; }
.goods-detail-dialog .gd-prices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 18px 0 22px; border-top: 1px solid var(--line); }
.goods-detail-dialog .gd-prices > div,.goods-detail-dialog .gd-prices > button { display: grid; align-content: start; gap: 8px; }
.goods-detail-dialog .gd-prices > button { border: 0; background: transparent; text-align: left; padding: 0; }
.goods-detail-dialog .gd-prices span { color: var(--sub); font-size: 13px; }
.goods-detail-dialog .gd-prices strong { font-weight: 500; font-size: 19px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.goods-detail-dialog .gd-prices small { font-size: 12px; color: var(--sub); font-weight: 400; }
.goods-detail-dialog .gd-sale { color: #df6550; }
.goods-detail-dialog .gd-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; border-bottom: 1px solid var(--line); }
.goods-detail-dialog .gd-tabs button { position: relative; border: 0; border-radius: 0; background: transparent; color: var(--sub); padding: 13px 0; font-size: 14px; }
.goods-detail-dialog .gd-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 500; }
.goods-detail-dialog .gd-tabs button[aria-selected="true"]::after { content: ''; position: absolute; width: 22px; height: 3px; border-radius: 3px; background: var(--ink); left: calc(50% - 11px); bottom: 0; }
.goods-detail-dialog .gd-tabs small { font-size: 11px; margin-left: 4px; }
.goods-detail-dialog .gd-panel { padding: 20px 0 24px; min-height: 225px; }
.goods-detail-dialog .gd-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 23px 18px; margin: 0; }
.goods-detail-dialog .gd-fields > div { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 12px; align-items: start; font-size: 14px; }
.goods-detail-dialog .gd-fields .gd-full { grid-column: 1/-1; }
.goods-detail-dialog dt { color: var(--sub); }
.goods-detail-dialog dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.goods-detail-dialog .gd-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.goods-detail-dialog .gd-tags span { background: var(--soft); border-radius: 6px; padding: 3px 9px; }
.goods-detail-dialog .gd-variants { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 20px; }
.goods-detail-dialog .gd-variant { padding: 15px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.goods-detail-dialog .gd-variant-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; font-size: 14px; }
.goods-detail-dialog .gd-variant-heading > span { font-size: 12px; color: var(--sub); }
.goods-detail-dialog .gd-variant-prices { display: flex; gap: 15px; flex-wrap: wrap; margin: 9px 0 12px; color: var(--sub); font-size: 13px; }
.goods-detail-dialog .gd-variant-prices b { color: var(--ink); font-weight: 400; }
.goods-detail-dialog .gd-variant-prices .gd-sale { color: #df6550; }
.goods-detail-dialog .gd-codes { display: grid; gap: 6px; margin: 0; font-size: 12px; }
.goods-detail-dialog .gd-codes > div { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 5px; }
.goods-detail-dialog .gd-warehouse { margin-bottom: 22px; }
.goods-detail-dialog .gd-warehouse > div:first-child { display: flex; justify-content: space-between; font-size: 14px; gap: 10px; margin-bottom: 10px; }
.goods-detail-dialog .gd-warehouse > div:first-child span { color: var(--sub); }
.goods-detail-dialog .gd-warehouse table { min-width: 0; }
.goods-detail-dialog .gd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 9px 20px 14px; border-top: 1px solid var(--line); flex: none; }
.goods-detail-dialog .gd-actions button { display: flex; align-items: center; justify-content: center; gap: 11px; min-height: 51px; border: 0; background: transparent; color: #61718c; font-size: 17px; }
.goods-detail-dialog .gd-actions svg { width: 23px; height: 23px; }
.goods-detail-dialog .gd-actions button:disabled { opacity: .4; cursor: default; }
:root[data-theme="dark"] .goods-detail-dialog .gd-sale { color: #ff9882; }
:root[data-theme="dark"] .goods-detail-dialog .gd-actions button { color: #afbdd8; }
@media(max-width:480px) { .goods-detail-dialog .gd-content { padding: 0 17px; } .goods-detail-dialog .gd-top { padding: 14px 17px 0; } .goods-detail-dialog .gd-product { gap: 15px; } .goods-detail-dialog .gd-prices strong { font-size: 16px; } .goods-detail-dialog .gd-fields,.goods-detail-dialog .gd-variants { grid-template-columns: 1fr; } .goods-detail-dialog .gd-fields { gap: 17px; } .goods-detail-dialog .gd-fields .gd-full { grid-column: auto; } }

.bulk-price-panel { margin: 14px 0 20px; padding: 17px; background: var(--soft); border-radius: 13px; }
.bulk-price-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; font-size: 14px; }
.bulk-price-heading > span { font-size: 12px; color: var(--sub); }
.bulk-price-modes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 4px; gap: 4px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 9px; }
.bulk-price-modes button { background: transparent; border: 0; padding: 8px 4px; border-radius: 6px; font-size: 13px; color: var(--sub); }
.bulk-price-modes button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 5px #0001; }
.bulk-price-head,.bulk-price-rule { display: grid; grid-template-columns: minmax(65px,1fr) minmax(0,2fr) minmax(0,2fr); align-items: center; gap: 12px; }
.bulk-price-head { margin-bottom: 7px; color: var(--sub); font-size: 12px; }
.bulk-price-rules { display: grid; gap: 10px; }
.bulk-price-rule > span { overflow-wrap: anywhere; font-size: 14px; }
.bulk-price-rule input { min-width: 0; width: 100%; }
.bulk-price-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-top: 16px; }
.bulk-price-actions > span { font-size: 12px; color: var(--sub); }
.bulk-price-actions button { font-size: 13px; }
.bulk-price-panel [data-bulk-price-status] { font-size: 13px; margin: 13px 0 0; color: var(--sub); }
.bulk-price-panel [data-bulk-price-status]:empty { display: none; }
.bulk-price-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.bulk-price-detail-heading button { padding: 4px 10px; min-height: 36px; }
.bulk-price-detail-heading button:disabled { opacity: .4; cursor: default; }
@media(max-width:450px) { .bulk-price-panel { padding: 13px; } .bulk-price-head,.bulk-price-rule { grid-template-columns: 48px minmax(0,1fr) minmax(0,1fr); gap: 8px; } .bulk-price-rule input { padding: 9px 6px; } .bulk-price-actions > button { width: 100%; } }

.goods-detail-dialog .gd-actions-single { grid-template-columns: 1fr; }
.customer-detail-dialog .gd-product { border-bottom: 1px solid var(--line); }
.customer-detail-dialog .gd-fields > div { grid-template-columns: 64px minmax(0,1fr); }
.customer-detail-dialog .gd-product .bag-avatar,.customer-detail-dialog .gd-product .thumb { width: 88px; height: 88px; border-radius: 13px; }

.delete-record-button { color: var(--delete-action-text); border-color: var(--delete-action-line); background: var(--paper); }
.delete-record-dialog { width: min(440px,calc(100% - 30px)); max-height: 85dvh; overflow: auto; border: 0; border-radius: 18px; padding: 24px; color: var(--ink); background: var(--paper); }
.delete-record-dialog::backdrop { background: #0006; }
.delete-record-dialog .delete-record-name { font-size: 18px; overflow-wrap: anywhere; }
.delete-record-dialog .actions { justify-content: flex-end; margin-bottom: 0; }
.customer-category.category-small { color: #3678bd; }
.customer-category.category-large { color: #ae701b; }
.customer-category.category-vip { color: #8b55af; }
.customer-category.category-custom { color: #378681; }
:root[data-theme="dark"] .customer-category.category-small { color: #85baff; }
:root[data-theme="dark"] .customer-category.category-large { color: #f4c071; }
:root[data-theme="dark"] .customer-category.category-vip { color: #d3a6f6; }
:root[data-theme="dark"] .customer-category.category-custom { color: #85d2ca; }

/* Visual references apply only to the home module entries and the goods list. */
:root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) body {
  background: radial-gradient(ellipse 72% 480px at 100% 0%,light-dark(#faecd4,#352b23),transparent),radial-gradient(ellipse 85% 520px at 0% 0%,light-dark(#ede2ee,#302936),transparent),light-dark(#f5f5f5,#19191d);
}
:root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main { background: transparent; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-group { margin-bottom: 28px; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-group > summary { font-weight: 400; color: var(--sub); margin-bottom: 12px; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-cards { column-gap: 20px; row-gap: 16px; padding: 0; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-card {
  min-height: 112px;
  padding: 23px 21px;
  gap: 14px;
  border: 1px solid light-dark(#ffffffd9,#ffffff20);
  border-radius: 999px;
  background: color-mix(in srgb,var(--paper) 52%,transparent);
  box-shadow: none;
  justify-content: center;
}

:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-card:hover { background: color-mix(in srgb,var(--paper) 76%,transparent); border-color: light-dark(#ffffff,#ffffff40); box-shadow: none; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-copy { gap: 7px; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-copy strong { font-size: 16px; font-weight: 400; }
:root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-copy small { font-size: 12px; }
:root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .bottom { background: color-mix(in srgb,var(--paper) 74%,transparent); border-top-color: light-dark(#ffffffa0,#ffffff18); backdrop-filter: blur(12px); }
:root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .bottom a { color: var(--sub); }
:root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .bottom a[aria-current] { color: var(--ink); }

:root[data-theme][data-page="records"][data-view="goods"] body { background: light-dark(#f7f7f7,#19191d); }
:root[data-page="records"][data-view="goods"] main > .page-title { background: transparent; }
:root[data-page="records"]:is([data-view="goods"],[data-view="customer"],[data-view="supplier"]) main > .search { padding: 20px; margin: 0; background: transparent; }
:root[data-page="records"]:is([data-view="goods"],[data-view="customer"],[data-view="supplier"]) main > .search input { border: 1px solid var(--line); border-radius: 999px; background: var(--soft); text-align: left; padding: 12px 22px; }
:root[data-page="records"]:is([data-view="goods"],[data-view="customer"],[data-view="supplier"]) main > .search button { min-width: 54px; border: 0; background: transparent; color: var(--sub); }
:root[data-page="records"][data-view="goods"] main > .group-title { background: transparent; font-weight: 400; padding: 17px 27px 11px; }
:root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card {
  margin: 0;
  padding: 22px 26px;
  min-height: 122px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
  gap: 14px;
}
:root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .product-detail-open { min-width: 0; flex: 1 1 160px; gap: 16px; }
:root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .thumb { width: 70px; height: 78px; border-radius: 14px; object-fit: contain; }
:root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .product-summary { gap: 7px; }
:root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .product-summary strong { font-size: 17px; font-weight: 500; }
:root[data-page="records"][data-view="goods"] .floating-add { box-shadow: none; border: 1px solid light-dark(#fff,#ffffff30); background: color-mix(in srgb,var(--paper) 88%,transparent); color: var(--ink); }
@media(max-width:680px) {
  :root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-cards { grid-template-columns: 1fr; gap: 13px; }
  :root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-card { min-height: 104px; padding: 23px 25px; gap: 20px; }
  :root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-icon svg { width: 39px; height: 39px; }
  :root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-copy strong { font-size: 16px; }
  :root:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .module-copy small { font-size: 12px; }
  :root[data-page="records"]:is([data-view="goods"],[data-view="customer"],[data-view="supplier"]) main > .search { padding: 18px 14px; gap: 6px; }
  :root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card { margin: 0; padding: 19px 18px; gap: 9px; border-radius: 0; }
  :root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .product-detail-open { flex-basis: 140px; gap: 10px; }
  :root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .thumb { width: 54px; height: 68px; }
  :root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .product-summary strong { font-size: 16px; }
  :root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card .product-summary > .hint { font-size: 12px; }
}

/* 首页使用与电商入口相同的模块卡片样式。 */
:root:is([data-page="dashboard"][data-view=""]) .page-title { display: none; }
:root:is([data-page="dashboard"][data-view=""]) main {
  max-width: 1440px;
  padding: 24px 32px calc(88px + env(safe-area-inset-bottom));
  background: transparent;
}
:root[data-theme]:is([data-page="dashboard"][data-view=""]) body {
  background: radial-gradient(ellipse 72% 480px at 100% 0%,light-dark(#faecd4,#352b23),transparent),radial-gradient(ellipse 85% 520px at 0% 0%,light-dark(#ede2ee,#302936),transparent),light-dark(#f5f5f5,#19191d);
}
:root:is([data-page="dashboard"][data-view=""]) .module-group { margin-bottom: 28px; }
:root:is([data-page="dashboard"][data-view=""]) .module-group > summary { font-weight: 400; color: var(--sub); margin-bottom: 12px; }
:root:is([data-page="dashboard"][data-view=""]) .module-cards { column-gap: 20px; row-gap: 16px; padding: 0; }
:root:is([data-page="dashboard"][data-view=""]) .module-card {
  min-height: 112px;
  padding: 23px 21px;
  gap: 14px;
  border: 1px solid light-dark(#ffffffd9,#ffffff20);
  border-radius: 999px;
  background: color-mix(in srgb,var(--paper) 52%,transparent);
  box-shadow: none;
  justify-content: center;
}
:root:is([data-page="dashboard"][data-view=""]) .module-card:hover { background: color-mix(in srgb,var(--paper) 76%,transparent); border-color: light-dark(#ffffff,#ffffff40); box-shadow: none; }
:root:is([data-page="dashboard"][data-view=""]) .module-copy { gap: 7px; }
:root:is([data-page="dashboard"][data-view=""]) .module-copy strong { font-size: 16px; font-weight: 400; }
:root:is([data-page="dashboard"][data-view=""]) .module-copy small { font-size: 12px; }
:root[data-theme]:is([data-page="dashboard"][data-view=""]) .bottom { background: color-mix(in srgb,var(--paper) 74%,transparent); border-top-color: light-dark(#ffffffa0,#ffffff18); backdrop-filter: blur(12px); }
:root[data-theme]:is([data-page="dashboard"][data-view=""]) .bottom a { color: var(--sub); }
:root[data-theme]:is([data-page="dashboard"][data-view=""]) .bottom a[aria-current] { color: var(--ink); }
@media(max-width:680px) {
  :root:is([data-page="dashboard"][data-view=""]) main { padding: 18px 14px 90px; }
  :root:is([data-page="dashboard"][data-view=""]) .module-cards { grid-template-columns: 1fr; gap: 13px; }
  :root:is([data-page="dashboard"][data-view=""]) .module-card { min-height: 104px; padding: 23px 25px; gap: 20px; }
  :root:is([data-page="dashboard"][data-view=""]) .module-icon svg { width: 39px; height: 39px; }
  :root:is([data-page="dashboard"][data-view=""]) .module-copy strong { font-size: 16px; }
  :root:is([data-page="dashboard"][data-view=""]) .module-copy small { font-size: 12px; }
}

:root[data-page="records"][data-view="goods"] main > .goods-category-list { margin: 0 20px 18px; border-radius: 20px; overflow: hidden; background: var(--paper); }
:root[data-page="records"][data-view="goods"] main > .goods-category-list > .product-card:last-child { border-bottom: 0; }
@media(max-width:680px) { :root[data-page="records"][data-view="goods"] main > .goods-category-list { margin-right: 12px; margin-left: 12px; } }

/* Shared surface system: quiet backgrounds, rounded groups and fine separators. */
:root[data-theme="reference"] { --base: #f7f7f7; }
:root[data-theme][data-page]:not(:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""])) body { background: var(--base); }
:root[data-theme][data-page] main > .page-title { background: transparent; }
:root[data-theme] button, :root[data-theme] .action { border-radius: var(--action-radius); }
:root[data-theme] input, :root[data-theme] select, :root[data-theme] textarea { border-radius: 12px; }
:root[data-theme] input:not([type="checkbox"]):not([type="hidden"]), :root[data-theme] select { min-height: 46px; }
:root[data-theme] input[type="file"] { padding: 10px; }
:root[data-theme] input::file-selector-button { font: inherit; border: 0; border-radius: 8px; padding: 6px 10px; margin-right: 10px; background: var(--soft); color: var(--ink); }
:root[data-theme] main > .panel, :root[data-theme] .sample-list > .panel { border: 0; border-radius: 20px; margin: 0 20px 16px; padding: 24px; background: var(--paper); box-shadow: none; }
:root[data-theme] .panel h2 { font-weight: 500; margin-bottom: 18px; }
:root[data-theme] form { gap: 16px; }
:root[data-theme] .fields { gap: 16px; }
:root[data-theme] label { gap: 7px; }
:root[data-theme] main > .search { padding: 20px; margin: 0; background: transparent; }
:root[data-theme] main > .search input { border: 1px solid var(--line); border-radius: 999px; background: var(--paper); text-align: left; padding: 12px 22px; }
:root[data-theme] main > .search button { border: 0; background: transparent; color: var(--sub); min-width: 54px; }
:root[data-theme] main > .group-title { background: transparent; font-weight: 400; padding: 17px 27px 11px; margin: 0; }
:root[data-theme] main > .tabs { margin: 10px 20px 18px; padding: 4px; gap: 4px; border-radius: 16px; background: var(--soft); }
:root[data-theme] .tabs a { border: 0; border-radius: 12px; color: var(--sub); background: transparent; justify-content: center; }
:root[data-theme] .tabs a.active { border: 0; background: var(--paper); color: var(--ink); }
:root[data-theme] .thumbnails { background: var(--soft); border-radius: 12px; gap: 10px; overflow-x: auto; }
:root[data-theme] .thumbnails .thumb { border-radius: 9px; }
:root[data-theme] th { font-size: 13px; font-weight: 400; padding: 13px 10px; }
:root[data-theme] td { padding: 15px 10px; }
:root[data-theme] tbody tr:last-child :is(th,td) { border-bottom: 0; }
:root[data-theme] .record-list { margin: 0 20px 18px; background: var(--paper); border-radius: 20px; overflow: hidden; }
:root[data-theme] .record-list > .product-card { padding: 22px 26px; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; gap: 14px; }
:root[data-theme] .record-list > .product-card:last-child { border-bottom: 0; }
:root[data-theme] .record-list .thumb { border-radius: 14px; }
:root[data-theme] .record-list .product-detail-open { min-width: 0; flex: 1 1 160px; }
:root[data-theme] .record-list > .product-card > button.product-detail-open { font-size: 13px; padding: 8px 12px; }
:root[data-theme] .floating-add { box-shadow: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
:root[data-theme][data-page] .bottom { background: color-mix(in srgb,var(--paper) 90%,transparent); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
:root[data-theme][data-page] .bottom a { color: var(--sub); background: transparent; }
:root[data-theme][data-page] .bottom a[aria-current] { color: var(--ink); background: transparent; }
:root[data-theme][data-page="profile"][data-view=""] .panel { background: var(--paper); color: var(--ink); }
:root[data-theme][data-page="profile"][data-view=""] .panel .hint,
:root[data-theme][data-page="profile"][data-view=""] .panel small,
:root[data-theme][data-page="profile"][data-view=""] .profile-list a > span { color: var(--sub); }
:root[data-theme] .profile-list a { min-height: 60px; }
:root[data-theme] .profile-list a + a { border-color: var(--line); }
:root[data-theme] .profile-account .avatar { border: 0; border-radius: 20px; }
:root[data-theme] .attribute-picker { border-radius: 20px 20px 0 0; }
:root[data-theme] .attribute-option > button:first-child { border-radius: var(--action-radius); }
:root[data-theme] .attribute-close { background: var(--soft); color: var(--sub); }
:root[data-theme] .attribute-picker > .attribute-close,
:root[data-theme] .goods-detail-dialog .gd-top button { border-radius: 50%; }
:root[data-theme] .goods-detail-dialog { box-shadow: none; }
:root[data-theme] .bulk-price-modes button[aria-pressed="true"] { box-shadow: none; }
:root[data-theme] .picker { border-radius: 20px; }
:root[data-theme] .return-editor { margin: 0 20px; }
:root[data-theme] .return-contact { border: 0; border-radius: 20px; overflow: hidden; margin-bottom: 16px; }
:root[data-theme] .return-tools, :root[data-theme] .return-photo { border-radius: 20px; }
:root[data-theme] .return-bar { background: var(--paper); border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom,0px)); gap: 8px; height: calc(72px + env(safe-area-inset-bottom,0px)); }
:root[data-theme] .return-bar strong { padding: 0 12px; font-size: 23px; }
:root[data-theme] .return-bar button { border-radius: 12px; background: var(--soft); color: var(--ink); }
:root[data-theme] .return-bar button.primary { background: var(--solid); color: var(--on); }
:root[data-page="access"] main { max-width: 520px; padding-top: clamp(32px,10vh,100px); }
:root[data-page="access"] main > h1 { margin: 0 20px 24px; font-size: 28px; letter-spacing: -.03em; }
:root[data-theme] .access-login-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); }
:root[data-theme] .access-login-tabs button { min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--sub); font-weight: 600; }
:root[data-theme] .access-login-tabs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px #00000012; }
:root[data-theme] .login-code-hint { margin: 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--solid) 22%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--solid) 8%, var(--paper)); color: var(--ink); text-align: center; }
:root[data-theme] .login-code-hint strong { font-size: 24px; letter-spacing: .18em; }
@media(max-width:680px) {
  :root[data-theme] main > .panel, :root[data-theme] .sample-list > .panel { margin: 0 12px 14px; padding: 20px 18px; }
  :root[data-theme] main > .search { padding: 18px 14px; gap: 6px; }
  :root[data-theme] main > .tabs { margin-right: 12px; margin-left: 12px; }
  :root[data-theme] .record-list { margin-right: 12px; margin-left: 12px; }
  :root[data-theme] .record-list > .product-card { padding: 19px 18px; gap: 9px; }
  :root[data-theme] .record-list .product-detail-open { flex-basis: 140px; gap: 10px; }
  :root[data-theme] .record-list > .product-card > button.product-detail-open { padding: 7px 8px; font-size: 12px; }
  :root[data-theme] .return-editor { margin: 0 12px; }
}
@media print {
  :root[data-theme] main > .panel { margin: 0; padding: 0; border-radius: 0; }
}

/* Complete screen layout shared by reference, white and black appearances. */
:root[data-theme] {
  --base: light-dark(#f7f7f7,#19191d);
  --solid: light-dark(#242424,#f5f5f7);
  --on: light-dark(#ffffff,#19191d);
  --soft: light-dark(#f5f5f6,#28282d);
  --line: light-dark(#ebebed,#38383d);
  --action-radius: 12px;
  --delete-action-text: light-dark(#c84036,#ff9f99);
  --delete-action-line: light-dark(#e6bdb9,#794a49);
}
:root[data-theme] body > header, :root[data-theme] .shell > nav { display: none; }
:root[data-theme] .shell { display: block; min-height: 100dvh; }
:root[data-theme] main { max-width: 1024px; padding: 0 0 calc(94px + env(safe-area-inset-bottom)); }
:root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main { max-width: 1440px; padding: 24px 32px calc(94px + env(safe-area-inset-bottom)); }
:root[data-theme] .page-title { height: 76px; margin: 0 0 8px; padding: 0 20px; position: relative; display: flex; align-items: center; justify-content: center; }
:root[data-theme] .page-title h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0; }
:root[data-theme] .page-title > a { position: absolute; left: 20px; top: 16px; min-height: 44px; width: 40px; padding: 5px 0; border: 0; border-radius: 22px; font-size: 0; background: color-mix(in srgb,var(--paper) 70%,transparent); }
:root[data-theme] .page-title > a::before { content: "‹"; font-size: 32px; line-height: 1; }
:root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) .page-title { display: none; }
:root[data-theme] .bottom { position: fixed; inset: auto 0 0; z-index: 5; display: flex; gap: 0; margin: 0; padding: 7px 0 calc(5px + env(safe-area-inset-bottom)); overflow: visible; }
:root[data-theme] .bottom a { display: flex; flex: 1; align-items: center; justify-content: center; flex-direction: column; gap: 4px; min-width: 0; min-height: 48px; margin: 0; padding: 0; font-size: 12px; border: 0; border-radius: 0; }
:root[data-theme][data-editor="return"] .bottom { display: none; }
:root[data-theme] button, :root[data-theme] .action { transition: background-color .15s,border-color .15s; }
:root[data-theme] .primary { background: var(--solid); border-color: var(--solid); color: var(--on); }
:root[data-theme] input:not([type="checkbox"]):not([type="hidden"]), :root[data-theme] select, :root[data-theme] textarea { border: 1px solid var(--line); background: var(--soft); }
:root[data-theme] input:focus-visible, :root[data-theme] select:focus-visible, :root[data-theme] textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:root[data-theme] input[type="checkbox"] { accent-color: var(--ink); }
:root[data-theme] .panel { color: var(--ink); }
:root[data-theme] main > .panel > h2 { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
:root[data-theme] .panel > form > .primary { justify-self: end; min-width: 140px; padding-right: 24px; padding-left: 24px; }
:root[data-theme] .panel > .actions:last-child { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
:root[data-theme] main > .actions { margin: 16px 20px; padding: 0; gap: 10px; }
:root[data-theme] .order-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
:root[data-theme] .order-heading { display: grid; gap: 4px; min-width: 0; font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
:root[data-theme] .order-heading small { font-size: 12px; font-weight: 400; color: var(--sub); }
:root[data-theme] .status { flex: none; padding: 5px 10px; background: var(--soft); color: var(--sub); font-size: 12px; border-radius: 999px; }
:root[data-theme] .record-footer { padding-top: 17px; margin-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
:root[data-theme] .record-footer strong { font-size: 18px; font-weight: 500; }
:root[data-theme] .record-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
:root[data-theme] :where(.list-record-action,.delete-record-button:not(.production-order-more-actions > *),.record-buttons > :is(button,.action),.production-order-more > summary,td button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 52px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: var(--action-radius);
}
:root[data-theme] .thumbnails { background: var(--soft); margin: 18px 0; padding: 12px; }
:root[data-theme] .record-list .product-card > div { min-width: 0; }
:root[data-theme] .record-list .product-card strong { font-size: 17px; font-weight: 500; }
:root[data-theme] .record-list .product-card p:last-child { color: var(--sub); }
:root[data-theme] .warehouse-list .thumb { background: var(--soft); width: 60px; height: 64px; }
:root[data-theme] .warehouse-list .thumb svg { width: 30px; height: 30px; color: var(--sub); }
:root[data-theme] .table { border-radius: 14px; border: 1px solid var(--line); margin-top: 12px; background: var(--paper); }
:root[data-theme] table { min-width: 480px; }
:root[data-theme] thead th { background: var(--soft); color: var(--sub); font-size: 12px; }
:root[data-theme] td { font-size: 14px; }
:root[data-theme] td a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); border-bottom: 1px solid var(--line); }
:root[data-theme] :is(.table td :where(button,a.action):not(.primary,.delete-record-button),button[data-action="clear-draft"]) {
  border: 1px solid var(--line);
  border-radius: var(--action-radius);
  background: var(--paper);
  color: var(--ink);
}
:root[data-theme] .table-empty { margin: 0; padding: 34px 16px; }
:root[data-theme] .empty { font-size: 14px; padding: 42px 20px; }
:root[data-theme] .document-detail > p { padding: 12px 0; color: var(--sub); line-height: 1.8; overflow-wrap: anywhere; }
:root[data-theme] .document-detail > .actions { gap: 10px; }
:root[data-theme] .contact-row button { min-height: 56px; background: var(--soft); padding: 14px 18px; border: 0; border-radius: 14px; }
:root[data-theme] .discount { background: var(--soft); padding: 18px; border: 0; border-radius: 16px; gap: 14px; }
:root[data-theme] .discount input { background: var(--paper); }
:root[data-theme] .discount button { background: var(--paper); }
:root[data-theme] .goods-detail-entry { border-radius: 0; padding: 20px 0; background: transparent; }
:root[data-theme] .goods-detail-entry[data-action="stock-open"] { grid-template-columns: minmax(90px,max-content) minmax(0,1fr) 20px; }
:root[data-theme] .customer-editor :is(.fields,[data-birthday-solar],[data-birthday-lunar]) > label:not(.check), :root[data-theme] .customer-editor form > label { padding: 16px 0; }
:root[data-theme] .customer-editor .customer-avatar-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0 10px; }
:root[data-theme] .profile-list a { min-height: 64px; padding: 10px 0; }
:root[data-theme] .profile-list a strong { font-size: 16px; font-weight: 400; }
:root[data-theme] .profile-list a > span:last-child { font-size: 22px; font-weight: 400; }
.profile-menu { display: grid; gap: 16px; margin: 0 20px 18px; }
.profile-menu-group { min-width: 0; }
.profile-menu-group h2 { margin: 0 0 7px 4px; color: var(--sub); font-size: 14px; font-weight: 500; }
.profile-menu .profile-list { padding: 2px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
:root[data-theme] .profile-menu .profile-list a { min-height: 54px; gap: 10px; padding: 7px 0; }
:root[data-theme] .profile-menu .profile-list a svg { width: 19px; height: 19px; color: var(--profile-icon-color,var(--sub)); }
.profile-menu-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: color-mix(in srgb,var(--profile-icon-color,var(--sub)) 13%,var(--paper));
}
.profile-menu-icon[data-tone="teal"] { --profile-icon-color: light-dark(#087c73,#6ed8c8); }
.profile-menu-icon[data-tone="green"] { --profile-icon-color: light-dark(#287443,#8cdda2); }
.profile-menu-icon[data-tone="orange"] { --profile-icon-color: light-dark(#a75827,#f9a979); }
.profile-menu-icon[data-tone="blue"] { --profile-icon-color: light-dark(#2566b4,#91bffa); }
.profile-menu-icon[data-tone="purple"] { --profile-icon-color: light-dark(#7350ad,#c6a5f4); }
.profile-menu-icon[data-tone="pink"] { --profile-icon-color: light-dark(#a43e79,#ef9bcd); }
.profile-menu-icon[data-tone="amber"] { --profile-icon-color: light-dark(#87620d,#f1cc74); }
.profile-menu-icon[data-tone="red"] { --profile-icon-color: light-dark(#b14547,#f2a3a3); }
@media(min-width: 820px) { .profile-menu { grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); } }
@media(max-width: 680px) { .profile-menu { margin-right: 12px; margin-left: 12px; } }
:root[data-theme] .profile-account { min-height: 110px; grid-template-columns: auto minmax(0, 1fr); }
:root[data-theme] .profile-account strong { font-size: 24px; font-weight: 500; }
:root[data-theme] .profile-account small { font-size: 14px; }
:root[data-theme] .profile-account > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
:root[data-theme] .profile-account .avatar { width: 74px; height: 74px; background: var(--soft); color: var(--ink); }
.profile-account-details { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; overflow-wrap: anywhere; }
.profile-account-details > span:last-child, .profile-account > span:last-child { color: var(--sub); }
.profile-avatar-link, .profile-avatar-controls .avatar { position: relative; overflow: hidden; }
.profile-avatar-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar > .profile-avatar-edit { position: absolute; right: 4px; bottom: 4px; width: 24px; height: 24px; padding: 3px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); }
.profile-avatar-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.profile-avatar-controls .avatar { width: 84px; height: 84px; border-radius: 18px; background: var(--soft); color: var(--ink); flex: none; }
.profile-avatar-controls .actions { margin: 0; padding: 0; }
:root[data-theme] .profile-avatar-upload { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
:root[data-theme] .profile-avatar-upload input[type="file"] { min-height: 0; padding: 0; }
.profile-avatar-upload:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.profile-avatar-form .error:empty { display: none; }
:root[data-theme] .picker { padding: 24px; border: 0; }
:root[data-theme] .picker > .spread:first-child { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
:root[data-theme] .picker h2 { margin: 0; font-size: 19px; font-weight: 500; }
:root[data-theme] .picker .search { padding: 0; margin: 0 0 16px; background: transparent; }
:root[data-theme] .picker .search input { border-radius: 999px; text-align: left; padding: 12px 18px; background: var(--soft); }
:root[data-theme] .picker .product-card { padding: 18px 0; border-color: var(--line); }
:root[data-theme] .picker .product-card .thumb { width: 60px; height: 64px; border-radius: 12px; }
:root[data-theme] .picker .product-card p:last-child { color: var(--sub); }
:root[data-theme] .picker h3 ~ button { border-radius: 12px; padding: 10px 14px; }
:root[data-theme] .attribute-heading { border-bottom-style: solid; padding-top: 15px; }
:root[data-theme] .attribute-heading h2 { font-size: 20px; }
:root[data-theme] .attribute-heading > button { color: var(--ink); }
:root[data-theme] .attribute-option > button:first-child { border-color: var(--line); color: var(--sub); background: var(--soft); }
:root[data-theme] .attribute-option > button[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: var(--on); }
:root[data-theme] .attribute-add { padding-top: 20px; border-top: 1px solid var(--line); }
:root[data-theme] .attribute-add > button { background: var(--solid); color: var(--on); border-color: var(--solid); }
:root[data-theme] .return-contact button { min-height: 74px; background: transparent; padding: 20px 24px; color: var(--ink); }
:root[data-theme] .return-contact button > :first-child { color: var(--sub); }
:root[data-theme] .return-tools { min-height: 80px; }
:root[data-theme] .return-tools > button, :root[data-theme] .return-tools > label { color: var(--ink); font-size: 16px; }
:root[data-theme] .return-tools > button { border-radius: 0; }
:root[data-theme] .return-bar button.primary { background: var(--solid); }
:root[data-theme][data-page="access"] main { max-width: 520px; padding-top: clamp(32px,10vh,100px); }
@media(min-width:681px) {
  :root[data-theme] .attribute-picker { inset: 0; margin: auto; border-radius: 20px; max-height: min(85dvh,900px); }
}
@media(max-width:680px) {
  :root[data-theme] .page-title { height: 66px; margin-bottom: 4px; }
  :root[data-theme] .page-title > a { top: 11px; left: 14px; background: transparent; }
  :root[data-theme]:is([data-page="home"],[data-page="production"][data-view=""],[data-page="ecommerce"][data-view=""]) main { padding: 18px 14px 94px; }
  :root[data-theme] main > .actions { margin-right: 14px; margin-left: 14px; }
  :root[data-theme] .panel > form > .primary { width: 100%; }
  :root[data-theme] .table { margin-top: 10px; }
  :root[data-theme] .order-heading { font-size: 16px; }
  :root[data-theme] .record-footer { gap: 14px; }
  :root[data-theme] .record-footer strong { font-size: 16px; }
  :root[data-theme] .discount { padding: 15px; grid-template-columns: 1fr; }
  :root[data-theme] .profile-account { gap: 12px; min-height: 96px; }
  :root[data-theme] .profile-account strong { font-size: 20px; }
  :root[data-theme] .profile-account .avatar { width: 62px; height: 62px; border-radius: 17px; }
  :root[data-theme] .profile-list a strong { font-size: 15px; }
  :root[data-theme] .picker { inset: auto 0 0; width: 100%; max-height: 88dvh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
  :root[data-theme] .return-contact button { grid-template-columns: 70px 1fr 18px; padding: 20px 18px; }
}
@media screen and (max-width:680px) {
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) > table { min-width: 0; }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) :is(tbody,tr) { display: block; }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) tbody tr { padding: 0 0 8px; border-bottom: 1px solid var(--line); }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) tbody tr:last-child { border-bottom: 0; }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
  }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) td[data-label]:first-child {
    padding-block: 10px;
    background: var(--soft);
    border-bottom: 1px solid var(--line);
  }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) td[data-label]::before {
    content: attr(data-label);
    color: var(--sub);
    text-align: left;
    flex: 0 0 auto;
    max-width: 46%;
    font-size: 12px;
  }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) .cell-value { min-width: 0; overflow-wrap: anywhere; }
  :root[data-theme] :is(main > .panel .table:not(.production-order-sku-frame),.transaction-lines) .cell-value:has(input,select) { width: 60%; }
}
@media(prefers-reduced-motion:reduce) { :root[data-theme] button, :root[data-theme] .action { transition: none; } }
@media print {
  :root[data-theme] main { max-width: none; padding: 0; }
  :root[data-theme] .bottom, :root[data-theme] .page-title { display: none; }
  :root[data-theme] .table { border: 0; }
  :root[data-theme] table thead { position: static !important; clip-path: none !important; width: auto !important; height: auto !important; }
  :root[data-theme] main > .panel table tbody { display: table-row-group; }
  :root[data-theme] main > .panel table tr { display: table-row; }
  :root[data-theme] main > .panel table td { display: table-cell; padding: 10px; text-align: left; }
  :root[data-theme] main > .panel table td::before { content: none; }
}

/* List edit/delete controls use the photographed rounded rectangle, not pills. */
:root[data-theme] .order-status-tabs { display: flex; }
:root[data-theme] .order-status-tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 12px; background: transparent; color: var(--sub); }
:root[data-theme] .order-status-tabs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
:root[data-theme] .order-filters { display: grid; gap: 8px; margin: 0 20px 18px; }
:root[data-theme] .status-filter-row { display: flex; align-items: center; gap: 14px; }
:root[data-theme] .status-filter-row > span { font-size: 12px; color: var(--sub); flex: none; }
:root[data-theme] .status-filter-row > .tabs { flex: 1; margin: 0; gap: 4px; padding: 4px; border-radius: 16px; background: var(--soft); }
:root[data-theme] .order-card { position: relative; }
:root[data-theme] .order-card .order-heading::after { content: ""; position: absolute; inset: 0; border-radius: 20px; z-index: 1; }
:root[data-theme] .order-card .record-buttons { position: relative; z-index: 2; }
:root[data-theme] .order-card:has(.order-heading:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
:root[data-theme] .order-badges { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; max-width: 50%; }
:root[data-theme] :is(.payment-unpaid,.production-order-badge[data-status="已暂停"]) { background: light-dark(#fff2e7,#3c2d20); color: light-dark(#a36530,#edbd91); }
:root[data-theme] :is(.payment-partial,.production-order-badge[data-status="生产中"],.archive-status.archive-active) { background: light-dark(#edf2ff,#253048); color: light-dark(#526d9f,#acc3ef); }
:root[data-theme] :is(.payment-paid,.production-order-badge[data-status="已完成"],.archive-status.archive-ready) { background: light-dark(#edf5f0,#26392e); color: light-dark(#528065,#aad3b9); }
@media(max-width:680px) {
  :root[data-theme] .order-filters { margin-right: 12px; margin-left: 12px; }
  :root[data-theme] .status-filter-row { gap: 8px; }
  :root[data-theme] .order-status-tabs button { font-size: 12px; padding: 6px 4px; min-height: 38px; white-space: nowrap; }
}
:root[data-theme] .draft-heading {
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  margin-bottom: 20px;
}
:root[data-theme] .draft-heading h2 { margin: 0; }
:root[data-theme] .draft-heading > button { flex: none; }
@media(max-width:680px) {
  :root[data-theme] .draft-heading { margin-bottom: 16px; gap: 12px; }
  :root[data-theme] .draft-heading > button { font-size: 13px; }
}


/* Customer receivables: customer groups, daily documents and selection totals. */
:root[data-theme][data-page="finance"][data-view="supplier"] main,
:root[data-theme][data-page="finance"][data-view="customer"] main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
:root[data-theme] .debt-search > [data-action] { color: var(--ink); border-left: 1px solid var(--line); border-radius: 0; padding-left: 16px; }
:root[data-theme] .debt-customer-row { display: flex; align-items: center; gap: 18px; padding: 22px 26px; min-height: 100px; }
:root[data-theme] .debt-customer-row + .debt-customer-row { border-top: 1px solid var(--line); }
:root[data-theme] .debt-customer-row .contact-avatar { margin: 0; flex: none; }
:root[data-theme] .debt-customer-row .bag-avatar, :root[data-theme] .debt-customer-row .thumb { width: 58px; height: 58px; border-radius: 50%; }
:root[data-theme] .debt-customer-row > strong { font-weight: 500; flex: 1; min-width: 0; overflow-wrap: anywhere; }
:root[data-theme] .debt-amount { color: var(--sub); font-size: 14px; white-space: nowrap; }
:root[data-theme] .debt-amount b { color: light-dark(#d16a53,#ffab94); font-size: 18px; font-weight: 500; }
:root[data-theme] .debt-chevron { color: var(--sub); font-size: 25px; flex: none; }
:root[data-theme] .debt-settlement-bar { position: fixed; z-index: 4; bottom: calc(65px + env(safe-area-inset-bottom)); left: 0; right: 0; width: min(100%,1024px); margin: auto; min-height: 62px; padding: 12px 24px; background: var(--paper); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }
:root[data-theme] .debt-summary-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 20px 22px; padding: 24px; border-radius: 20px; background: var(--paper); }
:root[data-theme] .debt-summary-amount { display: grid; gap: 9px; min-width: 0; }
:root[data-theme] .debt-summary-card span { color: var(--sub); font-size: 13px; }
:root[data-theme] .debt-summary-amount strong { font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
:root[data-theme] .debt-summary-count { display: grid; gap: 4px; text-align: center; flex: none; padding-left: 24px; border-left: 1px solid var(--line); }
:root[data-theme] .debt-summary-count strong { font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; }
:root[data-theme] .debt-customer-name { margin: 0 26px 16px; color: var(--sub); }
:root[data-theme] .debt-date-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 22px 26px 12px; color: var(--sub); font-size: 13px; }
:root[data-theme] .debt-date-heading .check { font-size: 15px; }
:root[data-theme] .debt-order-row { display: flex; align-items: center; gap: 18px; padding: 22px 26px; }
:root[data-theme] .debt-order-row + .debt-order-row { border-top: 1px solid var(--line); }
:root[data-theme] .debt-order-row > input { flex: none; }
:root[data-theme] .debt-order-row > a { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
:root[data-theme] .debt-order-row > a > span:first-child { display: grid; gap: 8px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
:root[data-theme] .debt-order-row strong { font-weight: 500; font-size: 16px; }
:root[data-theme] .debt-order-row small { font-size: 13px; }
:root[data-theme] .debt-order-balance { white-space: nowrap; color: var(--sub); font-size: 14px; }
:root[data-theme] .debt-settlement-bar { justify-content: space-between; }
:root[data-theme] .debt-settlement-bar strong { font-size: 18px; font-weight: 500; }
:root[data-theme] .debt-settlement-bar button { min-width: 100px; }
:root[data-theme] .debt-settlement-bar button:disabled { opacity: .4; cursor: default; }
:root[data-theme] #debt-filter-dialog form, :root[data-theme] #debt-checkout-dialog form { margin-top: 22px; }
:root[data-theme] .order-photo-section { margin: 22px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
:root[data-theme] .order-photo-section h3 { font-size: 15px; font-weight: 500; margin: 0 0 14px; }
:root[data-theme] .saved-order-photo { display: grid; justify-items: start; gap: 12px; margin: 12px 0; }
:root[data-theme] .saved-order-photo .thumb { display: block; width: auto; max-width: 100%; height: auto; max-height: 320px; object-fit: contain; border-radius: 12px; }
:root[data-theme] .order-photo-upload { display: inline-flex; width: auto; min-height: 44px; justify-content: center; }
@media(max-width:680px) {
  :root[data-theme] .debt-customer-row { padding: 20px 16px; gap: 12px; }
  :root[data-theme] .debt-customer-row .bag-avatar, :root[data-theme] .debt-customer-row .thumb { width: 46px; height: 46px; }
  :root[data-theme] .debt-customer-row > strong { font-size: 14px; }
  :root[data-theme] .debt-amount { font-size: 12px; }
  :root[data-theme] .debt-amount b { font-size: 15px; }
  :root[data-theme] .debt-date-heading { margin-right: 18px; margin-left: 18px; }
  :root[data-theme] .debt-order-row { gap: 12px; padding: 20px 16px; }
  :root[data-theme] .debt-order-row > a { flex-wrap: wrap; gap: 8px; }
  :root[data-theme] .debt-order-row > a > span:first-child { flex-basis: 130px; }
  :root[data-theme] .debt-order-row strong { font-size: 14px; }
  :root[data-theme] .debt-order-row small { font-size: 12px; }
  :root[data-theme] .debt-summary-card { margin: 0 14px 18px; padding: 18px; gap: 12px; }
  :root[data-theme] .debt-summary-amount strong { font-size: 26px; }
  :root[data-theme] .debt-summary-count { padding-left: 14px; }
  :root[data-theme] .debt-settlement-bar { padding: 10px 16px; gap: 10px; }
  :root[data-theme] .debt-settlement-bar > span { font-size: 12px; }
  :root[data-theme] .debt-settlement-bar strong { font-size: 15px; }
  :root[data-theme] .debt-settlement-bar button { min-width: 76px; }
}
@media print { :root[data-theme] .debt-settlement-bar, :root[data-theme] .order-photo-upload { display: none; } }

/* Confirmed month grouping: one continuous surface, with daily subtotals inside. */
:root[data-theme] .debt-month-card { margin: 0 20px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); overflow: hidden; }
:root[data-theme] .debt-month-header { height: auto; padding: 22px; gap: 16px; background: transparent; border-bottom: 1px solid var(--line); }
:root[data-theme] .debt-month-select { gap: 12px; }
:root[data-theme] .debt-month-select > span { display: grid; gap: 5px; }
:root[data-theme] .debt-month-select strong { font-size: 17px; font-weight: 500; color: var(--ink); }
:root[data-theme] .debt-month-select small { font-size: 12px; color: var(--sub); }
:root[data-theme] .debt-month-summary { display: flex; align-items: center; gap: 12px; text-align: right; }
:root[data-theme] .debt-month-summary > div { display: grid; gap: 4px; }
:root[data-theme] .debt-month-summary span { color: var(--sub); font-size: 12px; }
:root[data-theme] .debt-month-summary strong { font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
:root[data-theme] .debt-month-summary > button { min-width: 28px; width: 28px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--sub); font-size: 21px; }
:root[data-theme] .debt-month-card .debt-date-heading { margin: 0; padding: 12px 22px; gap: 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
:root[data-theme] .debt-month-card .debt-date-heading .check { gap: 12px; font-size: 13px; }
:root[data-theme] .debt-month-card .debt-date-heading > span { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
:root[data-theme] .debt-month-card .debt-date-heading strong { color: var(--ink); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
:root[data-theme] .debt-month-card .debt-order-row { padding: 17px 22px; gap: 12px; }
:root[data-theme] .debt-month-card .debt-order-row > a { gap: 14px; }
:root[data-theme] .debt-month-card .debt-order-row > a > span:first-child { gap: 4px; }
:root[data-theme] .debt-month-card .debt-order-row strong { font-size: 14px; }
:root[data-theme] .debt-month-card .debt-order-row small { font-size: 11px; }
:root[data-theme] .debt-month-card .debt-order-balance { display: grid; gap: 3px; text-align: right; min-width: 90px; }
:root[data-theme] .debt-month-card .debt-order-balance strong { color: var(--ink); font-size: 15px; font-weight: 400; font-variant-numeric: tabular-nums; }
:root[data-theme] .debt-settlement-bar > span > small { display: block; margin-bottom: 2px; font-size: 11px; }
:root[data-theme] .debt-settlement-bar > span { min-width: 0; }
@media(max-width:680px) {
  :root[data-theme] .debt-month-card { margin-right: 12px; margin-left: 12px; }
  :root[data-theme] .debt-month-header { padding: 19px 15px; gap: 8px; }
  :root[data-theme] .debt-month-select { gap: 9px; }
  :root[data-theme] .debt-month-select strong { font-size: 15px; }
  :root[data-theme] .debt-month-select small { font-size: 11px; }
  :root[data-theme] .debt-month-summary { gap: 4px; }
  :root[data-theme] .debt-month-summary strong { font-size: 19px; }
  :root[data-theme] .debt-month-summary span { font-size: 11px; }
  :root[data-theme] .debt-month-card .debt-date-heading { padding: 12px 15px; }
  :root[data-theme] .debt-month-card .debt-date-heading .check { gap: 9px; font-size: 12px; }
  :root[data-theme] .debt-month-card .debt-date-heading > span { font-size: 11px; gap: 4px; }
  :root[data-theme] .debt-month-card .debt-date-heading strong { font-size: 12px; }
  :root[data-theme] .debt-month-card .debt-order-row { padding: 17px 15px; gap: 9px; }
  :root[data-theme] .debt-month-card .debt-order-row > a { gap: 8px; }
  :root[data-theme] .debt-month-card .debt-order-row > a > span:first-child { flex-basis: auto; }
  :root[data-theme] .debt-month-card .debt-order-balance { min-width: 75px; }
  :root[data-theme] .debt-month-card .debt-order-balance strong, :root[data-theme] .debt-month-card .debt-order-row strong { font-size: 13px; }
}
@media(max-width:380px) {
  :root[data-theme] .debt-month-header { flex-wrap: wrap; }
  :root[data-theme] .debt-month-summary { margin-left: auto; }
}

/* Customer category groups share the confirmed goods-list proportions. */
:root[data-theme][data-editor="transaction"] .bottom { display: none; }
:root[data-theme][data-editor="transaction"] main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
:root[data-theme] .transaction-editor { background: transparent; }
:root[data-theme] .transaction-editor .return-contact { margin-bottom: 16px; }
:root[data-theme] .transaction-editor .return-contact button { display: grid; grid-template-columns: 95px minmax(0,1fr) 18px; text-align: left; align-items: center; }
:root[data-theme] .transaction-editor .return-contact button > span:nth-child(2) { overflow-wrap: anywhere; }
:root[data-theme] .transaction-editor .return-tools { display: grid; grid-template-columns: 1fr 1fr; padding: 18px 0; }
:root[data-theme] .transaction-editor .return-tools > button,
:root[data-theme] .transaction-editor .return-tools > label { width: 100%; border-radius: 0; }
:root[data-theme] .transaction-editor .return-tools > :first-child { border-right: 1px solid var(--line); }
:root[data-theme] .transaction-editor .transaction-lines { margin-top: 18px; }
:root[data-theme] .transaction-draft-actions { display: flex; justify-content: flex-end; margin: 18px 0; }
:root[data-theme] .transaction-draft-actions button { min-height: 38px; font-size: 13px; }
:root[data-theme] .transaction-editor > .return-bar { max-width: 1024px; }
:root[data-theme] .transaction-total { display: grid; gap: 2px; align-content: center; padding-left: 12px; min-width: 0; }
:root[data-theme] .transaction-total > small { font-size: 11px; color: var(--sub); }
:root[data-theme] .transaction-total > span { color: var(--sub); font-size: 12px; }
:root[data-theme] .transaction-total strong { display: inline; padding: 0; color: var(--ink); font-size: 21px; font-weight: 500; }
:root[data-theme] #order-discount-dialog > form { gap: 18px; }
@media(max-width:680px) {
  :root[data-theme] .transaction-editor .return-contact button { grid-template-columns: 70px minmax(0,1fr) 18px; }
  :root[data-theme] .transaction-total { padding-left: 4px; }
  :root[data-theme] .transaction-total strong { font-size: 18px; }
}
:root[data-theme] .customer-category-list > .product-card { min-height: 122px; padding: 22px 26px; gap: 14px; }
:root[data-theme] .customer-category-list .product-detail-open { min-width: 0; flex: 1 1 160px; gap: 16px; }
:root[data-theme] .customer-category-list .contact-avatar { margin: 0; flex: none; }
:root[data-theme] .customer-category-list .contact-avatar .bag-avatar,
:root[data-theme] .customer-category-list .contact-avatar .thumb { width: 70px; height: 78px; border-radius: 14px; object-fit: contain; }
:root[data-theme] .customer-category-list .product-summary { gap: 7px; }
:root[data-theme] .customer-category-list .product-summary strong { font-size: 17px; font-weight: 500; }
@media(max-width:680px) {
  :root[data-theme] .customer-category-list > .product-card { padding: 19px 18px; gap: 9px; }
  :root[data-theme] .customer-category-list .product-detail-open { flex-basis: 140px; gap: 10px; }
  :root[data-theme] .customer-category-list .contact-avatar .bag-avatar,
  :root[data-theme] .customer-category-list .contact-avatar .thumb { width: 54px; height: 68px; }
  :root[data-theme] .customer-category-list .product-summary strong { font-size: 16px; }
  :root[data-theme] .customer-category-list .product-summary > .hint { font-size: 12px; }
}

.contact-ledger-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 0 24px; }
.contact-ledger-links a { display: flex; align-items: center; justify-content: space-between; padding: 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.contact-ledger-links a span { color: var(--sub); }
.contact-ledger-filter { display: grid; grid-template-columns: 2fr repeat(3,minmax(0,1fr)) auto; gap: 12px; align-items: end; padding: 20px; }
.contact-ledger-summary { font-size: 16px; }
@media(max-width:700px) { .contact-ledger-filter { grid-template-columns: 1fr 1fr; padding: 16px 0; } .contact-ledger-filter > label:first-child { grid-column: 1/-1; } .contact-ledger-filter .actions { grid-column: 1/-1; } }

.contact-trade-total { display: grid; gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.contact-trade-total > span,.contact-trade-total small { color: var(--sub); }
.contact-trade-total strong { font-size: 26px; font-weight: 600; color: var(--ink); }
.contact-trade-total small { font-size: 12px; }

.customer-detail-dialog .gd-panel { min-height: 0; }
.customer-detail-dialog .gd-fields > div { grid-template-columns: 88px minmax(0,1fr); }

.warehouse-equipment-editor { margin: 24px 0; }
.warehouse-equipment-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; margin: 0 0 12px; min-width: 0; }
.warehouse-equipment-row legend { color: var(--sub); padding: 0 6px; }
.warehouse-equipment-detail { padding: 0 0 24px; }
.warehouse-detail-actions a { display: flex; align-items: center; justify-content: center; min-height: 51px; color: var(--ink); text-decoration: none; border-radius: 12px; }
.warehouse-list .product-detail-open { flex: 1; min-width: 0; }
@media(max-width:600px) { .warehouse-equipment-row { grid-template-columns: 1fr 1fr; gap: 10px; } .warehouse-equipment-row > label:first-of-type { grid-column: 1/-1; } }

.goods-detail-dialog .warehouse-detail-actions { grid-template-columns: repeat(auto-fit,minmax(100px,1fr)); }

.cash-kind { display: flex; gap: 8px; margin: 16px 0 24px; }
.cash-kind button[aria-pressed="true"] { background: var(--solid); color: var(--on); }
.cash-category-field { display: grid; gap: 8px; min-width: 0; }
.cash-category-field > span { color: var(--sub); }
.cash-category-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cash-photo-section { margin: 24px 0; border-top: 1px solid var(--line); padding-top: 20px; }
.cash-photos { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.cash-photos img,.cash-photos .thumb { width: 130px; height: 130px; object-fit: contain; border-radius: 12px; }
.cash-photos > div { display: grid; gap: 8px; }
.cash-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 20px 0; align-items: end; }
.cash-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 16px 0; }
.cash-totals span { color: var(--sub); }
.cash-totals strong { display: block; font-size: 22px; margin-top: 8px; overflow-wrap: anywhere; }
.cash-record { display: flex; gap: 16px; align-items: center; padding: 24px; color: var(--ink); text-decoration: none; }
.cash-record .product-summary { flex: 1; min-width: 0; }
.cash-record-mark { background: var(--soft); padding: 12px; border-radius: 12px; }
.production-remark { white-space: pre-wrap; overflow-wrap: anywhere; }
:root[data-theme] :is(.sample-filters,.employee-filters) .order-status-tabs { min-width: 0; flex-wrap: nowrap; overflow-x: auto; }
:root[data-theme] :is(.sample-filters,.employee-filters) .order-status-tabs button { flex: 1 0 auto; white-space: nowrap; }
:root[data-theme] .employee-filters .status-filter-row { min-width: 0; }
:root[data-theme] .employee-filters .order-status-tabs button { padding-inline: 10px; }
.production-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.production-form-grid :is(input,select,button) { min-width: 0; }
.production-form-grid .attribute-trigger span:first-child { overflow-wrap: anywhere; }
.production-form-grid [readonly] { color: var(--sub); }
.production-order-sku-editor { border-block: 1px solid var(--line); padding: 12px 0; }
.production-order-sku-editor h3, .production-order-detail-block h3 { margin: 0; }
.production-order-sku-editor [data-order-sku-empty]:empty { display: none; }
.production-order-sku-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(80px,.7fr) auto; align-items: end; gap: 8px; padding: 8px 0; }
.production-order-sku-row :is(input,select) { min-width: 0; }
.production-order-allocation { background: var(--soft); margin-top: 8px; padding: 8px 12px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.production-order-allocation [data-unbalanced] { color: var(--sub); }
.production-order-allocation [data-order-allocation-balance]:not([data-unbalanced]) { color: light-dark(#236141,#a7dcb7); }
.production-order-archive-summary, .production-order-archive-info, [data-order-process-status] { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.production-order-archive-summary { justify-content: space-between; background: var(--soft); border-radius: 12px; padding: 8px 12px; }
.production-order-archive-summary[hidden], .production-order-archive-summary button[hidden] { display: none; }
:root[data-theme] .production-order-archive-summary .archive-status.archive-pending { background: var(--paper); }
:root[data-theme] .production-order-archive-dialog table { min-width: 0; }
:root[data-theme] .production-order-archive-dialog :is(th,td) { white-space: normal; overflow-wrap: anywhere; }
:root[data-theme] .production-order-archive-dialog td:last-child { white-space: nowrap; }
.production-order-archive-dialog .spread { margin: 12px 0; }
:root[data-theme] .production-order-list.record-list { display: grid; gap: 10px; overflow: visible; background: transparent; }
:root[data-theme] .production-order-list.record-list > .production-order-card { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; padding: 14px 16px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.production-order-card-status, .production-order-card-meta { display: flex; align-items: center; gap: 8px; }
.production-order-card-status { flex: none; }
.production-order-card-status > .hint { font-size: 20px; line-height: 1; }
.production-order-reference { display: flex; align-items: baseline; gap: 8px; }
.production-order-reference > span:first-child:not(:only-child) { flex: none; white-space: nowrap; }
.production-order-reference > span + span { min-width: 0; padding-inline-start: 8px; border-inline-start: 1px solid var(--line); }
.production-order-card-meta { flex-wrap: wrap; font-size: 13px; overflow-wrap: anywhere; }
.production-order-card-meta strong { font-variant-numeric: tabular-nums; }
:root[data-theme] .production-order-card button.production-order-combination-trigger { position: relative; z-index: 2; min-height: 34px; padding: 5px 10px; border: 0; border-radius: 9px; background: var(--soft); color: var(--ink); font-size: 13px; }
:root[data-theme] .production-order-card .record-buttons { z-index: auto; }
.production-order-row-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 8px; }
.production-order-row-actions > button { position: relative; z-index: 2; }
.production-order-more { position: relative; z-index: 3; }
.production-order-more summary { border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.production-order-more summary::-webkit-details-marker { display: none; }
.production-order-more summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.production-order-more-actions { position: absolute; inset: auto 0 calc(100% + 5px) auto; display: grid; min-width: 96px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
:root[data-theme] .production-order-more-actions > button { white-space:nowrap; }
:root[data-theme] .production-order-more-actions > :is(a,button) { display: flex; align-items: center; justify-content: flex-start; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 8px; font-size: 13px; }
.production-order-more-actions > :is(a,button):is(:hover,:focus-visible) { background: var(--soft); }
@media(pointer:coarse) {
  :root[data-theme] .production-order-card button.production-order-combination-trigger { min-height: 44px; }
}
.production-order-detail-block { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.production-order-detail-block .production-order-metrics { margin-top: 8px; }
:root[data-theme] .production-order-sku-frame { margin-top: 8px; }
:root[data-theme] table.production-order-sku-table { min-width: 0; table-layout: fixed; }
:root[data-theme] .production-order-sku-table :is(th,td) { white-space: normal; overflow-wrap: anywhere; padding: 8px; }
.production-order-sku-table :is(th,td):last-child { text-align: right; }
.production-order-sku-table tfoot :is(th,td) { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.production-order-sku-table tfoot th { text-align: left; }
.production-order-combinations-heading { flex-wrap: nowrap; }
.production-order-combinations-heading h2 { margin: 0; }
.production-order-combinations-heading button { flex: none; }
.production-order-combinations-dialog { width: min(540px,calc(100% - 24px)); }
.production-order-combinations-meta { margin: 12px 0; overflow-wrap: anywhere; }
.production-order-history-dialog section + section { margin-top:16px; }
.production-order-history-dialog h3 { margin:0 0 6px; overflow-wrap:anywhere; }
.production-order-history-dialog .cell-value { overflow-wrap:anywhere; }
.production-order-combination-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 8px; }
.production-order-combination-card { display: grid; align-content: start; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.production-order-combination-card strong { min-width: 0; overflow-wrap: anywhere; }
.production-order-combination-card p.hint { margin: 0 0 4px; }
.production-order-combination-card .production-order-progress { color: var(--sub); font-size: 13px; }
.production-order-combination-actions { display: flex; justify-content: end; margin-top: 4px; }
.production-order-completion > p { margin: 7px 0 0; font-size: 13px; }
.production-order-completion-meta { margin-top: 7px; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.production-order-detail-block > .production-order-completion { margin-bottom: 12px; }
.production-order-combination-cost { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.production-order-combination-cost > :last-child { text-align: right; }
.production-order-combination-cost dt { font-size: 13px; color: var(--sub); }
.production-order-combination-cost dd { margin: 3px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
:root[data-theme] .production-order-list.record-list > .production-receipt-card {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 7px; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
}
.production-receipt-card .order-heading { width: 100%; }
.production-receipt-ready-lines { display:flex; flex-wrap:wrap; gap:6px; margin:0; padding:0; list-style:none; }
.production-receipt-ready-lines li { display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 8px; min-width:0; max-width:100%; border-radius:8px; padding:4px 8px; background:var(--soft); font-size:13px; overflow-wrap:anywhere; }
.production-receipt-ready-lines strong { font-variant-numeric:tabular-nums; }
.production-preparation-combinations { margin-top:12px; color:var(--ink); }
.production-preparation-combinations summary { padding:8px 0; }
.production-preparation-combinations h3 { margin:12px 0 6px; overflow-wrap:anywhere; }
.production-preparation-links { margin-top:12px; }
.production-preparation-print { display:none; }
@page production-preparation { size:A4; margin:12mm; }
@media print {
  :root[data-theme][data-page="production"]:has(.production-preparation-print) {
    --base:#fff; --paper:#fff; --ink:#222; --soft:#f5f5f5; --sub:#444; --line:#bbb;
    color-scheme:light;
  }
  :root[data-theme] .shell:has(.production-preparation-print) { min-height:0; }
  :root[data-theme] main:has(> .production-preparation-print) > :not(.production-preparation-print) { display:none; }
  :root[data-theme] .production-preparation-print { display:block; page:production-preparation; color:#222; font-size:11pt; }
  .production-preparation-print h1 { margin:0 0 12pt; font-size:20pt; }
  .production-preparation-print h2 { margin:12pt 0 5pt; font-size:13pt; break-after:avoid; }
  .production-preparation-print dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6pt 12pt; margin:0; }
  .production-preparation-print dl > div { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:6pt; break-inside:avoid; }
  .production-preparation-print dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
  .production-preparation-print-note { margin:10pt 0; border:1px solid #bbb; padding:6pt; overflow-wrap:anywhere; }
  :root[data-theme] .production-preparation-print .table { overflow:visible; }
  :root[data-theme] .production-preparation-print table { display:table; width:100%; border-collapse:collapse; color:inherit; }
  :root[data-theme] .production-preparation-print table thead { display:table-header-group; }
  :root[data-theme] .production-preparation-print table tbody { display:table-row-group; }
  :root[data-theme] .production-preparation-print table tr { display:table-row; break-inside:avoid; }
  :root[data-theme] .production-preparation-print table :is(th,td) { display:table-cell; border:1px solid #bbb; padding:5pt; text-align:left; font-size:10pt; overflow-wrap:anywhere; white-space:normal; }
  :root[data-theme] .production-preparation-print table tbody tr:last-child td { border-bottom:1px solid #bbb; }
  :root[data-theme] .production-preparation-print table td::before { content:none; }
  :root[data-theme] .production-preparation-print table :is(th,td) .cell-value { display:inline; overflow-wrap:anywhere; }
}
.production-receipt-card-bottom { font-variant-numeric: tabular-nums; }
.production-receipt-card-bottom > button { margin-inline-start: auto; }
:root[data-theme] .production-receipt-card [data-action="production-receipt-open"] { background: var(--soft); }
.production-receipt-badge {
  flex: none; padding: 5px 10px; border-radius: 999px; font-size: 13px;
  background: light-dark(#fff2e7,#3c2d20); color: light-dark(#a36530,#edbd91);
}
.production-receipt-filters .production-receipt-total { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.production-receipt-query { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.1fr) minmax(0,1fr); gap: 8px; }
.production-receipt-query :is(input,select) { min-width: 0; }
.production-receipt-dialog { width: min(540px,calc(100% - 24px)); }
.production-receipt-dialog p.hint { overflow-wrap: anywhere; }
.production-receipt-dialog .production-order-sku-table input { max-width: 120px; min-width: 0; text-align: right; padding-inline: 5px; }
.production-receipt-dialog form .actions { margin-top: 0; }
@media(max-width:420px) {
  .production-receipt-query { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); }
  .production-receipt-query > :last-child { grid-column: 1/-1; }
  .production-receipt-dialog { padding: 16px; }
}
.production-order-step-summary { padding-inline-start: 24px; }
.production-order-step-summary li + li { margin-top: 6px; }
.production-order-step-summary li .spread > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.production-order-metrics { display: grid; grid-template-columns: minmax(0,1fr) minmax(135px,.5fr); gap: 16px; align-items: start; color: var(--sub); }
:is(.production-order-progress,.production-order-cost) strong { color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.production-order-card .production-order-progress { color: var(--sub); font-size: 13px; }
.production-order-progress progress { display: block; width: 100%; height: 8px; margin-top: 8px; border: 0; border-radius: 99px; overflow: hidden; appearance: none; background: var(--soft); }
.production-order-progress progress::-webkit-progress-bar { background: var(--soft); }
.production-order-progress progress::-webkit-progress-value { background: var(--solid); }
.production-order-progress progress::-moz-progress-bar { background: var(--solid); }
.production-order-cost { display: grid; justify-items: end; gap: 3px; text-align: right; }
.production-order-cost strong { font-size: 16px; }
.production-order-progress-dialog { max-width: 560px; }
.production-order-progress-dialog [hidden] { display: none !important; }
.sample-progress-dialog.production-order-progress-dialog header { grid-template-columns: minmax(0,1fr) 44px; height: auto; }
.sample-progress-dialog .production-progress-title h2 { text-align: left; }
.production-progress-title p { margin: 3px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.production-progress-controls { flex: none; display: grid; gap: 12px; padding: 12px 20px 0; }
.production-progress-controls > label { margin: 0; }
.production-progress-overview { padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: 13px; color: var(--sub); }
:root[data-theme] .production-progress-filters { margin: 0; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); }
:root[data-theme] .production-progress-filters button { min-height: 44px; font-size: 14px; }
.production-progress-filters button span { margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.production-order-progress-dialog .sample-progress-body { padding-block: 4px 12px; }
.production-step-check {
  display: grid; align-items: center; grid-template-columns: auto minmax(2ch,auto) minmax(0,1fr) auto;
  gap: 8px; min-height: 46px; padding: 6px 2px; border-bottom: 1px solid var(--line);
  color: var(--ink); cursor: pointer; overflow-wrap: anywhere;
}
.production-step-check input { margin: 0; }
.production-step-check > :nth-child(2) { text-align: right; }
.production-step-check > :nth-child(4) { white-space: nowrap; font-size: 12px; }
.production-step-completion { font-size:12px; overflow-wrap:anywhere; }
.production-step-check > .production-step-completion { grid-column:3/-1; }
.production-step-edit > .production-step-completion { margin-inline-start:28px; }
[data-order-steps] > [data-order-step]:not([hidden]):not(:has(~ [data-order-step]:not([hidden]))) { border-bottom: 0; }
.production-progress-empty { text-align: center; margin: 18px 0; }
.production-order-progress-dialog [data-action="production-order-step-add"] { margin-top: 6px; }
.production-order-progress-dialog footer { flex: none; }
.production-progress-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.production-progress-footer [data-order-progress-feedback] { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.production-progress-footer [data-order-progress-feedback]:empty { display: none; }
.production-progress-footer [data-action="production-order-progress-undo"] { border: 0; padding-inline: 6px; text-decoration: underline; text-underline-offset: 2px; }
.production-order-progress-dialog .production-progress-footer .primary { width: auto; margin-inline-start: auto; }
.production-step-edit { display: grid; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
.production-step-line { display: grid; grid-template-columns: auto 2ch minmax(0,1fr) auto; gap: 8px; align-items: center; }
.production-step-line input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--solid); }
.production-step-line input[name="stepName"] { min-width: 0; }
.production-step-line [data-order-step-number] { text-align: right; }
.production-step-line button { width: 44px; padding: 0; font-size: 20px; }
.production-step-edit > label { margin-left: 28px; }
.production-order-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.production-order-badge { flex: none; border-radius: 999px; padding: 5px 10px; color: var(--sub); background: var(--soft); font-size: 13px; white-space: nowrap; }
.production-detail-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)); gap: 12px; margin: 16px 0; }
.production-detail-fields dt { color: var(--sub); font-size: 13px; }
.production-detail-fields dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.workshop-equipment { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-items: start; }
.workshop-equipment > section { background: var(--soft); padding: 12px; border-radius: 14px; margin: 0; min-width: 0; }
.workshop-equipment h3 { margin: 0 0 10px; font-size: 16px; }
.workshop-equipment .warehouse-equipment-row { grid-template-columns: minmax(0,1fr) 64px 54px auto; padding: 8px 0; margin: 0; gap: 6px; border: 0; border-radius: 0; }
.workshop-equipment .warehouse-equipment-row + .warehouse-equipment-row { border-top: 1px solid var(--line); }
:root[data-theme] .workshop-equipment .warehouse-equipment-row input { padding-inline: 8px; background: var(--paper); }
.workshop-equipment .warehouse-equipment-row button { padding-inline: 8px; white-space: nowrap; }
.workshop-items { margin: 0; padding: 0; list-style: none; }
.workshop-items li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; overflow-wrap: anywhere; }
.workshop-items li + li { border-top: 1px solid var(--line); }
[data-production-form-error]:empty { display: none; }
@media(max-width:810px) {
  .workshop-equipment { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:480px) {
  .production-form-grid { grid-template-columns: minmax(0,1fr); }
  .production-order-sku-row { grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--line); }
  .production-order-sku-row > button { justify-self: end; }
  .production-order-metrics { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .production-order-cost { grid-template-columns: minmax(0,1fr) auto; justify-items: start; text-align: left; align-items: center; }
  .production-order-cost strong { text-align: right; }
  .production-order-cost small { grid-column: 1/-1; justify-self: end; }
  .workshop-equipment .warehouse-equipment-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; }
  .workshop-equipment .warehouse-equipment-row > label:first-of-type { grid-column: 1/-1; }
}
.sample-card-body { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; align-items: start; margin-top: 12px; }
.sample-card-info { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.sample-card-info p { margin: 0; }
.sample-card .sample-preparation-progress progress::-webkit-progress-value { background: var(--ink); }
.sample-card .sample-preparation-progress progress::-moz-progress-bar { background: var(--ink); }
.sample-card .record-buttons .action { display: inline-flex; align-items: center; }
.sample-progress-dialog {
  --sample-orange: light-dark(#a64e00,#ffad5c);
  --sample-green: light-dark(#167239,#68dc8e);
}
.sample-cover { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 12px; object-fit: cover; background: var(--soft); }
.sample-cover svg { width: 34px; height: 34px; }
.sample-progress-actions button { display: inline-flex; align-items: center; justify-content: center; background: var(--soft); border: 0; border-radius: 10px; padding: 8px 12px; font-size: 14px; white-space: nowrap; }
.sample-preparation h3, .sample-photo-editor h3 { margin: 0 0 8px; font-size: 16px; }
.sample-preparation-progress { display: flex; align-items: center; gap: 10px; }
.sample-preparation-progress > span { flex: none; font-variant-numeric: tabular-nums; }
.sample-preparation-progress progress { appearance: none; flex: 1; min-width: 0; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--soft); }
.sample-preparation-progress progress::-webkit-progress-bar { background: var(--soft); }
.sample-preparation-progress progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg,#2bc454,#25a9bf); }
.sample-preparation-progress progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg,#2bc454,#25a9bf); }
.sample-preparation-row { display: grid; grid-template-columns: auto minmax(0,1fr) minmax(0,1fr) auto; align-items: center; gap: 8px; margin-top: 10px; }
.sample-preparation-row > * { min-width: 0; overflow-wrap: anywhere; }
.sample-preparation-row input[type="checkbox"], .sample-progress-item input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 0 4px; cursor: pointer; }
.sample-preparation-row button { width: 44px; padding: 0; font-size: 22px; }
.sample-preparation-mark { width: 28px; text-align: center; color: var(--sub); }
.sample-preparation-mark[data-ready="true"] { color: light-dark(#167239,#68dc8e); }
:root[data-theme] .sample-preparation-add { width: 100%; margin-top: 12px; border-style: dashed; color: light-dark(#006bdc,#74b5ff); }
.sample-preparation > .hint, .sample-cost-note { margin: 6px 0 0; }
.sample-photo-editor .spread h3 { margin: 0; }
.sample-photo-editor [data-sample-photo-status]:empty, [data-sample-error]:empty, [data-process-error]:empty, [data-process-import-status]:empty { display: none; }
.sample-detail-fields { display: flex; gap: 14px 28px; flex-wrap: wrap; margin: 16px 0 22px; }
.sample-detail-fields dt { color: var(--sub); }
.sample-detail-fields dd { margin: 3px 0 0; }
.sample-progress-dialog { width: min(760px,calc(100% - 24px)); max-height: 94dvh; padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: var(--paper); overflow: hidden; }
.sample-progress-dialog::backdrop { background: #0006; }
.sample-progress-dialog form { display: flex; flex-direction: column; gap: 0; max-height: inherit; }
.sample-progress-dialog header { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.sample-progress-dialog header h2 { grid-column: 2; margin: 0; text-align: center; font-size: 18px; overflow-wrap: anywhere; }
.sample-progress-dialog header button { min-width: 44px; border: 0; border-radius: 99px; padding: 0; background: var(--soft); font-size: 24px; color: var(--sub); }
.sample-progress-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 20px; }
.sample-progress-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 4px 0 20px; }
.sample-progress-totals > div { display: grid; gap: 5px; }
.sample-progress-totals span { color: var(--sub); }
.sample-progress-totals strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.sample-progress-items { display: grid; gap: 8px; border-radius: 14px; padding: 10px; background: var(--soft); }
.sample-progress-item { grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 10px 8px; border: 1px solid transparent; border-radius: 10px; color: var(--ink); cursor: pointer; }
.sample-progress-item:has(:checked) { background: color-mix(in srgb,var(--sample-green) 10%,var(--soft)); border-color: color-mix(in srgb,var(--sample-green) 32%,var(--soft)); }
:root[data-theme] .sample-progress-item input { accent-color: var(--sample-green); }
.sample-progress-item > span { overflow-wrap: anywhere; }
.sample-progress-item small { display: block; margin-top: 3px; }
.sample-progress-item-state { color: var(--sub); font-size: 13px; }
.sample-progress-item:has(:checked) .sample-progress-item-state, .sample-progress-note { color: var(--sample-green); }
.sample-progress-note[data-pending] { color: var(--sample-orange); }
.sample-progress-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sample-progress-dialog footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sample-progress-dialog .primary { width: 100%; font-weight: 600; }
.sample-progress-dialog .primary:disabled { opacity: .5; }
@media(max-width:600px) {
  .sample-card-body { gap: 10px; }
  .sample-cover { width: 60px; height: 60px; }
  .sample-progress-dialog { inset: auto 0 0; margin: 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0; }
}
@media(max-width:430px) {
  .sample-preparation-row { grid-template-columns: 28px minmax(0,1fr) 44px; }
  .sample-preparation-row > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .sample-preparation-row button { grid-column: 3; grid-row: 1; }
  .sample-preparation-row > span:empty { display: none; }
}
.inline-picker-field { display: grid; gap: 8px; min-width: 0; }
.inline-picker-control { position:relative; display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:stretch; background:var(--soft); border:1px solid var(--line); border-radius:12px; }
:root[data-theme] .inline-picker-control :is(input[type="search"], [data-action="inline-picker-toggle"]) { min-height:44px; border:0; border-radius:11px; background:transparent; color:var(--ink); }
.inline-picker-control input[type="search"] { min-width:0; width:100%; }
.inline-picker-control [data-action="inline-picker-toggle"] { padding:0; }
.inline-picker-control [data-action="inline-picker-toggle"][aria-expanded="true"] span { display:inline-block; transform:rotate(180deg); }
#process-product-error { margin:0; }
#process-product-error:empty { display:none; }
.inline-picker-menu { position:absolute; z-index:12; inset:calc(100% + 6px) 0 auto; max-height:min(42dvh,320px); overflow:auto; overscroll-behavior:contain; padding:4px; border:1px solid var(--line); border-radius:12px; background:var(--paper); }
.inline-picker-field [hidden] { display:none; }
:root[data-theme] .inline-picker-options button { width:100%; min-height:44px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:8px 10px; border:0; border-radius:8px; background:var(--paper); color:var(--ink); text-align:left; overflow-wrap:anywhere; }
:root[data-theme] .inline-picker-options button[hidden] { display:none; }
:root[data-theme] .inline-picker-options button:is(:hover,[data-active],[aria-selected="true"]) { background:var(--soft); }
.inline-picker-options small { color:var(--sub); }
.inline-picker-menu .empty { margin:0; padding:10px; text-align:left; }
.process-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.process-detail-product { display: flex; align-items: center; gap: 16px; min-width: 0; overflow-wrap: anywhere; }
.process-detail-cover { width: 96px; height: 96px; flex: none; object-fit: contain; border-radius: 12px; background: var(--soft); }
:root[data-theme] .process-detail-product h2 { margin: 0; font-size: 22px; }
.process-detail-product p { margin: 4px 0 0; }
.process-detail-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: none; }
.process-detail-actions .action { display: inline-flex; align-items: center; }
.process-detail-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--soft); }
.process-detail-summary > div + div { border-inline-start: 1px solid var(--line); padding-inline-start: 16px; }
.process-detail-summary dt { color: var(--sub); font-size: 13px; }
.process-detail-summary dd { margin: 3px 0 0; font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media(max-width:500px) {
  .process-detail-top { display: grid; gap: 12px; }
  .process-detail-cover { width: 72px; height: 72px; }
}
.process-editor { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--soft); }
:root[data-theme] .record-list > .production-archive-card { display: grid; grid-template-columns: minmax(0,1fr); }
.archive-card-actions, .archive-form-actions { justify-content: flex-end; margin-bottom: 0; }
.product-archive-overview { margin: 16px 0 20px; }
.product-archive-overview h3 { margin: 0; }
.product-archive-overview > .spread { margin-bottom: 8px; }
.product-archive-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.product-archive-row > .product-summary { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.product-archive-row .order-badges { max-width: none; }

.record-list > .product-cost-card { display: grid; }
.product-cost-card .product-detail-open { justify-content: space-between; }
.product-cost-list-label { flex: none; }
.product-cost-options { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,118px),1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.product-cost-options > li { display: flex; min-width: 0; }
.product-cost-option { display: grid; flex: 1; align-content: start; gap: 4px; min-width: 0; padding: 9px 12px; border-radius: 12px; background: var(--soft); overflow-wrap: anywhere; }
.product-cost-option strong { font-variant-numeric: tabular-nums; }
.product-cost-option:hover { background: var(--line); }
:root[data-theme] main > .product-cost-summary > h2 { padding-bottom: 0; border: 0; margin-bottom: 3px; }
.product-cost-sizes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block: 14px; }
.product-cost-sizes .action { background: var(--soft); }
.product-cost-sizes .action[aria-current="page"] { background: var(--solid); color: var(--on); border-color: var(--solid); }
.product-cost-total { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.product-cost-total strong { font-size: clamp(25px, 5vw, 38px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.product-cost-details .product-cost-heading { padding-bottom: 12px; }
.product-cost-heading h3 { margin: 0; }
.product-cost-details > :is(.product-cost-row, .product-cost-item, form, footer) { border-top: 1px solid var(--line); }
.product-cost-details > form[hidden] { display: none; }
.product-cost-details > form { padding-block: 12px; }
.product-cost-details > form > .actions { justify-content: flex-end; }
.product-cost-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 54px; padding-block: 8px; }
.product-cost-row > span:first-child { font-weight: 600; }
.product-cost-row small { display: block; font-weight: 400; }
.product-cost-row strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.product-cost-item summary { grid-template-columns: minmax(0,1fr) auto 12px; list-style: none; cursor: pointer; }
.product-cost-item summary::-webkit-details-marker { display: none; }
.product-cost-item summary::after { content: '⌄' / ''; justify-self: end; color: var(--sub); }
.product-cost-item[open] summary::after { transform: rotate(180deg); }
.product-cost-part-detail { display: grid; justify-items: start; gap: 8px; padding-bottom: 12px; }
.product-cost-lines { width: 100%; display: grid; list-style: none; margin: 0; padding: 6px 12px; border-radius: 12px; background: var(--soft); }
.product-cost-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-block: 8px; }
.product-cost-lines li + li { border-top: 1px solid var(--line); }
.product-cost-lines small { display: block; }
.product-cost-audit { padding-top: 8px; }
.product-cost-audit p { margin: 4px 0; }

.dashboard-todo-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 90px;
  margin: 0 20px 16px;
  padding: 16px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
}
.dashboard-todo-entry .module-icon { flex: none; }
.dashboard-todo-entry .product-summary { display: grid; gap: 3px; flex: 1; }
.dashboard-todo-entry > :last-child { color: var(--sub); font-size: 24px; }
:root[data-theme] .record-list > .followup-list-item { display: block; }
.followup-list-row { justify-content: space-between; gap: 16px; }
.followup-list-row .product-summary { min-width: 0; }
.followup-list-status { display: grid; justify-items: end; gap: 4px; flex: none; }
.followup-list-actions { padding: 0 12px 10px; }
.followup-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px 10px;
  color: var(--sub);
  font-size: 13px;
  white-space: nowrap;
}
.followup-status.followup-due { color: var(--ink); background: var(--soft); }
.followup-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 12px 16px;
  margin: 14px 0 0;
}
.followup-fields dt { color: var(--sub); font-size: 13px; }
.followup-fields dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.followup-actions { margin-top: 16px; }
.followup-section-heading { gap: 10px; margin-bottom: 8px; }
.followup-record { border-top: 1px solid var(--line); }
.followup-record summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 0;
}
.followup-record summary > span { min-width: 0; }
.followup-record summary > span > small { display: block; overflow-wrap: anywhere; }
.followup-record summary > strong::after { content: ' ▸'; color: var(--sub); }
.followup-record[open] summary > strong::after { content: ' ▾'; }
.followup-record-content { padding: 0 0 12px; }
.followup-note { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; padding: 10px 12px; }
.followup-note p, .followup-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.followup-note p { margin: 5px 0 0; }
.followup-entry { border-top: 1px solid var(--line); padding-top: 12px; }
.followup-entry > small { display: block; margin-top: 4px; }
.followup-manual-line { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0 0; min-width: 0; padding: 12px; }
.followup-manual-line legend { padding-inline: 4px; color: var(--sub); }
[data-followup-lines] > .followup-manual-line:only-child .followup-remove-line { display: none; }
.followup-editor [data-customer-followup-error]:empty { display: none; }
.followup-order-photos { margin: 14px 0; }
.followup-order-photos [data-followup-photo-status]:empty { display: none; }
.ecommerce-list-card .product-detail-open { flex: 1; min-width: 0; }
.ecommerce-list-card > input[type="checkbox"] { flex: none; }
.ecommerce-sku { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; }
.ecommerce-sku + .ecommerce-sku { margin-top: 12px; }
.ecommerce-sku legend { color: var(--sub); padding-inline: 4px; }
.ecommerce-tier-fields, .ecommerce-gallery, .ecommerce-sku-remove { margin-top: 12px; }
.ecommerce-gallery .production-sku-photos { margin-top: 8px; }
.ecommerce-sku-detail + .ecommerce-sku-detail { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
[data-ecommerce-skus] > .ecommerce-sku:only-child .ecommerce-sku-remove,
[data-ecommerce-photo-status]:empty, [data-ecommerce-error]:empty { display: none; }
[data-catalog-variants] > .catalog-variant:only-child .ecommerce-sku-remove { display: none; }
.catalog-edit-strip { display: flex; gap: 8px; overflow-x: auto; padding: 3px; margin-top: 6px; }
:root[data-theme] .production-sku-photos.catalog-edit-strip { flex-wrap: nowrap; }
.catalog-edit-strip > * { flex: none; }
.catalog-policy { white-space: pre-wrap; overflow-wrap: anywhere; }
.catalog-editor-group h3 { font-size: 16px; margin: 0 0 8px; }
.catalog-editor-group + .catalog-editor-group { border-top: 1px solid var(--line); padding-top: 12px; }
.catalog-editor-group .catalog-stage { margin-top: 8px; max-width: 500px; }
.catalog-shared-editor { margin-top: 10px; }
.catalog-editor-group .catalog-variant + .catalog-variant, .catalog-editor-group .catalog-editor-prices, .catalog-variant > label { margin-top: 10px; }
.catalog-variant[open] > summary { margin-bottom: 10px; }
.catalog-variant summary { cursor: pointer; overflow-wrap: anywhere; }
.todo-list-actions, .todo-editor .actions { justify-content: flex-end; }
.todo-filters .order-status-tabs > button { flex: 1 0 auto; }
.todo-list .product-detail-open { justify-content: space-between; }
:root[data-theme] .todo-detail-head h2 { margin: 0; overflow-wrap: anywhere; }
.todo-detail-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: 14px; margin: 16px 0; }
.todo-detail-fields dt { color: var(--sub); font-size: 13px; }
.todo-detail-fields dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.todo-detail > :is(section,form) { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.todo-detail h3 { font-size: 15px; margin: 0 0 8px; }
.todo-detail p { white-space: pre-wrap; overflow-wrap: anywhere; }
.todo-history { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.todo-history li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.todo-detail textarea, .todo-editor textarea { min-height: 84px; }
:root[data-theme] .supplier-library-list > .product-card { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
.supplier-result-head :is(h2,p), .supplier-library-list .product-card > p { margin: 0; overflow-wrap: anywhere; }
.supplier-result-head p { margin-top: 4px; }
.supplier-result-head h2 span { color: var(--sub); }
.supplier-library-tabs a { flex: 1; white-space: nowrap; }
:root[data-theme] .supplier-material-list > .library-material-row { display: grid; grid-template-columns: 58px minmax(0,1fr) minmax(0,24%); align-items: center; }
:root[data-theme] .supplier-library-list .supplier-material-list { margin: 0; border-radius: 0; border-top: 1px solid var(--line); }
:root[data-theme] .supplier-library-list .library-material-row { padding-inline: 0; }
.library-material-photo { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); overflow: hidden; font-size: 11px; }
.library-material-row .library-material-photo { width: 100%; min-width: 0; min-height: 0; }
.library-material-photo:focus-visible { outline-offset: 2px; }
.library-material-photo img { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; }
.library-material-photo span { position: absolute; right: 4px; bottom: 4px; border-radius: 5px; padding: 2px 4px; background: var(--paper); color: var(--ink); }
.library-material-body, .library-material-quote { display: grid; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.library-material-body h3 { margin: 0; font-size: 16px; }
.library-material-supplier { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; color: var(--sub); font-size: 13px; }
.library-material-supplier small { font-size: inherit; }
.library-material-quote { justify-items: end; text-align: right; }
.library-material-price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 3px 6px; min-width: 0; max-width: 100%; font-variant-numeric: tabular-nums; }
:root[data-theme] .library-material-price strong { min-width: 0; font-size: clamp(17px,2vw,22px); font-weight: 650; }
.library-material-price span { color: var(--sub); font-size: 13px; }
.library-material-quote .action { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 8px; border-radius: var(--action-radius); font-size: 13px; white-space: nowrap; }
.library-material-supplier a { text-decoration: underline; text-underline-offset: 3px; }
@media(max-width:680px) {
  :root[data-theme] .supplier-material-list > .library-material-row { grid-template-columns: 50px minmax(0,1fr) minmax(74px,28%); gap: 10px; padding-block: 14px; }
}
.supplier-item-fields { display: grid; gap: 12px; }
.supplier-item-fields[hidden] { display: none; }
.supplier-item-fields details { border-radius: var(--action-radius); background: var(--soft); padding: 10px 12px; }
.supplier-item-fields details[open] summary { margin-bottom: 10px; }
.supplier-item-fields details summary { cursor: pointer; }
.supplier-item-fields details > label { margin-top: 10px; }
.supplier-compare .spread h2,.supplier-library-contact .spread h2 { margin: 0; overflow-wrap: anywhere; }
.supplier-materials { display: grid; gap: 10px; }
.supplier-contact-materials { margin-top: 14px; }
.supplier-materials:empty { display: none; }
.supplier-material { min-width: 0; padding: 12px; border-radius: var(--action-radius); background: var(--soft); }
.supplier-material h3 { font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.supplier-material .production-sku-photos { margin-top: 8px; }
.supplier-library-remark { white-space: pre-wrap; overflow-wrap: anywhere; }
.supplier-compare :is(td,th) { white-space: normal; overflow-wrap: anywhere; }
.supplier-compare td a:not(.action) { text-decoration: underline; text-underline-offset: 3px; }
.supplier-compare .status { display: inline-block; }
.library-quote-price { display: inline-block; }
.library-quote-conversion { display: block; margin-top: 4px; }
.library-quote-note { white-space: pre-wrap; color: var(--sub); }
.supplier-quote-editor textarea { min-height: 88px; }
@media(max-width:680px) {
  .dashboard-todo-entry { margin-inline: 12px; padding-inline: 18px; }
}
:is(.production-archive-card,.product-archive-row) .record-buttons .action { display: inline-flex; align-items: center; white-space: nowrap; }
@media(max-width:480px) {
  .product-archive-row { grid-template-columns: minmax(0,1fr) auto; }
  .product-archive-row .product-summary { grid-column: 1/-1; }
  .product-archive-row .order-badges { justify-content: flex-start; }
}
.material-editor { margin-top: 18px; }
:root[data-theme] .material-editor .tabs { margin: 0; gap: 4px; padding: 4px; border-radius: 16px; background: var(--soft); }
[data-material-editor] { display: grid; gap: 16px; }
.material-group-select, .material-tool-bar, .material-editor-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.material-group-select { align-items: end; }
.material-group-select > label { flex: 1 1 180px; }
.material-tool-bar { padding-top: 14px; border-top: 1px solid var(--line); }
.material-tool-bar h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.material-document-tools :is(button,.process-tool) { gap:6px; white-space:nowrap; }
.material-document-tools svg { width:16px; height:16px; flex:none; }
.material-document-preview { display:grid; gap:8px; min-width:0; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--soft); }
.material-document-preview[hidden], [data-material-preview-error]:empty { display:none; }
.material-document-preview :is(h4,p) { margin:0; }
.material-document-preview .table { min-width:0; margin:0; }
.material-document-preview table { min-width:0; }
.material-document-preview :is(th,td) { overflow-wrap:anywhere; }
.material-document-preview .actions { justify-content:flex-end; }
.material-tools { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.employee-panels { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.18fr); gap:14px; }
.employee-panels > .panel { min-width:0; margin:0; }
main .employee-panels > .panel { padding:18px; }
.employee-editor .fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.employee-editor .fields > label { min-width:0; align-self:start; }
.employee-editor h2 { margin:0 0 14px; }
.employee-editor h3 { margin:14px 0 8px; }
.employee-editor .spread > small { margin-bottom:14px; }
.employee-photo, .employee-detail-title { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.employee-editor .employee-photo { margin-bottom:12px; }
.employee-photo-frame { display:grid; place-items:center; flex:none; width:56px; height:56px; overflow:hidden; border-radius:12px; background:var(--soft); color:var(--sub); }
.employee-photo-frame img { width:100%; height:100%; object-fit:cover; }
[data-employee-photo-box="receiptImage"] img { object-fit:contain; }
.employee-photo-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.employee-photo-actions .process-tool { border:1px solid var(--line); }
.employee-photo-actions [hidden], [data-employee-status]:empty { display:none; }
.employee-payment { display:grid; gap:14px; }
.employee-editor .employee-payment .employee-photo { margin-bottom:0; }
.employee-payment .fields > label:last-child { grid-column:1/-1; }
.employee-editor [data-birthday-lunar]:not([hidden]) { display:grid; gap:6px; }
.employee-document-tools { display:grid; gap:8px; }
.employee-document-tools .process-tools { justify-content:flex-start; }
[data-employee-import-status] { margin:0; }
[data-employee-import-status]:empty { display:none; }
[data-employee-import-rows] { display:flex; align-items:flex-end; flex-wrap:wrap; gap:8px; }
[data-employee-import-rows] > label { flex:1 1 180px; min-width:0; }
[data-employee-import-rows] select { width:100%; min-width:0; }
.employee-footer { display:flex; justify-content:flex-end; flex-wrap:wrap; align-items:center; gap:8px; }
.employee-detail-title h2 { margin:0; }
.employee-detail-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(130px,100%),1fr)); gap:12px; margin:16px 0; }
.employee-detail-fields :is(dt,dd) { overflow-wrap:anywhere; }
.employee-detail-fields dt { color:var(--sub); font-size:13px; }
.employee-detail-fields dd { margin:3px 0 0; }
.employee-receipt { display:block; width:min(176px,100%); object-fit:contain; border-radius:12px; }
@media(max-width:680px) {
  .employee-panels { grid-template-columns:minmax(0,1fr); }
  main .employee-panels > .panel { padding:14px; }
  .employee-document-tools { margin-inline:12px; }
}
:root[data-theme] .employee-template { width:min(780px,calc(100% - 30px)); }
:root[data-theme] .employee-template .table { overflow:auto; }
:root[data-theme] .employee-template table { min-width:max-content; }
.employee-template :is(th,td) { white-space:nowrap; }
.employee-birthdays { display:grid; gap:22px; margin:0 20px; }
.employee-birthday-group { display:grid; gap:8px; }
.employee-birthday-group h2 { display:flex; align-items:center; gap:8px; margin:0 0 4px; font-size:17px; font-weight:600; }
.employee-birthday-group h2::before { content:""; width:4px; height:15px; border-radius:4px; background:var(--sub); }
.employee-birthday-group h2 small { font-size:13px; font-weight:400; }
.employee-birthday-card { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:12px; min-width:0; padding:14px; background:var(--paper); border:1px solid var(--line); border-radius:var(--action-radius); }
.employee-birthday-card .employee-photo-frame { width:48px; height:48px; border-radius:50%; }
.employee-birthday-card .employee-photo-frame .bag-avatar { width:100%; height:100%; }
.employee-birthday-person, .employee-birthday-next { display:grid; gap:3px; }
.employee-birthday-person { overflow-wrap:anywhere; }
.employee-birthday-next { text-align:right; }
.employee-birthday-accent { color:light-dark(#a64e00,#ffad5c); }
.stock-shortage { color:light-dark(#a64e00,#ffad5c); }
.employee-birthday-accent svg { vertical-align:middle; }
@media(max-width:680px) {
  .employee-birthdays { margin-inline:12px; }
  .employee-birthday-card { padding:12px; gap:9px; }
}
.material-rows { display: grid; gap: 10px; }
.material-row { display: grid; grid-template-columns: minmax(52px,.55fr) minmax(120px,2fr) minmax(85px,1fr) minmax(85px,1fr) 44px; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.material-row input { min-width: 0; }
:root[data-theme] .material-row input { background: var(--paper); }
.material-row label { font-size: 13px; }
.material-field-quantity { grid-column: 1 / 3; }
.material-field-unit { grid-column: 3; }
.material-field-rate { grid-column: 4; }
.material-field-remark { grid-column: 1 / 5; }
.material-row-remove { grid-column: 5; grid-row: 1 / span 2; align-self: start; padding: 0; font-size: 20px; }
.material-editor-footer { color: var(--sub); }
.material-editor-footer strong { color: var(--ink); font-variant-numeric: tabular-nums; }
[data-material-status]:empty { display: none; }
.material-purchase-dialog { width: min(760px,calc(100% - 24px)); }
.material-purchase-dialog .gd-top strong { overflow-wrap: anywhere; }
.material-batches { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(190px,100%),1fr)); gap: 12px; }
.material-batches small { display: block; }
.material-purchase-heading { margin-top: 16px; }
@media(max-width:680px) {
  .material-row { grid-template-columns: repeat(2,minmax(0,1fr)) 44px; gap: 8px; }
  .material-field-name { grid-column: 1 / 3; grid-row: 2; }
  .material-field-spec, .material-field-color { grid-row: 3; }
  .material-field-quantity, .material-field-unit { grid-column: auto; grid-row: 4; }
  .material-field-rate { grid-column: auto; }
  .material-field-remark { grid-column: 1 / 3; }
  .material-row-remove { grid-column: 3; grid-row: 1; }
}
.process-editor h3 { margin: 0; font-size: 16px; }
.process-editor h3 small { color: var(--sub); font-size: 13px; font-weight: 400; }
.process-editor-top { display: grid; gap: 8px; }
.process-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.process-tools { justify-content: flex-end; }
.process-tools button, .process-tool { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 9px; background: var(--paper); color: var(--ink); }
.process-tool { position: relative; cursor: pointer; }
.process-tool input { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: pointer; }
.process-tool:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.process-tool:has(input:disabled) { opacity: .5; }
.process-tool-photo { background: light-dark(#edddf7,#45304e); color: light-dark(#762ba6,#d896ff); }
.process-tool-sheet { background: light-dark(#dbe9f5,#263e53); color: light-dark(#096797,#68c9fb); }
.process-tools :is([data-action="process-export"],[data-action="material-export"],[data-action="employee-export"]) { background: light-dark(#d9ede0,#2b4233); color: light-dark(#177640,#79da9a); }
.material-document-tools [data-action="material-template-open"] { background:var(--soft); }
.process-editor [data-process-rows] { display: grid; gap: 8px; }
.process-row { display: grid; grid-template-columns: 72px minmax(0,1fr) minmax(76px,120px) 44px; gap: 8px; align-items: center; }
.cutting-row { grid-template-columns: 72px minmax(0,1fr) minmax(70px,105px) minmax(76px,120px) 44px; }
:root[data-theme] .process-row input { min-width: 0; background: var(--paper); }
.process-row > button { padding: 0; min-width: 44px; font-size: 22px; }
.process-total { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px; border: 1px solid light-dark(#ecd5b6,#725033); border-radius: 12px; }
.process-total > div { display: grid; gap: 2px; }
.process-total > strong { color: light-dark(#a64e00,#ffad5c); font-size: 21px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.process-hint, [data-process-import-status] { margin: 0; }
:is(.process-template,.material-document-dialog) { width: min(540px,calc(100% - 30px)); }
.process-template table, :root[data-theme] .material-document-dialog table { min-width: 0; }
:root[data-theme] .material-document-dialog :is(th,td) { padding-inline:7px; overflow-wrap:anywhere; white-space:normal; }
@media(max-width:560px) {
  :root[data-theme] .material-document-dialog .actions { padding-inline:0; }
  .material-document-dialog :is(table,tbody) { display:block; }
  .material-document-dialog thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .material-document-dialog tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:8px; }
  .material-document-dialog tbody tr + tr { border-top:1px solid var(--line); }
  :root[data-theme] .material-document-dialog tbody td { display:block; min-width:0; padding:0; border:0; text-align:left; }
  .material-document-dialog tbody td::before { content:attr(data-label); display:block; color:var(--sub); font-size:12px; }
}
@media(max-width:600px) {
  .process-tools { justify-content: flex-start; }
  .material-document-tools:has(.process-tool-photo) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
  .process-editor { padding: 12px; }
  .process-row { grid-template-columns: minmax(52px,.65fr) minmax(68px,1.5fr) minmax(63px,1fr) 36px; gap: 4px; }
  .process-row > input { padding-inline: 5px; }
  .process-row > button { min-width: 36px; }
  .cutting-row { grid-template-columns: 52px repeat(2,minmax(0,1fr)) 36px; }
  .cutting-row [name="processName"] { grid-column: 2 / 4; }
  .cutting-row [name="processQuantity"] { grid-column: 2; grid-row: 2; }
  .cutting-row [name="processRate"] { grid-column: 3; grid-row: 2; }
  .cutting-row > button { grid-column: 4; grid-row: 1; }
}
.production-product-row .thumb { object-fit: contain; }
.production-product-row > .production-product-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-inline-start: auto; }
.production-product-actions > .list-record-action { white-space: nowrap; }
@media(max-width:680px) {
  :root[data-theme] .record-list .production-product-row .thumb { width: 54px; height: 54px; }
}
.production-attributes { grid-template-columns: repeat(3,minmax(0,1fr)); }
.production-attributes label, .production-attributes .attribute-trigger { min-width: 0; }
.production-attributes .attribute-trigger span:first-child { overflow-wrap: anywhere; }
.production-skus h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.production-color-album { padding: 12px 14px; border-radius: 12px; background: var(--soft); overflow-wrap: anywhere; }
.production-variant-section { margin-top: 16px; }
.production-color-album h4, .production-variant-section h4 { margin: 0; font-size: 15px; }
.production-spec-list { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.production-spec-row { display: grid; grid-template-columns: minmax(36px,.8fr) minmax(70px,2fr) minmax(70px,1.1fr); gap: 10px; align-items: center; padding: 8px 12px; }
.production-spec-row > * { min-width: 0; overflow-wrap: anywhere; }
.production-spec-list > :not(:first-child) { border-top: 1px solid var(--line); }
.production-spec-head { background: var(--soft); color: var(--sub); font-size: 13px; }
.production-spec-head > :last-child, .production-spec-source { text-align: right; }
.production-spec-source button { padding: 7px 10px; min-height: 44px; white-space: nowrap; font-size: 13px; }
[data-production-specific] { padding: 10px 12px; background: var(--soft); }
[data-production-specific][hidden] { display: none; }
.production-sku-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.production-sku-choices button { min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }
.production-sku-choices button[aria-pressed="true"] { background: var(--solid); color: var(--on); border-color: var(--solid); }
.production-photo-source { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.production-photo-source span:last-child { padding: 4px 8px; border-radius: 8px; background: var(--soft); color: var(--sub); font-size: 13px; }
.production-photo-switch { margin-bottom: 10px; }
.production-saved-photos summary { min-height: 44px; display: list-item; padding: 10px 0; color: var(--sub); cursor: pointer; }
.production-sku-photos { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.production-sku-thumbnail { position: relative; }
.production-sku-thumbnail button:first-child { display: block; padding: 0; overflow: hidden; background: var(--soft); }
.production-sku-thumbnail img { display: block; width: 72px; height: 72px; object-fit: contain; }
[data-photo-sort-handle] { display: block; cursor: grab; touch-action: none; user-select: none; -webkit-touch-callout: none; }
[data-photo-sort-handle] img { -webkit-user-drag: none; }
[data-photo-sort-handle]:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 10px; }
[data-photo-sort-active] { opacity: .4; }
[data-photo-sort-target] { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 10px; }
.photo-sort-ghost { position: fixed; inset: 0 auto auto 0; z-index: 100; display: block; border-radius: 10px; object-fit: contain; background: var(--paper); opacity: .9; pointer-events: none; }
.photo-sort-hint { font-size: 13px; }
.production-sku-thumbnail .remove-product-image { position: absolute; inset: 2px 2px auto auto; min-height: 28px; min-width: 28px; padding: 0; background: var(--paper); color: var(--ink); }
.production-sku-upload { position: relative; display: inline-flex; width: fit-content; min-height: 44px; align-items: center; padding: 7px 15px; border: 1px dashed var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; }
.production-sku-upload:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.production-sku-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
[data-production-upload-status]:empty { display: none; }
.production-photo-preview { width: min(92vw,640px); max-height: 92dvh; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); }
.production-photo-preview::backdrop { background: #0008; }
.production-photo-stage { position: relative; margin-top: 8px; touch-action: pan-y pinch-zoom; user-select: none; }
.production-photo-stage img { display: block; width: 100%; max-height: 75dvh; object-fit: contain; }
.production-photo-stage:has(.production-photo-arrow) img { height: min(75dvh,calc(92dvh - 108px)); }
.production-photo-preview .production-photo-arrow { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; font-size: 30px; line-height: 1; border-radius: 50%; background: var(--paper); }
.production-photo-arrow[data-photo-prev] { inset-inline-start: 6px; }
.production-photo-arrow[data-photo-next] { inset-inline-end: 6px; }
.production-photo-arrow:disabled { opacity: .55; }
.production-photo-position { margin: 8px 0 0; text-align: center; color: var(--sub); font-variant-numeric: tabular-nums; }
@media(max-width:680px) {
  .production-attributes { grid-template-columns: minmax(0,1fr); }
  .production-spec-row { gap: 6px; padding-inline: 8px; }
  .production-spec-source button { padding-inline: 6px; }
}
.cash-detail-fields { display: grid; gap: 18px; margin: 24px 0; }
.cash-detail-fields > div { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 14px; }
.cash-detail-fields dt { color: var(--sub); }
.cash-detail-fields dd { margin: 0; overflow-wrap: anywhere; }
@media(max-width:600px) { .cash-filters { grid-template-columns: 1fr 1fr; } .cash-filters > label:first-child { grid-column: 1/-1; } .cash-totals strong { font-size: 18px; } .cash-record { gap: 10px; padding: 20px 14px; } }

.payment-method-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; margin: 12px 0; }
@media(max-width:450px){ .payment-method-row { grid-template-columns: 1fr 1fr; } .payment-method-row input { grid-column: 1/-1; } }

/* Statistics: shared dates and SKU-level trade reports. */
:root[data-theme] .report-tabs { display: flex; gap: 8px; margin: 16px 20px 20px; padding: 5px; border-radius: 16px; background: var(--soft); }
:root[data-theme] .report-tabs > a { flex: 1; text-align: center; padding: 12px 8px; background: transparent; border: 0; color: var(--sub); border-radius: 12px; }
:root[data-theme] .report-tabs > a[aria-current] { background: var(--paper); color: var(--ink); }
:root[data-theme] .report-filters { margin: 0 20px 20px; padding: 20px; background: var(--paper); border-radius: 20px; }
:root[data-theme] .report-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
:root[data-theme] .report-shortcuts button[aria-pressed="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
:root[data-theme] .report-dates { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
:root[data-theme] .report-dates label { margin: 0; min-width: 0; }
:root[data-theme] .report-dates input { min-width: 0; width: 100%; }
:root[data-theme] .report-summary { margin: 0 20px 20px; background: var(--paper); border-radius: 20px; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 18px; padding: 24px; }
:root[data-theme] .report-summary > div { display: grid; gap: 8px; min-width: 0; }
:root[data-theme] .report-summary > div + div { border-left: 1px solid var(--line); padding-left: 22px; }
:root[data-theme] .report-summary span { color: var(--sub); font-size: 13px; }
:root[data-theme] .report-summary strong { font-size: 27px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
:root[data-theme] .report-summary small { color: var(--sub); font-size: 13px; font-weight: 400; }
:root[data-theme] .panel.report-results { margin: 0 20px 20px; border-radius: 20px; padding: 22px; }
:root[data-theme] .report-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
:root[data-theme] .report-detail { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
:root[data-theme] .report-detail h3 { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
@media(max-width:650px) {
  :root[data-theme] .report-tabs { margin: 14px; }
  :root[data-theme] .report-filters, :root[data-theme] .report-summary, :root[data-theme] .panel.report-results { margin: 0 14px 18px; padding: 18px; }
  :root[data-theme] .report-dates { grid-template-columns: 1fr 1fr; }
  :root[data-theme] .report-dates > button { grid-column: 1/-1; }
  :root[data-theme] .report-summary { grid-template-columns: 1fr 1fr; gap: 12px; }
  :root[data-theme] .report-summary > div:first-child { grid-column: 1/-1; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  :root[data-theme] .report-summary > div:nth-child(2) { border: 0; padding: 0; }
  :root[data-theme] .report-summary strong { font-size: 23px; }
}

/* Profile: subaccount permissions, themes and actor records. */
:root[data-theme] .subaccount-toolbar, :root[data-theme] .subaccount-note { margin: 20px; }
:root[data-theme] .subaccount-list { margin: 0 20px 20px; }
:root[data-theme] .subaccount-row { display: flex; align-items: center; gap: 16px; padding: 24px; flex-wrap: wrap; }
:root[data-theme] .subaccount-row + .subaccount-row { border-top: 1px solid var(--line); }
:root[data-theme] .subaccount-row > .contact-avatar svg { width: 44px; height: 44px; color: var(--sub); }
:root[data-theme] .subaccount-info { flex: 1; min-width: 160px; }
:root[data-theme] .subaccount-info > strong { margin-right: 12px; }
:root[data-theme] .subaccount-info p { margin: 6px 0 0; }
:root[data-theme] .subaccount-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
:root[data-theme] .subaccount-fields > label:last-child { grid-column: 1/-1; }
:root[data-theme] .subaccount-permission-head { padding-top: 20px; border-top: 1px solid var(--line); }
:root[data-theme] .subaccount-permission-group { border: 0; border-bottom: 1px solid var(--line); padding: 14px 0 18px; margin: 12px 0; min-width: 0; }
:root[data-theme] .subaccount-permission-group legend { color: var(--sub); font-size: 13px; }
:root[data-theme] .subaccount-permission-group > div { display: flex; gap: 10px; flex-wrap: wrap; }
:root[data-theme] .subaccount-permission-group label { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0; min-height: 44px; }
:root[data-theme] .theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
:root[data-theme] .theme-option { display: grid; gap: 12px; padding: 18px; min-width: 0; }
:root[data-theme] .theme-option[aria-pressed="true"] { border: 2px solid var(--ink); }
:root[data-theme] .theme-option > span:last-child { color: var(--sub); font-size: 13px; }
:root[data-theme] .theme-swatch { min-height: 100px; display: grid; gap: 10px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); }
:root[data-theme] .theme-swatch-reference { background: #f6f6f7; }
:root[data-theme] .theme-swatch-reference i { background: #fff; border: 1px solid #e8e8ec; border-radius: 10px; }
:root[data-theme] .theme-swatch-dark { background: #19191d; }
:root[data-theme] .theme-swatch-dark i { background: #2b2b31; border: 1px solid #404047; border-radius: 10px; }
:root[data-theme] .operation-log-filter { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 14px; align-items: end; margin: 20px; }
:root[data-theme] .operation-log-filter label { min-width: 0; margin: 0; }
:root[data-theme] .operation-log-details pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-width: 100%; }
:root[data-theme] .report-detail-dialog { max-width: 960px; }
@media(max-width:650px){
  :root[data-theme] .subaccount-fields { grid-template-columns: 1fr; }
  :root[data-theme] .subaccount-row { padding: 18px; gap: 12px; }
  :root[data-theme] .subaccount-row > .actions { width: 100%; justify-content: flex-end; }
  :root[data-theme] .operation-log-filter { grid-template-columns: 1fr 1fr; margin: 16px; }
  :root[data-theme] .operation-log-filter > label:first-child, :root[data-theme] .operation-log-filter > button { grid-column: 1/-1; }
}

/* Warehouse count sheet settings, snapshot preview and downloads. */
:root[data-theme] .warehouse-stock-heading { margin-bottom: 20px; }
:root[data-theme] .warehouse-stock-heading h2 { margin: 0; }
:root[data-theme] .count-sheet-settings form { margin-top: 22px; }
:root[data-theme] .count-sheet-settings .fields { margin: 16px 0; }
:root[data-theme] .count-sheet-preview { max-width: 1100px; }
:root[data-theme] .count-sheet-preview .gd-top h2 { font-size: 18px; font-weight: 500; margin: 0; }
:root[data-theme] .count-sheet-actions { border-top: 1px solid var(--line); padding: 18px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; background: var(--paper); }
:root[data-theme] .count-sheet-actions .hint { width: 100%; text-align: right; }
:root[data-theme] .count-sheet-preview .table td:nth-last-child(-n+2) { min-height: 44px; }
@media(max-width:650px) {
 :root[data-theme] .count-sheet-actions { padding: 16px; gap: 8px; }
 :root[data-theme] .count-sheet-actions button { flex: 1; min-width: 100px; }
 :root[data-theme] .count-sheet-settings .fields { display: grid; grid-template-columns: 1fr; }
}

.policy-document-tabs .order-status-tabs { flex-wrap: wrap; }
.policy-document-tabs .order-status-tabs button { white-space: nowrap; }
.policy-document-heading { align-items: flex-start; }
.policy-document-heading h2 { margin: 0; overflow-wrap: anywhere; }
.policy-document-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
[data-policy-status]:empty { display: none; }
.piecework-order h2, .piecework-registration h2, .piecework-step h3 { margin: 0; overflow-wrap: anywhere; }
.piecework-order > div + div { margin-top: 6px; }
.piecework-groups { margin: 14px 0 4px; }
:root[data-theme] .piecework-groups .order-status-tabs { flex-wrap: wrap; }
:root[data-theme] .piecework-groups .order-status-tabs button { flex: 1 0 auto; max-width: 100%; white-space: normal; }
.piecework-step {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) auto;
  align-items: center; gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.piecework-step h3 { font-size: 15px; margin-bottom: 4px; }
.piecework-people { display: grid; gap: 4px; overflow-wrap: anywhere; }
form.piecework-step-editor { grid-column: 1/-1; padding: 12px; background: var(--soft); border-radius: 12px; }
.piecework-worker-fields { display: grid; gap: 8px; }
.piecework-worker {
  display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) auto; align-items: end; gap: 8px;
}
.piecework-worker input { min-width: 0; }
.piecework-step-editor .actions { justify-content: end; margin-top: 10px; }
.piecework-footer { margin-top: 16px; }
.piecework-footer strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.company-payroll-head h2, .company-payroll-detail h2 { margin: 0; }
.company-payroll-head .actions { align-items: center; }
.payroll-paid { text-align: end; }
.payroll-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; }
.payroll-toolbar label { min-width: 0; margin: 0; justify-self: start; }
.payroll-toolbar input { min-width: 0; max-width: 100%; }
.payroll-toolbar button { min-width: 60px; }
.payroll-summary-context {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--sub); font-size: 13px; overflow-wrap: anywhere;
}
.payroll-summary-context > :last-child { white-space: nowrap; }
.payroll-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 10px 0 0; }
.payroll-summary > div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.payroll-summary dt { color: var(--sub); font-size: 13px; }
.payroll-summary dd, .payroll-total strong { display: block; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.payroll-summary dd { margin: 2px 0 0; overflow-wrap: anywhere; }
:root[data-theme] .payroll-filters .order-status-tabs { flex-wrap: wrap; min-width: 0; }
:root[data-theme] .payroll-filters button { flex: 1 0 auto; }
:root[data-theme] .payroll-filters [data-action="payroll-department"] { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
:root[data-theme] :is(.payroll-list-row,.company-payroll-head) [data-status="待审核"] { background: light-dark(#fff2e7,#3c2d20); color: light-dark(#a36530,#edbd91); }
:root[data-theme] :is(.payroll-list-row,.company-payroll-head) :is([data-status="待发放"],[data-status="部分发放"]) { background: light-dark(#edf2ff,#253048); color: light-dark(#526d9f,#acc3ef); }
:root[data-theme] :is(.payroll-list-row,.company-payroll-head) [data-status="已发放"] { background: light-dark(#edf5f0,#26392e); color: light-dark(#528065,#aad3b9); }
.payroll-list-row {
  display: grid; grid-template-columns: minmax(78px,.8fr) minmax(0,1.6fr) max-content max-content auto;
  align-items: center; gap: 5px 12px; padding: 14px 17px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line);
}
.payroll-list-row:last-child { border-bottom: 0; }
.payroll-list-row:focus-visible { outline-offset: -3px; }
.payroll-list-row > span:not(.production-order-badge) { min-width: 0; overflow-wrap: anywhere; }
.payroll-list-row strong, .payroll-list-row small { display: block; }
.payroll-parts { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.payroll-list-money { text-align: end; font-variant-numeric: tabular-nums; }
.payroll-amount-row, .payroll-payment-history { padding: 8px 0; border-bottom: 1px solid var(--line); }
.payroll-amount-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; }
.payroll-amount-row > label { display: grid; grid-column: 1/-1; grid-template-columns: 1fr minmax(94px,130px); align-items: center; gap: 6px; }
.payroll-amount-row input { text-align: end; min-width: 0; }
.payroll-amount-row small { display: block; font-size: 12px; }
.payroll-total, .payroll-payment-actions, .payroll-pending { margin-top: 14px; }
.company-payroll-detail form[data-form="payroll-payment"] { padding: 12px; margin-top: 14px; border-radius: 12px; background: var(--soft); }
.company-payroll-detail form[data-form="payroll-payment"] h3 { margin-top: 0; }
.payroll-recipient { margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.payroll-recipient-heading { margin-bottom: 10px; }
.payroll-bank-details { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,140px),1fr)); gap: 8px 14px; margin: 0; }
.payroll-bank-details dt { color: var(--sub); font-size: 13px; }
.payroll-bank-details dd { margin: 3px 0 0; overflow-wrap: anywhere; user-select: text; }
.payroll-recipient .employee-receipt { width: min(220px,100%); padding: 8px; background: #fff; }
.payroll-piece-details { margin-top: 16px; }
.payroll-piece-details ul { list-style: none; padding: 0; margin: 8px 0 0; }
.payroll-piece-details li { padding: 8px 0; border-top: 1px solid var(--line); }
[data-payroll-error]:empty, .payroll-print { display: none; }
@media(max-width: 540px) {
  .payroll-list-row { grid-template-columns: minmax(0,1fr) max-content max-content auto; gap: 5px 7px; padding: 12px; }
  .payroll-parts { grid-column: 1/-1; grid-row: 2; }
  .payroll-list-money { grid-column: 2; grid-row: 1; }
  .payroll-list-row > .production-order-badge { grid-column: 3; grid-row: 1; }
}
@page company-payroll-detail { size: A4; margin: 14mm; }
@page company-payroll-sheet { size: A4 landscape; margin: 14mm; }
@media print {
  :root[data-theme][data-page="profile"][data-view="payroll"] {
    --base:#fff; --paper:#fff; --soft:#f5f5f5; --ink:#222; --sub:#444; --line:#bbb; color-scheme:light;
  }
  :root[data-theme] .shell:has(.payroll-print) { min-height:0; }
  :root[data-theme] main:has(> .payroll-print) > :not(.payroll-print) { display:none; }
  :root[data-theme] .payroll-print { display:block; page:company-payroll-detail; font-size:11pt; color:var(--ink); }
  :root[data-theme] .payroll-print-sheet { page:company-payroll-sheet; }
  .payroll-print h1 { font-size:19pt; margin:0 0 8pt; }
  .payroll-print h2 { font-size:13pt; break-after:avoid; }
  :root[data-theme] .payroll-print .table { overflow:visible; }
  :root[data-theme] .payroll-print table { display:table; width:100%; border-collapse:collapse; color:inherit; }
  :root[data-theme] .payroll-print table thead { display:table-header-group; }
  :root[data-theme] .payroll-print table tbody { display:table-row-group; }
  :root[data-theme] .payroll-print table tr { display:table-row; break-inside:avoid; }
  :root[data-theme] .payroll-print table :is(th,td) { display:table-cell; padding:6pt; border:1px solid var(--line); white-space:normal; text-align:left; overflow-wrap:anywhere; }
  :root[data-theme] .payroll-print table td::before { content:none; }
  :root[data-theme] .payroll-print table .cell-value { display:inline; }
}
[data-piecework-status]:empty { display: none; }
@media(max-width: 520px) {
  .piecework-step { grid-template-columns: minmax(0,1fr) auto; }
  .piecework-step > button { grid-column: 2; grid-row: 1; }
  .piecework-people { grid-column: 1/-1; }
  .piecework-worker { grid-template-columns: minmax(0,1fr) auto; }
  .piecework-worker > .inline-picker-field { grid-column: 1/-1; }
}
@page policy-document { size: A4; margin: 16mm; }
@media print {
  :root[data-page="profile"][data-view="policy-documents"]:has(.policy-document-detail) {
    color-scheme: light;
    --base: #fff; --paper: #fff; --ink: #222; --sub: #444; --line: #bbb;
  }
  :root[data-theme] .shell:has(.policy-document-detail) { min-height: 0; }
  :root[data-theme] main:has(> .policy-document-detail) > :not(.policy-document-detail) { display: none; }
  :root[data-theme] main > .policy-document-detail {
    page: policy-document;
    font-size: 11pt;
    margin: 0;
    padding: 0;
  }
  .policy-document-heading { display: block; break-after: avoid; }
  .policy-document-heading h2 { font-size: 19pt; }
}

/* 玻璃主题，模拟 iOS 26 的半透明层级、柔和高光和背景模糊。 */
:root[data-theme="glass"] {
  --paper: rgba(255,255,255,.58);
  --base: #eaf3ff;
  --ink: #17324f;
  --solid: #2e73df;
  --on: #fff;
  --soft: rgba(255,255,255,.42);
  --line: rgba(255,255,255,.78);
  --sub: #5b718b;
  color-scheme: light;
}
:root[data-theme="glass"] body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,.92), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(177,216,255,.78), transparent 36%),
    linear-gradient(135deg,#dcecff 0%,#f7fbff 48%,#d8eaff 100%);
}
:root[data-theme="glass"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 24% 72%, rgba(255,198,221,.22), transparent 24%),
    radial-gradient(circle at 78% 84%, rgba(172,237,226,.24), transparent 28%);
}
:root[data-theme="glass"] body > header,
:root[data-theme="glass"] nav,
:root[data-theme="glass"] .bottom {
  background: rgba(255,255,255,.42);
  border-color: rgba(255,255,255,.78);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}
:root[data-theme="glass"] main > .panel,
:root[data-theme="glass"] .module-card,
:root[data-theme="glass"] .tile,
:root[data-theme="glass"] .product-card,
:root[data-theme="glass"] .record-list > article,
:root[data-theme="glass"] .profile-list,
:root[data-theme="glass"] .profile-account,
:root[data-theme="glass"] .catalog-card,
:root[data-theme="glass"] .catalog-selection,
:root[data-theme="glass"] .theme-option {
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: 0 12px 32px rgba(54,102,157,.12), inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}
:root[data-theme="glass"] .module-card {
  border-radius: 999px;
}
:root[data-theme="glass"] input,
:root[data-theme="glass"] select,
:root[data-theme="glass"] textarea,
:root[data-theme="glass"] button,
:root[data-theme="glass"] .action {
  background: rgba(255,255,255,.48);
  border-color: rgba(255,255,255,.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.66);
}
:root[data-theme="glass"] input:focus,
:root[data-theme="glass"] select:focus,
:root[data-theme="glass"] textarea:focus {
  border-color: rgba(46,115,223,.58);
  box-shadow: 0 0 0 3px rgba(46,115,223,.15), inset 0 1px 0 rgba(255,255,255,.72);
}
:root[data-theme="glass"] .primary {
  background: linear-gradient(135deg,#4f9cff,#2e73df);
  border-color: rgba(255,255,255,.5);
  color: #fff;
  box-shadow: 0 8px 18px rgba(46,115,223,.24), inset 0 1px 0 rgba(255,255,255,.36);
}
:root[data-theme="glass"] dialog,
:root[data-theme="glass"] .picker,
:root[data-theme="glass"] .attribute-picker,
:root[data-theme="glass"] .delete-record-dialog {
  background: rgba(246,251,255,.78);
  border: 1px solid rgba(255,255,255,.86);
  box-shadow: 0 22px 64px rgba(36,76,120,.22), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(30px) saturate(145%);
  -webkit-backdrop-filter: blur(30px) saturate(145%);
}
:root[data-theme="glass"] dialog::backdrop {
  background: rgba(45,78,114,.22);
  backdrop-filter: blur(5px);
}
:root[data-theme="glass"] .catalog-showcase-strip,
:root[data-theme="glass"] .catalog-shared,
:root[data-theme="glass"] .catalog-rate-grid > :is(div,span) {
  background: rgba(255,255,255,.38);
}
:root[data-theme="glass"] .theme-swatch-glass {
  background: linear-gradient(135deg,#d9ecff,#ffffff 45%,#a8d5ff);
  border: 1px solid rgba(96,159,225,.35);
}
