:root { --ink: #243831; --green: #205c47; --mint: #e4eee6; --muted: #7a867d; --line: #e4e8df; --paper: #f6f7f2; --white: #fff; --orange: #a77231; }
* { box-sizing: border-box; }
body { margin: 0px; color: var(--ink); background: var(--paper); font: 14px -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
input { border: 1px solid var(--line); border-radius: 9px; background: rgb(255, 255, 255); padding: 12px; color: var(--ink); min-width: 0px; }
input:focus { outline: rgb(129, 174, 146) solid 2px; outline-offset: 1px; }
h1, h2, h3, p { margin: 0px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
small { font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.button { padding: 11px 17px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-weight: 600; }
.primary { background: var(--green); color: white; border-color: var(--green); }
.secondary { background: rgb(249, 251, 247); }
.wide { width: 100%; }
.small { padding: 7px 12px; }
.text-button { border: 0px; background: none; color: var(--muted); padding: 6px; font-size: 12px; }
.icon-button { border: 0px; background: none; font-size: 23px; color: var(--muted); padding: 3px 8px; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 212px; flex: 0 0 auto; background: rgb(237, 241, 232); border-right: 1px solid var(--line); padding: 32px 20px 20px; display: flex; flex-direction: column; position: sticky; top: 0px; height: 100vh; }
.wordmark { font-size: 30px; font-weight: 800; letter-spacing: 3px; }
.wordmark span { display: block; font-size: 8px; letter-spacing: 2px; font-weight: 500; color: var(--muted); margin-top: 7px; }
.nav-caption { margin: 44px 12px 14px; font-size: 10px; letter-spacing: 2px; color: var(--muted); }
nav { display: grid; gap: 9px; }
.nav-item { background: none; border: 0px; text-align: left; padding: 14px 13px; border-radius: 10px; color: rgb(107, 120, 110); }
.nav-item.active { background: var(--green); color: rgb(255, 255, 255); box-shadow: rgba(32, 92, 71, 0.07) 0px 6px 14px; }
.sidebar-note { margin-top: auto; font-size: 12px; color: rgb(83, 107, 91); padding: 25px 10px; }
.sidebar-note p { font-size: 11px; color: var(--muted); margin-top: 8px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: rgb(92, 148, 112); }
.profile { border-top: 1px solid rgb(220, 227, 213); display: flex; gap: 10px; align-items: center; padding-top: 20px; }
.profile small { display: block; color: var(--muted); margin-top: 5px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: rgb(223, 231, 215); display: grid; place-items: center; }
.profile .text-button { margin-left: auto; }
.workspace { flex: 1 1 0%; min-width: 0px; }
.topbar { height: 106px; border-bottom: 1px solid var(--line); padding: 24px 32px; display: flex; justify-content: space-between; align-items: center; }
.breadcrumb { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.topbar h1 { font-size: 25px; letter-spacing: 1px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.date { color: var(--muted); font-size: 12px; }
.pill { background: rgb(233, 238, 228); border-radius: 6px; padding: 6px 9px; color: rgb(100, 116, 89); font-size: 11px; white-space: nowrap; }
.quote-main { display: grid; grid-template-columns: minmax(400px, 1fr) 340px; gap: 26px; padding: 28px 30px; align-items: start; }
.scan-box { display: flex; align-items: center; padding: 8px; background: rgb(255, 255, 255); border: 1px solid rgb(199, 214, 200); border-radius: 12px; gap: 10px; box-shadow: rgba(36, 56, 49, 0.016) 0px 4px 15px; }
.scan-icon { font-size: 29px; padding: 0px 9px; color: var(--green); }
.scan-box input { border: 0px; flex: 1 1 0%; background: transparent; padding: 11px 0px; }
.scan-box input:focus { outline: none; }
.scan-box:focus-within { outline: rgb(129, 174, 146) solid 2px; }
.catalog-head { display: flex; justify-content: space-between; align-items: center; margin: 30px 0px 20px; gap: 15px; }
.catalog-head p { margin-top: 6px; }
.search { width: 220px; background: rgb(255, 255, 255); padding: 10px 12px; font-size: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter { border: 1px solid transparent; border-radius: 7px; background: none; padding: 8px 14px; color: var(--muted); }
.filter.selected { background: rgb(227, 236, 223); color: var(--green); font-weight: 600; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0px, 1fr)); gap: 15px; }
.product-card { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: rgb(255, 255, 255); padding: 12px; transition: transform 0.15s, border-color 0.15s; }
.product-card:disabled { opacity: 1; color: var(--ink); }
.product-card:disabled:hover { transform: none; border-color: var(--line); }
.product-card:hover { border-color: rgb(130, 168, 145); transform: translateY(-2px); }
.product-art { height: 98px; flex: none; min-width: 0; overflow: hidden; border-radius: 7px; display: grid; place-items: center; font-size: 47px; color: rgb(105, 130, 105); letter-spacing: 0px; background: rgb(237, 241, 231); }
.art-1 { background: rgb(234, 240, 239); color: rgb(109, 146, 147); }
.art-2 { background: rgb(243, 236, 223); color: rgb(172, 152, 113); }
.art-3 { background: rgb(237, 231, 223); color: rgb(155, 124, 98); }
.product-category { display: block; color: var(--muted); font-size: 10px; margin: 13px 0px 7px; }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 18px; gap: 8px; }
.product-meta strong { font-size: 17px; color: var(--green); }
.product-meta span { font-size: 13px; font-weight: 600; color: var(--ink); }
.product-card:disabled .product-meta span { color: #88431e; background: #fff1e6; border-radius: 5px; padding: 4px 6px; }
.footnote { font-size: 11px; color: var(--muted); line-height: 1.8; margin-top: 16px; }
.basket { background: rgb(255, 255, 255); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-height: 610px; position: sticky; top: 25px; }
.basket-head { display: flex; align-items: center; gap: 12px; padding: 23px 20px; border-bottom: 1px solid var(--line); }
.basket-head .text-button { margin-left: auto; }
.cart-rows { padding: 0px 20px; min-height: 295px; max-height: 430px; overflow: auto; }
.cart-empty { padding: 73px 0px; text-align: center; color: var(--muted); }
.cart-empty > span { font-size: 49px; color: rgb(197, 208, 189); }
.cart-empty h3 { font-size: 14px; margin: 16px 0px 8px; color: rgb(97, 113, 95); }
.cart-empty p { font-size: 11px; }
.cart-row { padding: 18px 0px; border-bottom: 1px solid var(--line); }
.cart-row-head, .cart-row-bottom { display: flex; align-items: center; justify-content: space-between; }
.cart-row-head { margin-bottom: 5px; }
.cart-row-bottom { margin-top: 13px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button { width: 27px; height: 26px; border: 0px; background: rgb(247, 249, 244); color: var(--green); }
.stepper span { width: 32px; text-align: center; font-size: 12px; }
.basket-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 23px 20px; }
.total { display: flex; align-items: baseline; justify-content: space-between; }
.total > span { font-size: 13px; color: rgb(115, 129, 109); }
.total strong { font-size: 34px; letter-spacing: -1px; }
.total small { font-size: 17px; }
.payment-note { font-size: 11px; color: var(--muted); margin: 16px 0px; line-height: 1.7; }
.checkout { width: 100%; padding: 15px; font-size: 15px; }
.page-main { padding: 28px 32px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 16px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px 0; }
.stat { min-width: 0; padding: 0 16px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat p { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 26px; display: block; margin: 4px 0px; color: var(--green); }
.stat small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.panel { background: rgb(255, 255, 255); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.section-head { padding: 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.section-head > div { margin-right: auto; }
.section-head p { margin-top: 7px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
th { color: var(--muted); font-weight: 500; background: rgb(248, 250, 245); padding: 14px 20px; white-space: nowrap; }
td { padding: 17px 20px; border-top: 1px solid rgb(238, 241, 233); vertical-align: middle; }
.cell-sub { display: block; color: var(--muted); margin-top: 5px; }
.mono { font-variant-numeric: tabular-nums; }
.stock-badge, .record-badge { padding: 5px 8px; border-radius: 5px; background: rgb(237, 244, 233); color: rgb(83, 131, 92); white-space: nowrap; }
.stock-badge.low { background: rgb(255, 241, 222); color: var(--orange); }
.record-badge.out { background: rgb(245, 238, 228); color: rgb(154, 117, 61); }
.record-item { line-height: 1.8; white-space: nowrap; }
.empty { padding: 45px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; padding: 8vh 9vw; gap: 9vw; align-items: center; background: radial-gradient(ellipse at 15% 70%,#e5ecda,transparent 60%),var(--paper); }
.login-intro .wordmark { margin-bottom: 85px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--green); margin-bottom: 20px; }
.login-intro h1 { font-size: 52px; white-space: pre-line; line-height: 1.4; letter-spacing: 2px; }
.lead { white-space: pre-line; color: var(--muted); line-height: 2; margin-top: 23px; }
.login-chips { display: flex; gap: 14px; margin-top: 45px; }
.login-chips span { font-size: 12px; border: 1px solid rgb(217, 226, 209); padding: 8px 14px; border-radius: 30px; }
.login-card { background: rgb(255, 255, 255); padding: 42px; border: 1px solid var(--line); border-radius: 18px; box-shadow: rgba(36, 56, 49, 0.03) 0px 20px 80px; max-width: 430px; }
.login-card h2 { font-size: 25px; margin-bottom: 12px; }
.login-card > .muted { margin-bottom: 26px; }
label { display: grid; gap: 8px; margin: 18px 0px; font-size: 12px; color: rgb(99, 113, 95); }
.error { font-size: 12px; color: rgb(172, 76, 57); min-height: 18px; line-height: 1.7; margin: 10px 0px; }
dialog { border: 1px solid var(--line); border-radius: 15px; padding: 0px; width: min(440px, -30px + 100vw); color: var(--ink); box-shadow: rgba(0, 0, 0, 0.133) 0px 30px 100px; }
dialog::backdrop { background: rgba(32, 52, 40, 0.333); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 25px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 22px 25px; }
.dialog-body > p { line-height: 1.9; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 25px; }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); padding: 13px 22px; background: rgb(37, 62, 50); color: rgb(255, 255, 255); border-radius: 10px; box-shadow: rgba(0, 0, 0, 0.133) 0px 8px 25px; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 10; max-width: 90vw; line-height: 1.7; }
#toast.show { opacity: 1; }
@media (min-width: 1500px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0px, 1fr)); }
  .product-art { height: 120px; }
  .quote-main { grid-template-columns: minmax(400px, 1fr) 380px; }
}
@media (max-width: 1150px) {
  .sidebar { width: 176px; padding: 28px 15px; }
  .quote-main { gap: 18px; padding: 22px; grid-template-columns: minmax(300px, 1fr) 310px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0px, 1fr)); }
  .catalog-head { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
  .topbar { padding: 22px; }
  .date { display: none; }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sidebar { height: auto; width: 100%; position: static; padding: 15px 20px; flex-direction: row; align-items: center; gap: 25px; }
  .sidebar .wordmark { font-size: 23px; }
  .sidebar .wordmark span, .nav-caption, .sidebar-note, .profile { display: none; }
  nav { display: flex; gap: 5px; }
  .nav-item { font-size: 12px; padding: 10px; }
  .topbar { height: 90px; }
  .quote-main { display: flex; flex-direction: column; }
  .catalog, .basket { width: 100%; }
  .basket { min-height: 430px; position: static; }
  .product-grid { grid-template-columns: repeat(3, minmax(0px, 1fr)); }
  .catalog-head { flex-direction: row; align-items: center; }
  .catalog-head .search { width: 180px; }
  .page-main { padding: 20px; }
  .stats { gap: 0; }
  .stat { padding: 0 12px; }
  .stat strong { font-size: 23px; }
  .stat small { font-size: 10px; }
  .login { display: flex; flex-direction: column; padding: 40px 25px; gap: 35px; }
  .login-intro .wordmark { margin-bottom: 35px; }
  .login-intro h1 { font-size: 36px; }
  .login-card { padding: 30px; width: 100%; }
  .login-chips { margin-top: 22px; }
}
@media (max-width: 500px) {
  .sidebar { gap: 15px; padding: 14px; }
  .nav-item { padding: 9px 6px; font-size: 11px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0px, 1fr)); }
  .scan-box .button { padding: 10px; font-size: 12px; }
  .scan-box input { font-size: 12px; }
  .scan-icon { padding: 0px 3px; }
  .quote-main { padding: 18px; }
  .catalog-head { flex-direction: column; align-items: stretch; }
  .catalog-head .search { width: 100%; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
  .stat { padding: 0 10px; }
  .stat strong { margin: 4px 0px; }
  .topbar h1 { font-size: 22px; }
}
select { font: inherit; border: 1px solid var(--line); border-radius: 9px; background: rgb(255, 255, 255); padding: 10px 12px; color: var(--ink); }
select:focus { outline: rgb(129, 174, 146) solid 2px; outline-offset: 1px; }
.row-actions { display: flex; gap: 8px; white-space: nowrap; }
.record-filters { display: flex; gap: 12px; padding: 0px 24px 16px; flex-wrap: wrap; }
.record-filters .search { flex: 1 1 0%; min-width: 210px; }
.record-filters input[type="date"] { font-size: 12px; padding: 10px 12px; }
.record-count { padding: 0px 24px 16px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.record-dialog { width: min(760px, -30px + 100vw); }
.document-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 24px; }
.document-meta small { display: block; color: var(--muted); margin-bottom: 8px; }
.document-meta strong { font-size: 12px; overflow-wrap: anywhere; line-height: 1.7; }
.document-foot { padding: 20px 24px; }
.document-detail td { white-space: nowrap; }
.document-detail .footnote { margin-top: 8px; }
@media (max-width: 500px) {
  .record-filters { padding: 0px 15px 15px; gap: 8px; }
  .record-filters .search { width: 100%; min-width: 0px; flex-basis: 100%; }
  .record-count { padding: 0px 15px 15px; }
  .document-meta { grid-template-columns: 1fr; padding: 20px; gap: 15px; }
}
.cost-stats { grid-template-columns: repeat(4, minmax(0px, 1fr)); }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
@media (max-width: 1150px) {
  .cost-stats { grid-template-columns: repeat(2, minmax(0px, 1fr)); }
}
@media (max-width: 500px) {
  .cost-stats { grid-template-columns: 1fr; }
}
.nav-item { display: flex; align-items: center; gap: 12px; }
.nav-icon { font-size: 17px; }
.nav-label { white-space: nowrap; }
@media (max-width: 800px) {
  .layout { position: relative; padding-bottom: calc(82px + env(safe-area-inset-bottom,0px)); }
  .sidebar { display: contents; }
  .sidebar > .wordmark, .sidebar > .nav-caption, .sidebar > .sidebar-note { display: none; }
  .sidebar > nav { position: fixed; left: 0px; right: 0px; bottom: 0px; z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0px, 1fr)); gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom,0px)); border-top: 1px solid var(--line); background: rgb(255, 255, 255); box-shadow: rgba(36, 56, 49, 0.03) 0px -4px 20px; }
  .sidebar .nav-item { min-height: 58px; padding: 7px 4px; display: flex; flex-direction: column; justify-content: center; gap: 5px; font-size: 12px; text-align: center; border-radius: 10px; }
  .sidebar .nav-icon { font-size: 22px; line-height: 24px; }
  .sidebar .nav-item.active { background: var(--mint); color: var(--green); box-shadow: none; font-weight: 700; }
  .sidebar > .profile { display: flex; position: absolute; right: 16px; top: 18px; border: 0px; padding: 0px; gap: 8px; font-size: 12px; }
  .profile .avatar { display: none; }
  .profile small { font-size: 10px; margin-top: 3px; }
  .profile .text-button { min-height: 44px; padding: 8px; }
  .topbar { padding: 18px 16px; height: 90px; }
  .topbar > div:first-child { max-width: calc(100% - 120px); }
  .breadcrumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { display: none; }
  #toast { bottom: calc(92px + env(safe-area-inset-bottom,0px)); }
  .scan-box input { font-size: 16px; }
  input, select { font-size: 16px; }
}
@media (max-width: 800px) {
  .table-wrap table { min-width: 640px; }
  .table-wrap td:first-child { min-width: 110px; }
  .table-wrap { overscroll-behavior-x: contain; }
}
.account-main { max-width: 760px; }
.account-card { padding: 24px; }
.account-heading { display: flex; gap: 16px; align-items: center; }
.account-heading h2 { font-size: 23px; margin-bottom: 5px; }
.account-avatar { width: 58px; height: 58px; border-radius: 16px; background: var(--mint); color: var(--green); display: grid; place-items: center; font-size: 25px; font-weight: 700; }
.account-details { margin: 24px 0px 0px; }
.account-details > div { display: flex; justify-content: space-between; gap: 20px; padding: 17px 0px; border-top: 1px solid var(--line); }
.account-details dt { color: var(--muted); }
.account-details dd { margin: 0px; text-align: right; overflow-wrap: anywhere; }
.account-note { margin-top: 14px; }
.account-actions { padding: 24px; margin-top: 20px; }
.account-actions p { margin: 12px 0px 20px; }
.account-actions > .button.wide + .button.wide { margin-top: 12px; }
@media (max-width: 500px) {
  .account-card, .account-actions { padding: 20px; }
  .sidebar .nav-item { font-size: 11px; }
}
.camera-dialog { width: min(520px, -24px + 100vw); }
.camera-dialog video { max-width: 100%; border-radius: 10px; }
.camera-dialog .dialog-body { padding: 16px; }
.camera-dialog [role="status"] { margin-top: 14px; }
.trace-panel { margin-top: 24px; }
.trace-code { max-width: 380px; overflow-wrap: anywhere; }
textarea { width: 100%; padding: 12px; margin: 12px 0px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font: inherit; resize: vertical; }
/* Only vertical full-width siblings need spacing; horizontal groups use gap. */
.dialog-body > .button.wide + .button.wide { margin-top: 12px; }
.scan-modes { display: grid; grid-template-columns: repeat(3, minmax(0px, 1fr)); background: rgb(237, 242, 235); padding: 4px; border-radius: 10px; gap: 4px; margin-bottom: 16px; }
.scan-modes button { border: 0px; background: transparent; color: var(--muted); border-radius: 8px; min-height: 44px; font-weight: 600; }
.scan-modes button[aria-selected="true"] { background: white; color: var(--green); box-shadow: rgba(36, 56, 49, 0.063) 0px 2px 7px; }
.scan-modes button:focus-visible { outline: rgb(129, 174, 146) solid 2px; }
.camera-stage { position: relative; overflow: hidden; border-radius: 12px; background: rgb(28, 41, 36); min-height: 180px; }
.camera-stage video { display: block; border-radius: 0px; }
.camera-stage #qr-shaded-region { opacity: 0; }
.scan-aim { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 0px 1000px; }
.camera-stage.ready .scan-aim { display: block; }
.aim-corner { position: absolute; width: 22px; height: 22px; border: 3px solid rgb(88, 219, 148); }
.corner-0 { left: 0px; top: 0px; border-right: 0px; border-bottom: 0px; }
.corner-1 { right: 0px; top: 0px; border-left: 0px; border-bottom: 0px; }
.corner-2 { left: 0px; bottom: 0px; border-right: 0px; border-top: 0px; }
.corner-3 { right: 0px; bottom: 0px; border-left: 0px; border-top: 0px; }
.scan-line { position: absolute; left: 5%; right: 5%; top: 10%; height: 2px; background: rgb(88, 219, 148); box-shadow: rgb(88, 219, 148) 0px 0px 9px; animation: 2s ease-in-out 0s infinite alternate none running scan-sweep; }
.scan-success .scan-line { animation: auto ease 0s 1 normal none running none; top: 50%; }
.scan-hint.success { color: var(--green); font-weight: 700; }
@keyframes scan-sweep { 
  0% { top: 10%; }
  100% { top: 90%; }
}
@media (prefers-reduced-motion: reduce) {
  .scan-line { animation: auto ease 0s 1 normal none running none; top: 50%; }
}
.product-art img{display:block;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;object-fit:contain;border-radius:7px}.stock-product{display:flex;align-items:center;gap:10px}.stock-image{width:44px;height:44px;flex:none;background:#edf1e7;border-radius:6px;display:grid;place-items:center;color:#698269}.stock-image img{width:100%;height:100%;object-fit:contain}.product-image-preview:not([hidden]){display:flex;justify-content:center;background:#f8faf5;border:1px solid var(--line);border-radius:10px;padding:12px}.product-image-preview img{width:110px;height:110px;object-fit:contain}

.catalog-detail-preview:not([hidden]){padding:12px 14px;background:#f8faf5;border-radius:9px;font-size:12px;color:var(--muted);line-height:1.9;overflow-wrap:anywhere}.product-detail .product-art{height:160px}.product-detail h3{margin:18px 0}.product-detail-fields{margin:0}.product-detail-fields>div{display:flex;gap:15px;padding:12px 0;border-top:1px solid var(--line)}.product-detail-fields dt{flex:none;width:80px;color:var(--muted)}.product-detail-fields dd{margin:0;overflow-wrap:anywhere;line-height:1.6}

.receipt-panel { margin-bottom: 16px; display: grid; gap: 8px; }
.receipt-panel textarea { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #ccd8cd; border-radius: 8px; font: inherit; resize: vertical; }
.receipt-panel p { margin: 0; overflow-wrap: anywhere; }
.receipt-supplements { display: grid; gap: 12px; }
.receipt-supplements[hidden] { display: none; }

.receipt-actions { display: flex; gap: 8px; align-items: stretch; }
.receipt-actions .button { flex: 1 1 0; min-width: 0; width: auto; padding: 8px; min-height: 40px; font-size: 12px; margin: 0; white-space: normal; overflow-wrap: anywhere; }
.dialog-body .receipt-actions .button + .button { margin-top: 0; }
.receipt-editor textarea { margin: 8px 0; }
.receipt-editor[hidden] { display: none; }
.receipt-editor .button { margin: 0; width: auto; }
.receipt-panel p:empty { display: none; }

.receipt-import-list { display: grid; gap: 16px; margin: 16px 0; }
.receipt-import-row { padding: 14px; border: 1px solid #ccd8cd; border-radius: 10px; }
.receipt-row-head,.receipt-barcode { display: flex; gap: 8px; align-items: center; }
.receipt-row-head select,.receipt-barcode label { flex: 1; min-width: 0; }
.receipt-row-head button,.receipt-barcode button { flex: none; }
.receipt-row-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.receipt-row-fields label { min-width: 0; }
.receipt-import-row input,.receipt-import-row textarea { width: 100%; box-sizing: border-box; }
.receipt-import-row .muted,.receipt-row-cost { font-size: 13px; line-height: 1.6; }
.receipt-row-cost { color: #205b45; }
.receipt-source { white-space: pre-wrap; font: inherit; font-size: 12px; max-height: 180px; overflow: auto; }

.image-tools { margin: 12px 0; }
.image-tools .muted { font-size: 13px; margin: 8px 0; }
.image-candidates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.image-choice { display: flex; flex-direction: column; gap: 6px; padding: 10px; white-space: normal; font-size: 13px; }
.image-choice img { width: 100%; height: 120px; object-fit: contain; background: white; }
.image-choice small { font-size: 11px; color: var(--muted); }

.supplier-section { padding: 18px; margin-bottom: 14px; }
.supplier-section h2 { font-size: 18px; margin-bottom: 12px; }
.supplier-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 12px 0; }
.supplier-filters label { min-width: 0; font-size: 12px; }
.supplier-filters input,.supplier-filters select { width: 100%; min-width: 0; box-sizing: border-box; margin-top: 5px; }
.supplier-card { border-top: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere; }
.supplier-card p { margin: 6px 0; font-size: 13px; }
.supplier-card small { color: var(--muted); font-size: 11px; }
.supplier-price-row { margin-top: 10px; padding-left: 10px; border-left: 2px solid var(--line); }
.supplier-pagination { display: flex; gap: 10px; margin-top: 12px; }
.supplier-page .stat strong { font-size: 20px; overflow-wrap: anywhere; }
.supplier-section .section-head { padding: 0; margin-bottom: 12px; gap: 12px; }
.supplier-filters label { margin: 0; gap: 4px; }
.supplier-filters input,.supplier-filters select { margin-top: 0; }
.supplier-query .supplier-filters { gap: 16px 12px; margin: 18px 0 20px; }
.supplier-query > .button { margin-bottom: 16px; }
.supplier-query > .supplier-query-status { margin: 0; line-height: 1.8; }
.supplier-query { padding-bottom: 22px; }
.supplier-page .stat:last-child strong { font-size: 16px; }
.camera-stage[data-mode="trace"] .scan-aim { transition: width 120ms ease, height 120ms ease; }
@media (prefers-reduced-motion: reduce) { .camera-stage[data-mode="trace"] .scan-aim { transition: none; } }

/* Keep trace and date capture aligned and compact in the inbound form. */
.inbound-code-panel,.date-ocr-panel { display: grid; gap: 12px; margin: 16px 0; min-width: 0; }
.inbound-code-panel input,.date-ocr-fields input { box-sizing: border-box; width: 100%; min-width: 0; }
.date-ocr-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.date-ocr-fields label { margin: 0; min-width: 0; }
.inbound-code-panel p,.date-ocr-panel p { margin: 0; overflow-wrap: anywhere; }
.inbound-code-panel p:empty,.date-ocr-panel p:empty { display: none; }
.date-ocr-panel .button + .button { margin: 0 8px 8px 0; }

/* Record metrics stay compact on the phone preview. */
.records-stats { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 0; overflow: hidden; }
.records-stats .stat { padding: 14px 16px; border: 0; }
.records-stats .stat:nth-child(odd) { border-right: 1px solid var(--line); }
.records-stats .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.records-stats .stat p { margin: 0; font-size: 12px; line-height: 1.5; }
.records-stats .stat strong { font-size: 24px; line-height: 1.3; margin: 5px 0; overflow-wrap: anywhere; }
.records-stats .stat small { font-size: 10px; line-height: 1.5; }
@media (min-width: 900px) {
  .records-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .records-stats.cost-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .records-stats .stat:nth-child(n) { border-top: 0; border-right: 1px solid var(--line); }
  .records-stats .stat:last-child { border-right: 0; }
}

/* Store workspace: quiet surfaces, compact lists, and familiar controls. */
:root { --ink: #242b36; --green: #2459a6; --mint: #eef3fb; --muted: #737b87; --line: #e6e9ee; --paper: #f3f4f6; --orange: #a95a20; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1,h2,h3 { letter-spacing: 0; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.ui-icon { display: block; width: 22px; height: 22px; flex: none; }
button { -webkit-tap-highlight-color: transparent; }
input,select,textarea { border-radius: 6px; border-color: #dfe3e9; padding: 10px 12px; background: white; }
input:focus,select:focus,textarea:focus { outline: 2px solid #9ebceb; outline-offset: 1px; }
button:focus-visible { outline: 2px solid #9ebceb; outline-offset: 2px; }
.button { border-radius: 6px; padding: 9px 14px; font-weight: 500; min-height: 38px; box-shadow: none; }
.button.primary { border-color: var(--green); background: var(--green); color: white; }
.button.secondary { background: white; color: #3a4452; border-color: #dfe3e9; }
.button.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.text-button { color: #607187; }
.muted { font-size: 12px; line-height: 1.6; }
.pill { background: #f0f2f5; color: #647081; border-radius: 4px; padding: 3px 7px; }
.sidebar { width: 184px; padding: 24px 14px 16px; background: white; }
.wordmark { font-size: 24px; letter-spacing: 0; font-weight: 650; }
.wordmark span { font-size: 11px; letter-spacing: 0; margin-top: 3px; }
.nav-caption { margin: 28px 10px 10px; letter-spacing: 0; font-size: 11px; }
nav { gap: 4px; }
.nav-item { padding: 12px; border-radius: 6px; color: #667182; }
.nav-item.active { background: var(--mint); color: var(--green); box-shadow: none; font-weight: 600; }
.nav-icon { display: inline-flex; }
.sidebar-note { padding: 20px 10px; color: var(--muted); }
.profile { border-color: var(--line); padding-top: 14px; }
.avatar { border-radius: 6px; background: #eef1f5; color: #566477; }
.topbar { height: 76px; padding: 14px 24px; background: white; }
.topbar h1 { font-size: 20px; letter-spacing: 0; font-weight: 600; }
.breadcrumb { margin-bottom: 2px; font-size: 11px; }
.quote-main { padding: 20px 24px; grid-template-columns: minmax(300px,1fr) 320px; gap: 20px; }
.page-main { padding: 20px 24px; }
.scan-box { padding: 5px 6px 5px 10px; border-radius: 8px; border-color: #dbe1e9; gap: 8px; box-shadow: none; }
.scan-box:focus-within { outline: 2px solid #9ebceb; }
.scan-icon { padding: 0; color: #72829a; }
.scan-box input { font-size: 14px; padding: 10px 0; }
.catalog-head { margin: 18px 0 12px; gap: 12px; }
.catalog-head p { margin-top: 3px; font-size: 11px; }
.search { font-size: 13px; }
.filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; margin-bottom: 12px; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; padding: 6px 11px; border-radius: 5px; font-size: 12px; background: #e9ecf0; color: #657080; }
.filter.selected { background: #e4ecfa; color: var(--green); }
.product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.product-card { display: grid; grid-template-columns: 66px minmax(0,1fr); grid-template-rows: auto auto 1fr; column-gap: 12px; row-gap: 3px; padding: 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; transition: background 120ms; min-width: 0; }
.product-card:nth-child(odd) { border-right: 1px solid var(--line); }
.product-card:hover { transform: none; background: #f8fafc; }
.product-card .product-art { grid-column: 1; grid-row: 1 / 4; width: 66px; height: 76px; background: #f5f6f8; color: #adb5c0; border-radius: 5px; }
.product-art .ui-icon { width: 28px; height: 28px; }
.product-card .product-category { grid-column: 2; margin: 0; font-size: 10px; }
.product-card h3 { grid-column: 2; line-height: 1.5; overflow-wrap: anywhere; }
.product-card .product-meta { grid-column: 2; padding-top: 4px; margin-top: 0; gap: 4px; align-self: end; }
.product-meta strong { font-size: 16px; color: var(--ink); }
.product-meta span { font-size: 11px; color: #737b87; font-weight: 400; }
.product-card:disabled { background: #fafafa; }
.product-card:disabled .product-meta span { font-size: 10px; padding: 2px 5px; color: #a95a20; background: #fff3e7; }
.product-art img { border-radius: 4px; }
.stock-image { background: #f5f6f8; color: #adb5c0; width: 48px; height: 48px; }
.stock-image .ui-icon { width: 23px; height: 23px; }
.catalog > .footnote { font-size: 10px; margin-top: 9px; }
.basket { border-radius: 8px; min-height: 320px; top: 16px; box-shadow: none; }
.basket-head { padding: 14px 16px; gap: 8px; }
.cart-rows { min-height: 140px; max-height: 350px; padding: 0 16px; }
.cart-empty { padding: 36px 0; }
.cart-empty h3 { margin: 0 0 5px; color: #667182; font-weight: 400; }
.cart-row { padding: 13px 0; }
.cart-row-head strong { font-size: 13px; }
.cart-row-bottom { margin-top: 8px; }
.stepper { border-radius: 4px; }
.stepper button { background: #f5f6f8; color: #41516b; width: 32px; height: 30px; }
.basket-footer { padding: 14px 16px; }
.total strong { font-size: 28px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.total > span { color: var(--muted); }
.payment-note { margin: 8px 0 12px; }
.checkout { padding: 10px; font-size: 14px; }
.basket .footnote { margin-top: 8px; font-size: 10px; line-height: 1.6; }
.panel,.stats { border-radius: 8px; border-color: var(--line); box-shadow: none; }
.stats { padding: 12px 0; }
.stat { padding: 0 14px; }
.stat strong { color: var(--ink); font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat p { font-size: 11px; }
.stat small { font-size: 10px; }
.records-stats { padding: 0; }
.records-stats .stat { padding: 12px 14px; }
.records-stats .stat strong { font-size: 23px; color: var(--ink); }
.section-head { padding: 16px; gap: 10px; }
.section-head p { margin-top: 3px; font-size: 11px; }
th { background: #f8f9fb; color: #7b8390; padding: 11px 16px; }
td { padding: 13px 16px; border-color: var(--line); }
.cell-sub { font-size: 11px; margin-top: 3px; }
.stock-badge,.record-badge { background: #eff3f9; color: #48668b; border-radius: 4px; padding: 3px 7px; font-size: 11px; }
.stock-badge.low { color: #a95a20; background: #fff3e7; }
.record-badge.out { background: #f2f3f5; color: #606977; }
.record-item { white-space: normal; overflow-wrap: anywhere; line-height: 1.7; }
.record-filters { padding: 0 16px 12px; gap: 8px; }
.record-count { padding: 0 16px 12px; font-size: 10px; }
.empty { padding: 30px 16px; font-size: 12px; }
.trace-panel { margin-top: 16px; }
.login { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; gap: 20px; background: var(--paper); }
.login-intro { text-align: center; }
.login-intro .wordmark { margin: 0; font-size: 26px; }
.login-intro .lead { margin: 5px 0 0; font-size: 12px; }
.login-card { width: 100%; max-width: 370px; padding: 26px; border-radius: 8px; box-shadow: none; }
.login-card h2 { font-size: 18px; margin-bottom: 6px; }
.login-card > .muted { font-size: 11px; margin-bottom: 18px; }
label { margin: 14px 0; gap: 6px; color: #626c7a; font-size: 12px; }
.error:empty { min-height: 0; margin: 0; }
dialog { border-radius: 10px; border: 0; width: min(460px,calc(100vw - 24px)); box-shadow: 0 10px 40px #17233a26; }
dialog::backdrop { background: #1c26375c; }
.dialog-head { padding: 15px 18px; background: white; position: sticky; top: 0; z-index: 2; }
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 16px 18px; }
.dialog-body input,.dialog-body select { width: 100%; min-height: 42px; }
.dialog-body > p { font-size: 12px; line-height: 1.6; }
.dialog-actions { margin-top: 18px; gap: 8px; }
.document-meta { padding: 18px; gap: 12px; }
.document-meta strong { font-weight: 500; }
.document-foot { padding: 16px 18px; }
.record-dialog { width: min(760px,calc(100vw - 24px)); }
.account-main { max-width: 760px; }
.account-card { padding: 18px; }
.account-heading { gap: 12px; }
.account-heading h2 { font-size: 18px; margin-bottom: 2px; }
.account-avatar { width: 44px; height: 44px; border-radius: 8px; background: #eef2f8; color: #587097; font-size: 20px; }
.account-details { margin-top: 18px; font-size: 13px; }
.account-details > div { padding: 12px 0; }
.account-note { font-size: 11px; margin-top: 10px; }
.account-actions { padding: 16px 18px; margin-top: 14px; }
.account-actions p { font-size: 11px; margin: 8px 0 14px; }
.account-actions > .button { text-align: left; }
.account-actions > .button::after { content: '›'; float: right; color: currentColor; }
.account-actions > .primary { color: #3a4452; border-color: var(--line); background: white; }
.account-actions > h2 { margin-bottom: 12px; }
.supplier-section { padding: 16px; margin-bottom: 12px; }
.supplier-section h2 { font-size: 16px; margin-bottom: 8px; }
.supplier-card { padding: 12px 0; }
.supplier-price-row { border-color: #dce4ef; }
.catalog-detail-preview:not([hidden]),.product-image-preview:not([hidden]) { background: #f6f7f9; }
.receipt-import-row { border-color: var(--line); border-radius: 6px; padding: 12px; }
.receipt-row-cost { color: #48668b; }
.scan-modes { border-radius: 6px; background: #eff2f6; }
.scan-modes button { color: #647081; }
.scan-modes button.active { color: var(--green); }
#toast { border-radius: 6px; background: #303846; box-shadow: none; font-size: 13px; }
@media (max-width: 1150px) {
  .quote-main { grid-template-columns: minmax(260px,1fr) 290px; gap: 16px; padding: 18px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card:nth-child(odd) { border-right: 0; }
}
@media (max-width: 800px) {
  .layout { padding-bottom: calc(66px + env(safe-area-inset-bottom,0px)); }
  .sidebar { display: contents; }
  .sidebar > nav { padding: 4px 8px calc(4px + env(safe-area-inset-bottom,0px)); gap: 0; box-shadow: none; background: #fff; }
  .sidebar .nav-item { min-height: 54px; gap: 3px; padding: 5px 4px; font-size: 10px; border-radius: 0; color: #8a919d; }
  .sidebar .nav-item.active { background: none; color: var(--green); font-weight: 500; }
  .sidebar .nav-icon { font-size: 0; line-height: 1; }
  .sidebar > .profile { top: 14px; right: 10px; font-size: 11px; gap: 6px; }
  .profile small { display: none; }
  .profile .text-button { padding: 5px; min-height: 32px; font-size: 11px; }
  .topbar { height: 72px; padding: 12px 16px; }
  .topbar h1 { font-size: 20px; }
  .topbar > div:first-child { max-width: calc(100% - 90px); }
  .quote-main { display: flex; flex-direction: column; padding: 14px 12px; gap: 14px; }
  .page-main { padding: 14px 12px; }
  .scan-box input { font-size: 16px; }
  .scan-box .button { font-size: 12px; padding: 8px 10px; min-height: 38px; }
  .catalog-head { flex-direction: column; align-items: stretch; margin: 16px 0 10px; }
  .catalog-head > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .catalog-head .search { width: 100%; font-size: 13px; }
  .filters { margin-bottom: 10px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 60px minmax(0,1fr); padding: 12px; column-gap: 12px; }
  .product-card .product-art { width: 60px; height: 70px; }
  .product-card h3 { font-size: 14px; }
  .product-card .product-meta { padding-top: 3px; }
  .basket { min-height: 0; position: static; }
  .cart-rows { min-height: 0; }
  .cart-empty { padding: 20px 0; }
  .basket-head { padding: 12px 14px; }
  .basket-footer { padding: 12px 14px; }
  .stats .stat { padding: 0 10px; }
  .stats .stat strong { font-size: 22px; }
  .stats .stat small { font-size: 9px; line-height: 1.5; }
  .records-stats .stat { padding: 11px 12px; }
  .records-stats .stat strong { font-size: 22px; }
  .inventory-panel .section-head { display: grid; grid-template-columns: 1fr 1fr; }
  .inventory-panel .section-head > div,.inventory-panel .section-head > input { grid-column: 1 / -1; width: 100%; }
  .inventory-panel .section-head > .button { width: 100%; font-size: 12px; }
  .inventory-panel .table-wrap,.records-panel .table-wrap { overflow: visible; }
  .inventory-panel table,.records-panel table { min-width: 0; display: block; font-size: 12px; }
  .inventory-panel thead,.records-panel thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .inventory-panel tbody,.records-panel tbody { display: block; }
  .inventory-panel tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .inventory-panel td,.records-panel td { padding: 0; border: 0; min-width: 0; white-space: normal; }
  .inventory-panel .table-wrap td:first-child,.records-panel .table-wrap td:first-child { min-width: 0; }
  .inventory-panel td:nth-child(1) { grid-column: 1 / -1; grid-row: 1; font-size: 14px; margin-bottom: 3px; }
  .inventory-panel td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 11px; }
  .inventory-panel td:nth-child(3) { grid-column: 2; grid-row: 3; color: var(--muted); text-align: right; font-size: 10px; }
  .inventory-panel td:nth-child(4) { grid-column: 1; grid-row: 3; font-weight: 600; }
  .inventory-panel td:nth-child(4) .cell-sub { font-size: 10px; font-weight: 400; line-height: 1.6; }
  .inventory-panel td:nth-child(5) { grid-column: 2; grid-row: 2; text-align: right; }
  .inventory-panel td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; margin-top: 5px; }
  .row-actions { justify-content: flex-end; gap: 6px; }
  .row-actions .button { min-height: 30px; font-size: 11px; }
  .records-panel .section-head { flex-wrap: nowrap; align-items: center; }
  .records-panel .section-head .button { flex: none; font-size: 11px; }
  .records-panel tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .records-panel td:nth-child(1) { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 11px; }
  .records-panel td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; }
  .records-panel td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; margin: 2px 0; font-size: 13px; }
  .records-panel td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .records-panel td:nth-child(5) { grid-column: 1; grid-row: 4; font-size: 11px; color: var(--muted); }
  .records-panel td:nth-child(4)::before,.records-panel td:nth-child(5)::before { content: attr(data-label) '：'; color: var(--muted); font-size: 11px; }
  .records-panel td:nth-child(6) { grid-column: 2; grid-row: 3 / 5; align-self: center; }
  .record-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .record-filters .search { grid-column: 1 / -1; min-width: 0; width: 100%; }
  .record-filters > input,.record-filters > select { width: 100%; min-width: 0; font-size: 13px; }
  .record-filters > .button { grid-column: 1 / -1; min-height: 30px; font-size: 11px; background: #f8f9fb; }
  .document-meta { grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
  .record-dialog .table-wrap { overflow: visible; }
  .record-dialog table,.record-dialog tbody { min-width: 0; display: block; }
  .record-dialog thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .record-dialog tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
  .record-dialog td { padding: 0; border: 0; white-space: normal; min-width: 0 !important; }
  .record-dialog td:first-child { grid-column: 1 / -1; }
  .record-dialog td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
  .trace-panel .table-wrap table { min-width: 0; }
  .trace-panel td,.trace-panel th { padding: 10px; overflow-wrap: anywhere; }
  .trace-panel .trace-code { max-width: 140px; word-break: break-all; }
  .supplier-page .stats { grid-template-columns: 1fr 1fr; padding: 0; }
  .supplier-page .stat { padding: 12px; }
  .supplier-page .stat:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .account-actions,.account-card { padding: 16px; }
  dialog { max-height: calc(100dvh - 24px); }
  .dialog-body { padding: 14px 16px; }
  .dialog-head { padding: 13px 16px; }
  .dialog-body input,.dialog-body select { font-size: 16px; }
  .product-detail .product-art { height: 130px; }
  .inbound-code-panel,.date-ocr-panel { gap: 10px; margin: 14px 0; }
  .date-ocr-fields { gap: 10px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom,0px)); }
}
@media (prefers-reduced-motion: reduce) { .product-card { transition: none; } }
.product-entry-fields,.entry-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
.product-entry-fields .full-field { grid-column: 1 / -1; }
.product-entry-fields label,.entry-pair label { min-width: 0; }
@media (max-width: 800px) {
  .inventory-panel tbody tr { position: relative; padding: 12px 16px 12px 78px; gap: 3px 8px; }
  .inventory-panel .stock-image { position: absolute; left: 16px; top: 14px; }
  .inventory-panel .stock-product .cell-sub { display: none; }
  .inventory-panel td:nth-child(1) { margin-bottom: 0; }
  .inventory-panel td:nth-child(4) .cell-sub { line-height: 1.4; }
  .quote-main.has-cart { padding-bottom: 144px; }
  .basket.has-items .basket-footer { position: fixed; bottom: calc(62px + env(safe-area-inset-bottom,0px)); left: 0; right: 0; z-index: 15; background: white; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
  .basket.has-items .total { justify-content: flex-start; gap: 10px; }
  .basket.has-items .total > span { font-size: 11px; }
  .basket.has-items .total strong { font-size: 25px; }
  .basket.has-items .checkout { grid-column: 2; grid-row: 1; width: auto; padding: 8px 18px; }
  .basket.has-items .payment-note,.basket.has-items .footnote { grid-column: 1 / -1; margin: 0; font-size: 9px; line-height: 1.5; }
}

/* Business navigation: daily work first, reports under My. */
.button,.icon-button,.text-button,.stepper button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button .ui-icon,.text-button .ui-icon { width: 18px; height: 18px; }
.icon-button .ui-icon,.stepper .ui-icon { width: 18px; height: 18px; }
.button-label { min-width: 0; }
.menu-group { overflow: hidden; margin-top: 14px; }
.menu-group > h2 { font-size: 12px; color: var(--muted); padding: 13px 16px 8px; font-weight: 500; }
.menu-entry { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 0; border-radius: 0; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.menu-entry + .menu-entry { border-top: 1px solid var(--line); }
.menu-entry:hover { background: #f8f9fb; }
.menu-entry:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }
.menu-entry-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: #eef3fb; color: var(--green); flex: none; }
.menu-entry-copy { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.menu-entry-copy strong { font-size: 14px; font-weight: 500; }
.menu-entry-copy small { font-size: 11px; color: var(--muted); line-height: 1.5; }
.menu-entry > .ui-icon { width: 16px; height: 16px; color: #9ca4b0; }
.account-avatar .ui-icon { width: 25px; height: 25px; }
.subpage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.business-page { max-width: 1100px; }
.business-section { padding: 16px; margin-bottom: 14px; }
.business-section > h2 { font-size: 15px; margin-bottom: 14px; }
.business-section .stats { margin: 0; border: 0; }
.business-section .records-stats { background: #f8f9fb; }
.inventory-panel .section-head > .button { color: var(--green); background: #f3f6fc; border-color: #dfe7f3; }
.nav-item.active .ui-icon { stroke-width: 2; }
.nav-item .ui-icon { width: 23px; height: 23px; }
@media (max-width:800px) {
  .inventory-page > .stats { margin-bottom: 12px; }
  .inventory-panel .section-head { gap: 10px; }
  .inventory-panel .section-head > .button { min-height: 44px; gap: 6px; padding: 8px; }
  .inventory-panel .section-head > div > p { font-size: 11px; }
  .records-page .record-count { line-height: 1.6; }
  .business-section { padding: 14px; }
  .business-section .records-stats { grid-template-columns: 1fr 1fr; }
  .business-section .stat { min-width: 0; }
  .business-section .stat strong { font-size: 22px; }
  .menu-entry { min-height: 72px; }
  .row-actions .button { gap: 4px; padding: 6px 8px; }
  .row-actions .ui-icon { width: 14px; height: 14px; }
  .sidebar > .profile { display: none; }
  .topbar > div:first-child { max-width: 100%; }
}

.scan-modes button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.scan-modes .ui-icon { width: 17px; height: 17px; }

/* Keep selected goods between scan and catalog; constrain intrinsic image size. */
.quote-main.has-cart { grid-template-columns: minmax(0, 1fr); }
.catalog > .basket.has-items { position: static; min-height: 0; margin-top: 16px; }
.catalog > .basket.has-items .cart-rows { min-height: 0; }
.stock-image { overflow: hidden; contain: size; }
.stock-image > img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }

/* Store name on the left, current page on the right. */
.topbar { height: 64px; }
.topbar .header-titles { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-width: 0; max-width: 100%; }
.header-titles .breadcrumb { margin: 0; color: var(--ink); font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-titles h1 { flex: none; margin: 0; font-size: 18px; text-align: right; }
.topbar .topbar-right { display: none; }
.header-titles .breadcrumb,.header-titles h1 { font-family: inherit; font-size: 16px; font-weight: 600; line-height: 24px; letter-spacing: 0; color: var(--ink); }
/* Page-first header with a compact store label. */
.topbar .header-titles { flex-direction: row-reverse; }
.header-titles h1 { font-size: 20px; font-weight: 600; line-height: 28px; text-align: left; }
.header-titles .breadcrumb { max-width: 65%; padding: 5px 10px; border-radius: 5px; background: #f3f4f6; color: #687180; font-size: 12px; font-weight: 400; line-height: 20px; }
.store-entry { border: 0; cursor: pointer; font-family: inherit; }
.store-entry:hover { background: #e8edf4; }
.store-entry:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.login-stack { width: 100%; max-width: 370px; }
.login-stack > .button { margin-top: 12px; }
.merchant-page { max-width: 760px; }
.merchant-form { padding: 20px; }
.merchant-form > h2 { font-size: 17px; margin-bottom: 8px; }
.merchant-form > .muted { font-size: 12px; }
.store-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.store-fields .full-field { grid-column: 1 / -1; }
.store-fields label { min-width: 0; }
.store-fields input { width: 100%; }
.license-preview { display: block; max-width: 100%; max-height: 280px; object-fit: contain; margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; }
.license-preview[hidden] { display: none; }
.wechat-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; margin: 18px 0; }
.wechat-section > div { flex: 1; min-width: 0; }
.wechat-section strong { font-size: 13px; }
.wechat-section p { font-size: 11px; margin: 5px 0 0; line-height: 1.5; }
.wechat-section .button { flex: none; width: auto; max-width: 100%; }
@media(max-width:600px) {
  .wechat-section { flex-direction: column; align-items: stretch; }
  .wechat-section .button { width: 100%; }
}
@media(max-width:800px) { .merchant-form { padding: 16px; } .store-fields { grid-template-columns: 1fr; } .store-fields .full-field { grid-column: auto; } }
.store-entry { display: inline-flex; align-items: center; gap: 6px; }
.store-logo { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
.account-logo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-editor { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 16px; margin-bottom: 14px; }
.brand-editor h2 { font-size: 15px; }
.brand-editor p { font-size: 11px; margin: 5px 0 10px; }
.brand-preview { width: 64px; height: 64px; border-radius: 8px; background: #f3f5f8; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.brand-preview img { width: 100%; height: 100%; object-fit: cover; }
.brand-crop-dialog { max-width: 420px; }
.brand-crop-dialog canvas { display:block; width:100%; max-width:280px; aspect-ratio:1; margin:0 auto 16px; border:1px solid #dce1e8; }


.brand-crop-dialog label { display:block; margin-bottom:12px; }
.brand-crop-dialog input[type=range] { width:100%; padding:0; min-height:32px; }
.product-card { display:block; }
.product-select { display:grid; width:100%; grid-template-columns:66px minmax(0,1fr); grid-template-rows:auto auto 1fr; column-gap:12px; row-gap:3px; background:transparent; border:0; padding:0; color:var(--ink); text-align:left; border-radius:4px; }
.product-select:disabled { opacity:1; color:var(--ink); }
.product-quantity { display:flex; justify-content:flex-end; margin-top:8px; }
.product-quantity .stepper { border:0; background:transparent; gap:6px; }
.product-quantity .stepper button { border-radius:50%; width:32px; height:32px; min-width:32px; background:#edf2fa; color:var(--blue,#285aaa); }
.product-quantity .stepper button:disabled { opacity:.4; }
.product-quantity .stepper span { min-width:24px; text-align:center; }
@media(max-width:600px) { .product-select { grid-template-columns:60px minmax(0,1fr); } }
.scan-modes { grid-template-columns: repeat(4,minmax(0,1fr)); }
.scan-modes button { flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; padding: 10px 4px; }
.scan-modes button:disabled { opacity: .45; cursor: not-allowed; }
.date-scan-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* Counter workspace: readable stock, compact goods, restrained coral accents. */
:root {
  --ink: #2c373d; --wine: #933547; --accent: #ee403e; --coral: #fe8078;
  --green: var(--wine); --mint: #faf0f1; --paper: #f5f6f7;
  --line: #e7e9ec; --muted: #727980; --orange: var(--wine);
  --icon-accent: #f4cbc6;
}
body { color: var(--ink); }
.ui-icon { width: 22px; height: 22px; flex: none; overflow: visible; filter: none; }
.icon-accent { fill: var(--icon-accent); }
.button,.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.button { border-radius: 6px; min-height: 40px; }
.button.wide { display: flex; }
.button.primary { background: var(--wine); border-color: var(--wine); color: #fff; --icon-accent: #fe8078; }
.button.primary:hover:not(:disabled) { background: #823041; }
.button.secondary { background: #fff; color: var(--ink); }
.button:disabled { opacity: 1; background: #eceef0; border-color: #e4e6e9; color: #8a9198; --icon-accent:#d6dade; }
.text-button { color: #687079; }
input:focus,select:focus,textarea:focus,button:focus-visible { outline-color: var(--coral); }
.scan-box { padding: 5px 6px 5px 12px; border-color: #d9dde2; border-radius: 8px; }
.scan-box:focus-within { outline: 1px solid #933547; border-color: var(--wine); }
.scan-icon { color: #67717a; }
.scan-icon .ui-icon { width: 23px; height: 23px; }
.scan-box .button { min-height: 40px; }
.quote-main { grid-template-columns: minmax(0,1fr); }
.basket:not(.has-items) { display: none; }
.catalog-head { margin: 24px 0 12px; }
.catalog-head h2 { font-size: 18px; }
.catalog-head p { color: #727980; font-size: 12px; }
.filters { gap: 22px; padding: 0; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.filter { background: none; color: #657079; padding: 9px 0 11px; border-radius: 0; font-size: 13px; border: 0; border-bottom: 2px solid transparent; }
.filter.selected { color: var(--wine); background: none; border-bottom-color: var(--wine); font-weight: 600; }
.product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); border-radius: 8px; gap: 0; }
.product-card { position: relative; padding: 16px; min-height: 114px; border-right: 1px solid var(--line); }
.product-card:nth-child(3n) { border-right: 0; }
.product-card:hover { background: #fbfbfc; }
.product-select { grid-template-columns: 64px minmax(0,1fr); grid-template-rows: auto auto 1fr; row-gap: 4px; column-gap: 14px; }
.product-card .product-art { width: 64px; height: 80px; border-radius: 4px; background: #f7f8f9; color: #8c969e; }
.product-card .product-category { font-size: 11px; line-height: 16px; color: #727980; }
.product-card h3 { font-size: 14px; font-weight: 500; line-height: 21px; }
.product-card .product-meta { padding-top: 6px; padding-right: 86px; min-height: 30px; }
.product-meta strong { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.product-quantity { position: absolute; bottom: 16px; right: 12px; margin: 0; }
.product-quantity .stepper { gap: 2px; }
.product-quantity .stepper button { width: 28px; min-width: 28px; height: 28px; border-radius: 5px; color: #2c373d; background: #f0f2f4; }
.product-quantity .stepper button:last-child { color: var(--wine); background: #faf0f1; }
.product-quantity .stepper span { min-width: 22px; font-size: 12px; }
.product-quantity .stepper .ui-icon { width: 16px; height: 16px; }
.product-quantity .stepper button:disabled { opacity: .35; }
.stock-image { background: #f7f8f9; }
.pill { background: #f1f3f5; color: #68727b; }
.record-badge,.stock-badge { background: #f0f2f4; color: #4e5c67; }
.stock-badge.low { background: #faf0f1; color: var(--wine); }
.record-badge.out { background: #faf0f1; color: var(--wine); }
.receipt-row-cost { color: var(--wine); }
.inventory-panel .section-head > .button { color: var(--ink); background: #fff; border-color: var(--line); }
.scan-modes { background: #f0f2f4; }
.scan-modes button.active { color: var(--wine); }
.total strong { color: var(--ink); font-size: 30px; font-weight: 650; }
.checkout { background: var(--wine); border-color: var(--wine); }
.basket-footer { background: #fafbfc; }
.payment-note,.basket .footnote { font-size: 12px; color: #707981; }
.store-entry:hover { background: #edf0f3; }
.avatar,.account-avatar { background: #f1f3f5; color: #2c373d; }
.account-card { padding: 22px 20px; }
button.account-card { display: block; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.account-card:hover { border-color: var(--wine); }
.account-avatar { width: 48px; height: 48px; border-radius: 50%; background: #f5e6e8; color: var(--wine); }
.account-avatar .ui-icon { width: 25px; height: 25px; }
.account-heading h2 { font-size: 20px; font-weight: 600; }
.account-heading .muted { font-size: 13px; }
.menu-group > h2 { font-size: 12px; padding: 16px 20px 4px; }
.menu-entry { padding: 18px 20px; gap: 14px; }
.menu-entry-icon { width: 28px; height: 28px; border-radius: 0; background: none; color: #46535d; }
.menu-entry-icon .ui-icon { width: 25px; height: 25px; }
.menu-entry-copy { gap: 4px; }
.menu-entry-copy strong { font-size: 15px; font-weight: 500; }
.menu-entry-copy small { color: #747d85; font-size: 12px; }
.menu-entry > .ui-icon { color: #a3aab1; width: 16px; height: 16px; }
.menu-entry:hover { background: #fafbfc; }
.status-dot { background: var(--coral); }
#toast { background: var(--ink); }
.nav-item { --icon-accent: #d9dde2; color: #77818b; border-radius: 6px; transition: color 150ms ease,background 150ms ease; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; position: relative; isolation: isolate; width: 34px; height: 30px; }
.nav-icon::before { content: ''; position: absolute; inset: 0 -3px; border-radius: 8px; background: #fae5e3; z-index: -1; opacity: 0; transition: opacity 150ms ease; }
.nav-icon .ui-icon { width: 24px; height: 24px; transition: color 150ms ease; }
.nav-item.active { --icon-accent: #fe8078; background: #faf0f1; color: #933547; font-weight: 600; }
.nav-item.active .nav-icon::before { opacity: 1; }
.nav-item.active .ui-icon { transform: none; filter: none; stroke-width: 1.8; }
@media (max-width:1150px) {
  .quote-main { grid-template-columns: minmax(0,1fr); }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .product-card:nth-child(odd) { border-right: 1px solid var(--line); }
  .product-card:nth-child(even) { border-right: 0; }
}
@media (max-width:800px) {
  .layout { padding-bottom: calc(74px + env(safe-area-inset-bottom,0px)); }
  .quote-main { padding: 16px 12px; }
  .page-main { padding: 16px 12px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card,.product-card:nth-child(odd) { padding: 14px; border-right: 0; min-height: 112px; }
  .product-select { grid-template-columns: 64px minmax(0,1fr); column-gap: 14px; }
  .product-card .product-meta { padding-right: 86px; }
  .product-quantity { bottom: 14px; right: 14px; }
  .catalog-head { margin: 22px 0 10px; }
  .catalog-head > div { align-items: center; }
  .catalog-head .search { min-height: 40px; }
  .filters { gap: 22px; margin-bottom: 12px; }
  .sidebar > nav { padding: 6px 8px calc(6px + env(safe-area-inset-bottom,0px)); border-top-color: var(--line); box-shadow: none; }
  .sidebar .nav-item { min-height: 58px; gap: 4px; font-size: 11px; color: #77818b; }
  .sidebar .nav-item.active { background: none; color: var(--wine); font-weight: 600; }
  .sidebar .nav-icon .ui-icon { width: 24px; height: 24px; }
  .menu-entry { padding: 17px 18px; }
}
@media (prefers-reduced-motion:reduce) { .nav-item,.nav-icon::before,.nav-icon .ui-icon { transition: none; } }
.sale-product { display:grid; grid-template-columns:64px minmax(0,1fr); grid-template-rows:auto auto; gap:7px 12px; padding:14px; background:#fff; border-bottom:1px solid var(--line); min-width:0; }
.sale-image { grid-column:1; grid-row:1 / 3; padding:0; border:0; background:#f7f8f9; border-radius:6px; width:64px; height:80px; align-self:center; overflow:hidden; }
.sale-thumb { display:grid; place-items:center; width:100%; height:100%; overflow:hidden; }
.sale-thumb img { display:block; width:100%; height:100%; object-fit:contain; }
.sale-thumb .ui-icon { width:28px; height:28px; }
.sale-title { grid-column:2; border:0; background:none; padding:0; min-width:0; text-align:left; color:var(--ink); }
.sale-title h3 { margin:0; font-size:14px; font-weight:600; line-height:21px; overflow-wrap:anywhere; }
.sale-title:disabled,.sale-image:disabled { opacity:1; color:var(--ink); }
.sale-bottom { grid-column:2; display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.sale-price { display:flex; flex-direction:column; gap:3px; min-width:0; }
.sale-price strong { font-size:17px; line-height:21px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.sale-price small { font-size:10px; line-height:14px; color:var(--muted); }
.sale-quantity { display:flex; align-items:center; gap:3px; flex-shrink:0; }
.sale-quantity button { display:grid; place-items:center; width:28px; height:28px; padding:0; border:0; border-radius:50%; background:#f0f2f4; color:var(--ink); }
.sale-quantity button:last-child { background:#faf0f1; color:var(--wine); }
.sale-quantity button:disabled { opacity:.35; }
.sale-quantity .ui-icon { width:16px; height:16px; }
.sale-quantity span { width:20px; text-align:center; font-size:12px; }
@media(max-width:360px) { .sale-product { padding:12px; grid-template-columns:52px minmax(0,1fr); gap:6px 10px; } .sale-image { width:52px; height:72px; } .sale-price strong { font-size:15px; } }

@media (min-width:1151px) { .sale-product { border-right:1px solid var(--line); } .sale-product:nth-child(3n) { border-right:0; } }
@media (min-width:801px) and (max-width:1150px) { .sale-product:nth-child(odd) { border-right:1px solid var(--line); } }

/* New-product identity stays above optional capture tools. */
.registration-tools,.date-manual { border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin: 10px 0; }
.registration-tools summary,.date-manual summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.registration-tools[open] summary,.date-manual[open] summary { margin-bottom: 12px; }
.compact-date { gap: 6px; margin: 0 0 12px; }
.compact-date .date-manual { border: 0; padding: 0; margin: 0; }
.standard-name-panel { min-width: 0; }
.name-status { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.standard-name-choices { display: grid; gap: 6px; }
.dialog-body .standard-name-choice,.dialog-body .standard-name-confirm { margin: 0; width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.standard-name-confirm { color: var(--muted); }
.product-identity { margin-bottom: 10px; }

/* Product identity is separate from each merchant's uploaded store logo. */
.brand-lockup { display: block; width: 100%; height: auto; object-fit: contain; }
.login { min-height: 100svh; padding: 32px 20px; gap: 24px; }
.login-intro { width: 100%; max-width: 370px; }
.login-intro .wordmark { width: min(240px,100%); margin: 0 auto 4px; }
.login-intro .lead { margin: 0; font-size: 12px; line-height: 20px; }
.login .login-card { padding: 24px; border-radius: 12px; }

/* Login actions: one primary action, paired alternatives, quiet registration. */
.login .login-card { display: grid; gap: 18px; }
.login .login-card h2 { margin: 0 0 4px; font-size: 20px; }
.login .login-card > label { display: grid; gap: 8px; margin: 0; }
.login .login-card input { width: 100%; min-height: 46px; margin: 0; }
.login .login-card > .error { margin: 0; }
.login .login-card > .error:empty { display: none; }
.login .login-card > .primary { min-height: 46px; margin: 2px 0 0; }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.login-divider::before,.login-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.login-alternatives { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.login-alternatives .button { min-width: 0; min-height: 44px; padding: 10px 6px; margin: 0; font-size: 13px; border-radius: 8px; }
.login-register { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.login-register .text-button { min-height: 44px; padding: 8px 4px; color: var(--wine); font-size: 13px; font-weight: 600; }
.login-register .ui-icon { display: none; }
.login-announcement { margin-top: 8px; text-align: center; }
.login-announcement:empty { display: none; }

.sidebar .product-brand { display: flex; align-items: center; gap: 8px; font-size: 20px; letter-spacing: 0; }
.brand-icon { display: block; width: 36px; height: 36px; flex: none; object-fit: contain; }
.brand-copy { white-space: nowrap; }
.mobile-brand-icon { display: none; }
.account-brand { width: 164px; margin: 28px auto 12px; }
@media (max-width:1150px) and (min-width:801px) {
  .sidebar .product-brand { gap: 6px; font-size: 17px; }
  .brand-icon { width: 28px; height: 28px; }
}
@media (max-width:800px) {
  .sidebar .product-brand { display: none; }
  .mobile-brand-icon { display: block; width: 30px; height: 30px; flex: none; object-fit: contain; }
  .topbar .header-titles { gap: 8px; }
  .header-titles h1 { margin-right: auto; }
  .header-titles .breadcrumb { max-width: 55%; }
  .login-intro .wordmark { width: min(220px,100%); }
}

.phone-verification { min-width: 0; }
.phone-code-entry { display: flex; align-items: center; gap: 8px; }
.phone-code-entry[hidden] { display: none; }
.phone-code-entry input { min-width: 0; flex: 1; }
.phone-code-entry button { flex: none; font-size: 12px; padding: 10px 12px; }
.phone-login-form { display: grid; gap: 12px; }
.phone-login-form > p { margin: 0; }
.phone-login-form > .error:empty { display: none; }
.phone-verification p { font-size: 12px; line-height: 1.6; margin: 6px 0 0; }

.tools-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.tools-grid .menu-entry { border: 1px solid var(--line); border-radius: 8px; margin: 0; min-width: 0; }
.tools-form .tool-result:empty { display: none; }
.tool-result { padding: 14px; border: 1px solid var(--line); border-radius: 8px; margin: 14px 0; background: #fafafa; }
.tool-values { margin: 0; display: grid; gap: 12px; }
.tool-values > div { display: flex; justify-content: space-between; gap: 12px; }
.tool-values dt { color: var(--muted); font-size: 13px; }
.tool-values dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.expiry-list,.count-list { display: grid; gap: 8px; margin-top: 16px; }
.expiry-row,.count-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.expiry-row small,.count-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.expiry-alert { border-left: 3px solid var(--wine); }
.count-row { margin: 0 !important; }
.count-row span { min-width: 0; }
.count-row strong { overflow-wrap: anywhere; }
.count-row input { width: 100px; flex: none; margin: 0; }
.count-list { max-height: 320px; overflow: auto; }
.tool-result > div { display: grid; gap: 4px; border-top: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
@media(max-width:600px) { .tools-grid { grid-template-columns: 1fr; } .tool-values > div { flex-wrap: wrap; } }

.account-main .management-tools { padding: 20px 16px; }
.management-tools h2 { font-size: 13px; color: var(--muted); margin: 0 0 18px; font-weight: 500; }
.management-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px 4px; }
.management-tool { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 9px; border: 0; background: transparent; color: var(--ink); min-width: 0; padding: 8px 0; font-size: 12px; line-height: 1.5; cursor: pointer; }
.management-tool .ui-icon { width: 28px; height: 28px; color: var(--muted); }
.management-tool span { text-align: center; white-space: normal; }
.management-tool:hover .ui-icon,.management-tool:focus-visible .ui-icon { color: var(--wine); }
.management-tool:focus-visible { outline: 2px solid var(--wine); border-radius: 8px; }
.management-tool:disabled { opacity: .4; cursor: default; }
.tool-alert-count { position: absolute; top: 0; left: calc(50% + 9px); padding: 0 4px; min-width: 16px; border-radius: 9px; background: var(--wine); color: white; font-size: 10px; line-height: 16px; }
@media(max-width:360px) { .management-tool { font-size: 11px; } .management-grid { gap: 14px 2px; } }

.wine-source { padding: 18px 0; border-top: 1px solid var(--line); }
.wine-source h3 { font-size: 15px; margin: 0; }
.wine-article { display: block; color: var(--wine); font-size: 12px; line-height: 1.6; margin: 8px 0 12px; overflow-wrap: anywhere; }
.wine-quote-list { display: grid; gap: 8px; }
.wine-quote { display: flex; gap: 12px; justify-content: space-between; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 13px; }
.wine-quote small { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.wine-quote-value { text-align: right; flex: none; }
.wine-quote-value strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.wine-market-panel { padding:20px; }
.wine-market-panel > .section-head { padding:0; justify-content:space-between; align-items:center; gap:12px; margin-bottom:18px; }
.wine-market-panel > input { width:100%; margin:0 0 10px; }
.wine-market-panel > p { margin:0 0 16px; font-size:12px; }
.wine-section-title { margin:24px 0 12px; font-size:15px; }
.wine-common-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.wine-price-tile { display:flex; flex-direction:column; text-align:left; justify-content:space-between; gap:7px; min-width:0; min-height:126px; padding:12px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink); }
.wine-price-tile > div:first-child { flex:1; }
.wine-price-tile strong { display:block; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.wine-price-tile small { display:block; font-size:10px; line-height:1.4; color:var(--muted); }
.wine-price-tile b { font-size:23px; line-height:1.2; color:var(--wine); font-variant-numeric:tabular-nums; }
.wine-price-tile:hover,.wine-quote-button:hover { border-color:var(--wine); background:#fffafa; }
.wine-quote-button { width:100%; background:#fff; color:var(--ink); text-align:left; }
.wine-detail-price { display:flex; gap:12px; align-items:baseline; margin:20px 0 8px; }
.wine-detail-price strong { font-size:34px; color:var(--wine); }
.wine-detail-price small { color:var(--muted); }
.wine-price-chart { display:block; width:100%; height:auto; margin:16px 0; }
.chart-grid { stroke:#e8ebee; stroke-width:1; }
.chart-label { fill:#78818a; font-size:13px; }
.chart-line { fill:none; stroke:var(--wine); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.chart-dot { fill:var(--wine); stroke:white; stroke-width:2; }
.wine-history-table { margin:12px 0 24px; color:var(--muted); font-size:12px; }
.wine-history-table > div { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--line); }
.wine-contact-qr { display:block; width:220px; height:220px; object-fit:contain; margin:20px auto; }
.wine-purchase { text-align:center; }
@media(max-width:600px) {
  .wine-market-panel { padding:14px; }
  .wine-market-panel > .section-head { margin-bottom:12px; }
  .wine-market-panel > .section-head h2 { font-size:17px; }
  .wine-market-panel > .section-head .button { flex:none; padding:8px 10px; }
  .wine-section-title { margin:18px 0 10px; font-size:15px; }
  .wine-common-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .wine-price-tile { padding:12px; min-height:136px; gap:6px; border-radius:10px; }
  .wine-price-tile strong { font-size:14px; line-height:1.5; }
  .wine-price-tile > div:first-child > small { margin-top:4px; }
  .wine-price-tile b { font-size:25px; line-height:1.2; }
  .wine-price-tile small { font-size:11px; line-height:1.5; }
  .wine-quote { padding:12px; gap:12px; }
}

/* Uploaded contact card: show its original QR pixels, without shrinking the card. */
.wine-contact-card-qr { width:240px; height:240px; object-fit:none; object-position:right bottom; background:white; }

/* Procurement contact card: portrait, selected wine, QR, contact actions. */
.wine-purchase { padding:20px; text-align:left; }
.wine-contact-identity { display:flex; align-items:center; gap:18px; padding-bottom:18px; }
.wine-contact-portrait { width:88px; height:110px; flex:none; object-fit:cover; object-position:center 25%; border-radius:10px; background:#f4f4f4; }
.wine-contact-name small { font-size:11px; color:var(--muted); letter-spacing:1px; }
.wine-contact-name h3 { font-size:24px; margin:8px 0 5px; line-height:1.2; }
.wine-contact-name p { font-size:13px; color:var(--muted); margin:0; }
.wine-contact-product { display:grid; gap:4px; padding:12px 14px; border-radius:8px; background:#f5f6f8; }
.wine-contact-product small { color:var(--muted); font-size:10px; }
.wine-contact-product strong { font-size:14px; }
.wine-contact-product span { color:var(--muted); font-size:11px; }
.wine-contact-code { text-align:center; padding:10px 0 16px; }
.wine-contact-code .wine-contact-qr { margin:0 auto 4px; }
.wine-contact-code > strong { display:block; font-size:14px; }
.wine-contact-code p { font-size:11px; color:var(--muted); margin:6px 0 0; }
.wine-contact-actions { display:grid; gap:8px; padding-top:14px; border-top:1px solid var(--line); }
.wine-contact-actions .button { margin:0; }
@media(max-width:600px) { .wine-purchase { padding:16px; } .wine-contact-portrait { width:80px; height:100px; } .wine-contact-identity { gap:16px; padding-bottom:14px; } }

/* Merchant growth badge beside the account identity. */
.account-card { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.account-profile-link { flex:1; min-width:0; width:auto; padding:0; border:0; background:transparent; text-align:left; font:inherit; color:inherit; cursor:pointer; }
.account-profile-link .account-avatar { flex:none; }
.account-profile-link > div:last-child { min-width:0; }
.account-profile-link .muted { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.keeper-rank-badge { display:inline-flex; flex:none; align-items:center; gap:6px; margin:0; padding:6px 0; min-height:44px; border:0; border-radius:0; background:transparent; color:var(--muted); font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }
.keeper-rank-stars { display:inline-flex; gap:2px; color:#e0e2e4; font-size:17px; line-height:1; }
.keeper-rank-stars .earned { color:#b7791f; }
.keeper-rank-badge .ui-icon { width:13px; height:13px; flex:none; }
.keeper-rank-current { font-size:18px; font-weight:600; margin:0 0 10px; color:var(--wine); }
.keeper-rank-list { display:grid; gap:8px; margin:20px 0; }
.keeper-rank-list > div { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px; border:1px solid var(--line); border-radius:8px; font-size:13px; }
.keeper-rank-list > div.current { background:#fcf8f1; border-color:#eadfcd; color:#70552f; }
.keeper-rank-list small { color:var(--muted); white-space:nowrap; }
@media(max-width:600px) { .account-card { gap:10px; padding:18px 16px; } .account-profile-link { gap:9px; } .account-profile-link .account-avatar { width:40px; height:40px; } .account-profile-link .muted { font-size:11px; } .keeper-rank-badge { gap:4px; font-size:11px; } .keeper-rank-stars { gap:1px; font-size:15px; } .keeper-rank-badge .ui-icon { width:11px; height:11px; } }

.calculator-hub .menu-entry { width:100%; }
.online-channel-contact { text-align:center; }
.channel-slogan { margin:0 0 16px; font-size:20px; font-weight:600; color:var(--wine); }
.channel-platforms { display:flex; justify-content:center; gap:10px; margin:16px 0 0; }
.online-channel-contact > strong { display:block; margin:14px 0; }
.online-channel-contact .button { margin-top:14px; }
.rewards-center h3 {margin:18px 0 10px;font-size:15px;}
.reward-balances {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:12px 0;border-bottom:1px solid var(--border);}
.reward-balances div {display:flex;flex-direction:column;gap:4px;text-align:center;}
.reward-balances strong {font-size:22px;color:#933547;}
.reward-balances small {font-size:11px;color:#7b838a;}
.reward-tasks {display:grid;gap:8px;}
.reward-task {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #edf0f2;}
.reward-task > div {min-width:0;display:flex;flex-direction:column;gap:5px;}
.reward-task strong {font-size:14px;}
.reward-task small {font-size:12px;}
.reward-task button {flex:none;padding:8px 10px;font-size:12px;min-height:38px;}
.rewards-center > .primary {width:100%;}
.rewards-center details {margin-top:12px;}
.rewards-center summary {cursor:pointer;font-size:13px;color:#727b83;}
@media (max-width:420px) {.reward-balances {gap:4px;}.reward-task {gap:6px;}.reward-task button {padding:8px;}}
.online-channel-identity {display:flex;align-items:center;justify-content:center;gap:14px;margin:18px 0 8px;}
.online-channel-identity strong {font-size:15px;text-align:left;}
.online-channel-identity .wine-contact-portrait {width:72px;height:90px;}
.online-channel-contact .channel-platforms .button {flex:1;max-width:160px;margin:0;min-height:44px;}
.channel-phone-number {font-size:25px;font-weight:600;letter-spacing:1px;margin:18px 0 8px;color:var(--ink);}
.online-channel-dialog {width:min(420px,calc(100vw - 28px));}
.online-channel-dialog .dialog-head {padding:17px 20px;}
.online-channel-dialog .dialog-head h2 {font-size:18px;}
.online-channel-dialog .dialog-body {padding:18px 20px 20px;}
.channel-intro {text-align:left;margin-bottom:16px;}
.channel-intro .channel-slogan {font-size:19px;line-height:1.4;margin:0 0 5px;}
.channel-intro .muted {font-size:12px;line-height:1.6;margin:0;}
.channel-contact-card {padding:14px;border:1px solid var(--line);border-radius:12px;background:#f7f8fa;}
.channel-contact-card .online-channel-identity {justify-content:flex-start;margin:0 0 12px;gap:12px;}
.channel-contact-card .wine-contact-portrait {width:56px;height:70px;border-radius:8px;background:white;}
.channel-advisor {display:flex;flex-direction:column;text-align:left;gap:4px;}
.channel-advisor strong {font-size:16px;}
.channel-advisor small {font-size:11px;color:var(--muted);}
.channel-qr-panel {display:flex;flex-direction:column;align-items:center;border-radius:8px;background:white;padding:8px 0 12px;}
.channel-qr-panel .wine-contact-qr {margin:0;flex:none;}
.channel-qr-panel .muted {font-size:11px;line-height:1.5;margin:5px 0 0;}
.online-channel-contact .channel-platforms .button {max-width:none;min-height:44px;}
@media(max-width:360px) {.online-channel-dialog .dialog-body {padding:16px;}.channel-contact-card {padding:10px;}}

/* Compact phone layout, preserving 44px form controls and 16px input text. */
@media (max-width:800px) {
  .quote-main { padding:10px; gap:10px; }
  .page-main { padding:10px; }
  .panel { border-radius:10px; }
  .section-head { padding:12px; gap:8px; }
  .dialog-head { padding:12px 16px; }
  .dialog-body { padding:12px 14px; }
  .dialog-body label { margin:10px 0; gap:5px; }
  .dialog-body input,.dialog-body select { min-height:44px; padding:9px 10px; font-size:16px; }
  .product-registration .product-entry-fields { gap:0 10px; }
  .product-registration .product-image-preview:not([hidden]) { padding:6px; }
  .product-registration .product-image-preview img { width:64px; height:64px; }
  .product-registration .catalog-detail-preview:not([hidden]) { padding:8px 10px; line-height:1.5; }
  .product-registration .catalog-detail-preview p { margin:3px 0; }
  .product-registration .date-ocr-panel { margin:8px 0; gap:6px; }
  .product-registration .registration-tools,.product-registration .date-manual { margin:6px 0; padding:8px; }
  .product-registration .name-status { margin:4px 0; line-height:1.4; }
  .product-registration .standard-name-panel { margin-bottom:8px; }
  .product-registration .button { min-height:44px; }
}

/* Form rows size to their contents, never stretch an input to match a neighbouring hint. */
.product-entry-fields { align-items:start; }
.product-entry-fields > label { display:flex; flex-direction:column; align-items:stretch; }
.product-entry-fields > label > input,.product-entry-fields > label > select { height:44px; min-height:44px; max-height:44px; flex:none; box-sizing:border-box; }
.product-entry-fields > label > small { line-height:1.45; overflow-wrap:anywhere; }
.product-entry-fields .standard-name-panel { align-self:start; }
@media(max-width:800px) {
  dialog { max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); max-width:calc(100vw - 24px); }
  .product-registration .product-entry-fields > label { margin:8px 0; }
}
@media(max-width:360px) {
  .product-registration .product-entry-fields:not(.product-identity) { grid-template-columns:minmax(0,1fr); }
}

/* Product poster composition and phone export preview. */
.poster-dialog { width:min(620px,calc(100vw - 24px)); }
.poster-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 12px; }
.poster-fields label:first-child { grid-column:1 / -1; }
.poster-fields input,.poster-fields select { min-width:0; width:100%; }
.poster-preview { display:block; width:100%; height:auto; border-radius:8px; margin:12px 0; }
.poster-preview[hidden] { display:none; }
.poster-actions { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0; }
.inventory-panel .row-actions { flex-wrap:wrap; }
@media(max-width:380px) { .poster-fields { grid-template-columns:minmax(0,1fr); } }

.poster-actions > .button { flex:1 1 0; min-width:0; min-height:44px; font-size:14px; }
.dialog-body .poster-actions > .button + .button { margin-top:0; }

.poster-picker { border:1px solid var(--line); border-radius:6px; padding:12px; margin:12px 0; }
.poster-picker summary { cursor:pointer; font-weight:600; font-size:14px; }
.poster-selection-list { max-height:240px; overflow-y:auto; }
.poster-choice { display:flex; align-items:center; gap:10px; margin:0; padding:10px 0; border-bottom:1px solid var(--line); }
.poster-body .poster-choice input { width:20px; min-height:20px; height:20px; flex:none; }
.poster-choice span { min-width:0; overflow-wrap:anywhere; }
.poster-choice small { display:block; margin-top:4px; color:var(--muted); }
.poster-extra-card { margin-top:16px; padding:12px; border:1px solid var(--line); border-radius:6px; }
.poster-extra-card .section-head strong { min-width:0; overflow-wrap:anywhere; }

/* AI credits: display-only until a verified payment channel is connected. */
.ai-recharge-dialog { width:min(520px,calc(100vw - 24px)); }
.ai-recharge-body { padding:16px; }
.ai-credit-balance { display:flex; flex-direction:column; gap:6px; padding:18px; border-radius:12px; background:#f8f0f2; color:#963549; margin-bottom:16px; }
.ai-credit-balance strong { font-size:32px; line-height:1.15; }
.ai-credit-balance small { color:var(--muted); }
.ai-recharge-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0; }
.ai-recharge-option { display:flex; flex-direction:column; align-items:center; gap:4px; min-height:72px; padding:10px; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--ink); cursor:pointer; }
.ai-recharge-option strong { font-size:20px; }
.ai-recharge-option span { font-size:13px; color:var(--muted); }
.ai-recharge-option.selected { border:2px solid #963549; background:#fcf3f5; padding:9px; }
.ai-recharge-option:focus-visible { outline:2px solid #963549; outline-offset:2px; }
.ai-recharge-summary { font-size:14px; font-weight:600; margin:10px 0; }
.ai-recharge-note { font-size:12px; margin:8px 0 16px; }
.ai-credit-pricing { padding:12px; border:1px solid var(--line); border-radius:10px; margin-bottom:16px; }
.ai-credit-pricing h3,.ai-recharge-body h3 { font-size:15px; margin:0 0 10px; }
.ai-credit-pricing > div { display:flex; justify-content:space-between; gap:8px; font-size:13px; flex-wrap:wrap; }
.ai-credit-pricing strong { color:var(--muted); font-weight:400; }
.ai-credit-tabs { display:flex; gap:8px; }
.dialog-body .ai-credit-tabs .button + .button { margin-top:0; }
.ai-credit-tabs [aria-pressed=true] { border-color:#963549; color:#963549; background:#fcf3f5; }
.ai-credit-records .empty { padding:12px 0; text-align:left; font-size:13px; }

/* Customer contact reuses the configured support QR and telephone. */
.customer-support-dialog { width:min(420px,calc(100vw - 24px)); }
.customer-support-body { text-align:center; padding:18px; }
.customer-support-body h3 { margin-bottom:6px; }
.customer-support-qr { display:block; width:min(240px,100%); height:auto; margin:16px auto 10px; border-radius:8px; }
.customer-support-card { width:240px; max-width:100%; height:240px; object-fit:none; object-position:right bottom; background:white; }
.customer-support-body > .button { margin-top:16px; }

/* Shared customer, procurement and channel contact business card. */
.contact-business-card { width:min(300px,100%); margin:16px auto; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:white; text-align:left; }
.contact-business-photo { position:relative; aspect-ratio:1 / 1; overflow:hidden; background:#fafafa; }
.contact-business-photo img { display:block; width:100%; height:100%; object-fit:cover; object-position:center 20%; }
.contact-business-photo > strong { position:absolute; left:14px; bottom:14px; color:white; font-size:20px; text-shadow:0 1px 5px #333; }
.contact-business-bottom { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:16px; }
.contact-business-bottom > strong { font-size:16px; white-space:nowrap; padding-top:6px; }
.contact-business-qr { width:120px; height:120px; object-fit:contain; flex:none; }
@media(max-width:360px) { .contact-business-bottom { padding:12px; gap:8px; } .contact-business-qr { width:112px; height:112px; } }

.poster-job-progress { margin:12px 0; }
.poster-job-progress progress { display:block; width:100%; height:8px; accent-color:#963549; }
.poster-job-progress p { margin-top:8px; }
.poster-ready-notice { position:fixed; z-index:90; bottom:calc(84px + env(safe-area-inset-bottom,0px)); left:50%; transform:translateX(-50%); width:min(420px,calc(100vw - 24px)); display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--line); border-radius:12px; background:white; box-shadow:0 4px 20px #0002; }
.poster-ready-notice > span { flex:1; min-width:0; font-size:14px; }
.poster-ready-notice .button { flex:none; }

.poster-source-card { border:1px solid var(--line); border-radius:10px; padding:12px; margin:12px 0; }
.poster-source-image { display:block; width:100%; height:150px; object-fit:contain; background:#f8f9fa; border-radius:8px; margin:10px 0; }
.poster-source-image[hidden] { display:none; }
.poster-source-card .muted { margin:8px 0; }

.registration-pack-hint { grid-column:1 / -1; margin:0 0 8px; padding:10px 12px; background:var(--bg); border-radius:8px; }
.registration-pack-hint:empty { display:none; }
.poster-style-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}
.poster-style-card {border:0;border-radius:16px;min-height:100px;padding:12px;color:#28343b;background:linear-gradient(140deg,#f8d4c1,#eea183);font:inherit;font-weight:650;cursor:pointer}
.poster-style-card.style-1{background:linear-gradient(140deg,#e5e3ef,#c4b6d7)}
.poster-style-card.style-2{background:linear-gradient(140deg,#eef4dd,#b9d5bd)}
.poster-style-card.style-3{background:linear-gradient(140deg,#f1ddc6,#bb5d62)}
.poster-style-card.style-4{background:linear-gradient(140deg,#ffe6a5,#f3b881)}
.poster-style-card.style-5{background:linear-gradient(140deg,#d9e4ed,#a1b5ce)}
.poster-gallery {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.poster-gallery .poster-extra-card {min-width:0;margin:0;padding:12px;font-size:14px}
.poster-gallery .poster-preview {width:100%;aspect-ratio:3/4;object-fit:contain;border-radius:10px;background:#f4f5f7}
.poster-gallery .button {width:100%;font-size:14px;padding:10px}
.poster-gallery strong {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
@media(min-width:900px){.poster-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.poster-history-body{min-width:min(800px,80vw)}}

.poster-history-dialog { width:min(1000px,calc(100vw - 24px)); }
.poster-history-body { min-width:0; background:#f7f8fa; }
.poster-library-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.poster-library-heading p { margin:0; font-size:14px; }
.poster-library-heading .button { flex:none; white-space:nowrap; }
.poster-library-search { display:flex; align-items:center; gap:8px; padding:10px; background:white; border:1px solid var(--line); border-radius:12px; }
.poster-library-search input { flex:1; min-width:0; width:0; height:42px; max-height:42px; padding:10px 12px; font-size:14px; margin:0; }
.poster-library-search .button { flex:none; height:42px; min-width:64px; padding:8px 14px; white-space:nowrap; margin:0!important; }
.poster-gallery .poster-library-card { padding:0; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:white; }
.poster-image-button { display:block; width:100%; border:0; padding:0; cursor:zoom-in; background:#f4f5f7; }
.poster-gallery .poster-image-button .poster-preview { display:block; margin:0; border-radius:0; }
.poster-card-info { padding:12px 12px 0; }
.poster-card-info strong { font-size:14px; line-height:1.5; }
.poster-card-info time { display:block; font-size:12px; margin-top:5px; color:var(--muted); }
.poster-card-actions { display:flex; gap:8px; padding:12px; align-items:center; }
.poster-card-actions .button { flex:1; width:auto; min-width:0; margin:0!important; padding:8px 6px; font-size:12px; white-space:nowrap; }
.poster-card-actions .poster-delete { flex:0 0 auto; border-color:transparent; color:#a33649; background:transparent; }
.poster-delete-confirm { padding:0 12px 12px; border-top:1px solid var(--line); background:#fff7f8; }
.poster-delete-confirm p { margin:12px 0 0; font-size:13px; }
.poster-delete-confirm .poster-card-actions { padding:12px 0 0; }
.poster-library-pagination { display:flex; align-items:center; justify-content:center; gap:12px; margin:16px 0 0; font-size:13px; }
.poster-library-pagination .button { margin:0!important; font-size:13px; padding:8px 12px; }
.poster-library-empty { grid-column:1/-1; padding:48px 16px; text-align:center; border:1px dashed var(--line); border-radius:12px; }
.poster-library-empty .ui-icon { display:block; width:32px; height:32px; margin:0 auto 12px; color:var(--muted); }
.poster-library-empty p { margin-bottom:0; }
.poster-task-history { border-top:1px solid var(--line); padding-top:18px; margin-top:24px; }
.poster-task-history summary { cursor:pointer; font-weight:600; color:var(--muted); }
.poster-task-row { margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:10px; font-size:14px; }
.poster-task-row > .button { margin-top:0; font-size:13px; }
.poster-view-body .poster-preview { display:block; width:100%; max-height:70vh; margin:0; object-fit:contain; }
.poster-view-actions { display:flex; gap:10px; justify-content:center; margin-top:16px; }
.poster-view-actions .button { margin:0!important; }
.poster-create-body .poster-style-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.poster-create-body .poster-style-card { min-height:88px; border-radius:12px; }
@media(min-width:600px){ .poster-create-body .poster-style-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:420px){ .poster-library-heading { align-items:flex-start; } .poster-library-heading p { font-size:12px; } .poster-library-heading .button { font-size:13px; padding:10px; } .poster-gallery { gap:10px; } .poster-card-info { padding:10px 10px 0; } .poster-card-actions { gap:4px; padding:10px; } }

.poster-generation-body { text-align:center; }
.poster-generation-body h3 { margin:18px 0 12px; font-size:22px; }
.poster-generation-art { height:160px; border-radius:20px; display:grid; place-items:center; overflow:hidden; background:linear-gradient(110deg,#f8e9ed 20%,#eee6f4 40%,#fff5e7 60%,#f8e9ed 80%); background-size:250% 100%; animation:poster-generation-shimmer 3s ease-in-out infinite; }
.poster-generation-art .ui-icon { width:52px; height:52px; color:var(--primary); animation:poster-generation-pulse 1.8s ease-in-out infinite; }
.poster-generation-art.finished, .poster-generation-art.finished .ui-icon { animation:none; }
.poster-generation-body progress { display:block; width:100%; height:10px; accent-color:#963549; }
.poster-generation-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; margin:12px 0 20px; font-size:12px; color:var(--muted); }
.poster-generation-steps .current { color:#963549; font-weight:700; }
.poster-generation-steps .done { color:var(--text); }
.poster-generation-products { font-weight:600; overflow-wrap:anywhere; }
.poster-generation-body .receipt-actions { justify-content:center; }
@keyframes poster-generation-shimmer { 0%,100% { background-position:0 50%; } 50% { background-position:100% 50%; } }
@keyframes poster-generation-pulse { 0%,100% { transform:scale(.9); opacity:.6; } 50% { transform:scale(1.1); opacity:1; } }
@media(prefers-reduced-motion:reduce) { .poster-generation-art,.poster-generation-art .ui-icon { animation:none; } }

.automatic-copy-products{max-height:240px;overflow:auto;display:grid;gap:8px;margin:12px 0}.automatic-copy-products label{display:flex;align-items:center;gap:10px;font-size:14px;overflow-wrap:anywhere}.automatic-copy-products input[type=checkbox]{width:20px;height:20px;flex:0 0 20px}.automatic-copy-dialog textarea{width:100%;margin:12px 0;min-height:180px}.automatic-copy-dialog .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.automatic-copy-dialog > input[type=search] { width:100%; height:42px; font-size:14px; padding:10px 12px; }
.automatic-copy-products label { margin:0; padding:10px; border:1px solid var(--line); border-radius:8px; min-height:56px; }
.automatic-copy-products label > span { min-width:0; }
.automatic-copy-products strong { display:block; font-size:14px; font-weight:550; line-height:1.5; }
.automatic-copy-products small { display:block; font-size:12px; margin-top:4px; }
.automatic-copy-products input[type=checkbox] { margin:0; padding:0; }
.automatic-copy-selected { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:10px 0 16px; }
.automatic-copy-selected:empty { display:none; }
.automatic-copy-selected > small { width:100%; }
.automatic-copy-chip { max-width:100%; border:1px solid var(--line); border-radius:8px; background:#faf5f6; padding:6px 10px; font:inherit; font-size:12px; text-align:left; overflow-wrap:anywhere; cursor:pointer; }
.automatic-copy-versions { display:flex; gap:8px; margin-top:16px; }
.automatic-copy-versions .button { flex:1; min-width:0; margin:0!important; font-size:13px; padding:8px; }
.automatic-copy-versions [aria-pressed=true] { border-color:var(--primary); background:#faf0f2; color:var(--primary); }
.marketing-plan-tabs,.marketing-plan-actions { display:flex; gap:10px; margin-bottom:16px; }
.marketing-plan-tabs .button,.marketing-plan-actions .button { flex:1; min-width:0; margin:0!important; }
.marketing-plan-tabs [aria-pressed=true] { border-color:var(--primary); color:var(--primary); background:#faf0f2; }
.marketing-plan-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.marketing-plan-heading h3 { margin:0; }
.marketing-plan-product,.marketing-plan-note { margin:12px 0; padding:14px; border:1px solid var(--line); border-radius:10px; }
.marketing-plan-product p { margin:6px 0; font-size:14px; }
.marketing-plan-product small { font-size:13px; }
.marketing-plan-note h4 { margin:0 0 8px; }
.marketing-plan-note p { margin:0; line-height:1.7; }
.marketing-plan-daily textarea { width:100%; min-height:230px; margin:14px 0; }
.marketing-plan-basis { margin-top:20px; font-size:12px; }

/* Compact replenishment list; stock rules remain in their settings panel. */
.low-stock-list { display:grid; gap:6px; }
.low-stock-warning { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--line); border-left:3px solid var(--wine); border-radius:8px; }
.low-stock-copy { min-width:0; flex:1; }
.low-stock-copy strong { display:block; font-size:14px; line-height:1.4; overflow-wrap:anywhere; }
.low-stock-meta { display:flex; flex-wrap:wrap; gap:3px 10px; color:var(--muted); font-size:12px; margin-top:4px; }
.low-stock-status { color:var(--wine); font-weight:600; }
.low-stock-actions { display:flex; flex-direction:column; gap:4px; flex:none; }
.low-stock-actions .button { min-height:32px; padding:5px 10px; margin:0; white-space:nowrap; font-size:12px; }
@media(min-width:600px) { .low-stock-actions { flex-direction:row; } }
.dialog-body .low-stock-actions .button + .button { margin:0; min-height:20px; padding:0 6px; border-color:transparent; background:transparent; color:var(--muted); }

.stock-replenish-footer { position:sticky; bottom:0; z-index:2; padding:12px 16px; padding-bottom:max(12px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:#fff; }
.stock-replenish-footer .button { margin:0; width:100%; }

.marketing-editor-picker summary{cursor:pointer;font-weight:600;padding:12px 0}.marketing-editor h3{margin:18px 0 10px}.poster-picker[hidden]{display:none}.marketing-editor .automatic-copy-selected{margin:8px 0 12px}

/* A tall bottle must fit the thumbnail instead of expanding an implicit grid row. */
.sale-thumb { display:flex; align-items:center; justify-content:center; position:relative; min-width:0; min-height:0; }
.sale-thumb > img { position:absolute; inset:0; width:100%; height:100%; min-width:0; min-height:0; max-width:100%; max-height:100%; object-fit:contain; object-position:center; }

.wine-share-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.wine-share > select { width:100%; margin-bottom:14px; }
.wine-share > .wine-share-actions { margin-top:16px; }
@media(max-width:400px) { .wine-market-panel > .section-head { flex-wrap:wrap; } .wine-share > .wine-share-actions > .button { flex:1; } }

/* Merchant inquiry inbox */
.inquiry-tabs,.inquiry-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.inquiry-tabs{margin-bottom:14px}.inquiry-card{border:1px solid var(--border,#e2e5e9);border-radius:12px;padding:14px;margin:10px 0}.inquiry-heading{display:flex;gap:10px;justify-content:space-between;align-items:flex-start}.inquiry-heading strong{min-width:0;overflow-wrap:anywhere}.inquiry-card p{margin:8px 0;overflow-wrap:anywhere}.inquiry-note{white-space:pre-wrap}.inquiry-actions{margin-top:10px}.inquiry-form{display:grid;gap:12px}.inquiry-form label{display:grid;gap:6px}.inquiry-form input{min-width:0;width:100%}.inquiry-tabs .button{font-size:14px;padding:9px 12px}

.wine-public { max-width:1080px; margin:20px auto; padding-bottom:30px; }
.wine-public .wine-market-panel>.wine-share-actions { margin:16px 0; }
.wine-public .wine-common-grid { margin:16px 0 24px; }
.wine-public-join { padding:20px; border:1px solid var(--line); border-radius:12px; background:#f9f4f5; margin-top:24px; }
.wine-link-share>input { width:100%; margin-bottom:16px; }
.wine-link-share>.wine-share-actions { margin-bottom:16px; }
.wine-link-share>.button { margin-right:8px; margin-bottom:12px; }
.catalog-pagination{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:12px;padding:16px 0;flex-wrap:wrap}
.catalog-pagination .button{width:auto;min-width:88px}

/* Keep all link-share actions in one equal-size grid, including anchor buttons. */
.wine-link-share { display:flex; flex-direction:column; gap:16px; min-width:0; }
.wine-link-share > p { margin:0; }
.wine-link-share > input { width:100%; min-width:0; margin:0; }
.wine-link-share > .wine-link-actions { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; margin:0; }
.wine-link-share .wine-link-actions > .button { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; height:48px; min-width:0; min-height:48px; margin:0; padding:10px 12px; font-size:15px; line-height:20px; box-sizing:border-box; text-decoration:none; white-space:nowrap; }
.wine-link-share .wine-link-actions > .button + .button { margin:0; }
.wine-link-share .wine-link-actions .action-icon { flex:none; }
@media(max-width:360px) { .wine-link-share > .wine-link-actions { grid-template-columns:minmax(0,1fr); } }

.shelf-life-value { display:block; min-height:44px; padding:11px 12px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--ink); box-sizing:border-box; }

/* Product photo fallback follows the site's controls and mobile dialog sizing. */
.product-photo-dialog {width:min(560px,calc(100vw - 24px));max-height:90dvh;border:0;border-radius:20px;padding:0;overflow:auto;color:var(--text,#2c373d)}
.product-photo-dialog::backdrop {background:#25323d80}
.product-photo-stage {position:relative;aspect-ratio:1;background:#172126;border-radius:14px;overflow:hidden}
.product-photo-stage video {width:100%;height:100%;object-fit:contain}
.product-photo-guide {position:absolute;inset:8%;border:2px dashed #fff;border-radius:14px;color:#fff;text-align:center;padding-top:12px;text-shadow:0 1px 3px #000;background:transparent;pointer-events:none}
.product-photo-stage.preview {background:#fff}
.product-photo-stage.preview .product-photo-guide {display:none}
.product-photo-stage img {width:100%;height:100%;object-fit:contain}
.product-photo-confirm {display:flex;align-items:center;gap:12px;margin:18px 0;line-height:1.6}
.product-photo-confirm input {width:22px;height:22px;flex:none}
.product-photo-actions {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}
.product-photo-actions .button {min-height:48px;margin:0;width:100%}
.product-photo-actions [hidden] {display:none}
.image-tools>.receipt-actions {gap:12px;flex-wrap:wrap}

.product-photo-dialog [hidden] {display:none !important}
.product-photo-confirm input {padding:0;accent-color:#933547}
.product-photo-actions .button {height:100%}

.product-photo-silhouette {position:absolute;inset:18% 27%;border:2px solid #ffffffa0;border-radius:16px;pointer-events:none}
.product-photo-silhouette::before {content:'';position:absolute;top:-8%;left:25%;right:25%;height:8%;border:2px solid #ffffffa0;border-radius:6px 6px 0 0}
.product-photo-stage.front-ready .product-photo-guide,.product-photo-stage.front-ready .product-photo-silhouette {border-color:#8aefab}
.product-photo-stage.preview .product-photo-silhouette {display:none}
.product-photo-dialog .product-photo-actions .button {margin:0;height:auto;align-self:stretch}
.product-photo-dialog .product-photo-confirm input {width:22px;min-height:22px;height:22px}

.ai-recharge {display:grid;gap:20px}
.ai-recharge p,.ai-recharge .button {margin:0}
.recharge-balances {display:grid;grid-template-columns:1fr 1fr;gap:16px}
.recharge-balances>div {display:flex;flex-direction:column;gap:10px;padding:16px;background:#f5f6f8;border-radius:12px}
.recharge-balances small {color:#747e88}
.recharge-balances strong {font-size:30px}
.recharge-package {border:2px solid #933547;border-radius:16px;background:#faf3f4;padding:22px;display:grid;gap:12px}
.recharge-package-tag {font-size:13px;color:#933547}
.recharge-package-points {font-size:30px}
.recharge-package-price {font-size:32px;font-weight:700;color:#933547}
.recharge-package p,.recharge-rules p {font-size:13px;line-height:1.7}
.recharge-rules {display:grid;gap:10px}
.recharge-payment-preview {text-align:center}
.recharge-payment-preview img {width:min(260px,100%);height:auto}
.recharge-order-summary {display:flex;justify-content:space-between;align-items:center;gap:12px}
.recharge-order-summary strong {font-size:30px;color:#933547}
.dialog-body.ai-recharge .button+.button {margin-top:0}

/* Shared action controls: state changes never change button geometry. */
.collection-body { text-align:center; }
.collection-breakdown { display:flex; justify-content:center; flex-wrap:wrap; gap:4px 16px; margin:0 0 12px; font-size:14px; color:var(--muted); }
.collection-customer { text-align:left; padding:12px 0; margin-bottom:12px; border-block:1px solid var(--line); }
.collection-customer .collection-customer-name { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:10px; margin:0; }
.collection-customer details { margin-top:6px; }
.collection-customer summary { width:fit-content; padding:6px 0; cursor:pointer; font-size:14px; color:var(--muted); }
.collection-customer input,.collection-customer .entry-pair > label { min-width:0; }
.collection-customer [role=status]:empty { display:none; }

.collection-body > .muted { margin:0 0 12px; }
.collection-amount span { display:block; font-size:13px; color:var(--muted); }
.collection-amount strong { display:block; font-size:38px; color:var(--wine); margin:6px 0 18px; }
.collection-methods,.collection-actions { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.collection-methods { justify-content:center; }
.collection-methods .button,.collection-actions .button { margin:0; }
.collection-methods .button[aria-pressed=true] { color:var(--wine); border-color:var(--wine); background:#fcf3f5; }
.collection-code { display:block; width:min(100%,280px); max-height:360px; object-fit:contain; margin:12px auto; background:white; }
.collection-code[hidden] { display:none; }
.collection-ack { display:flex; align-items:center; gap:8px; text-align:left; margin:18px 0; font-size:14px; }
.collection-ack[hidden] { display:none; }
.collection-ack input[type=checkbox] { width:20px; height:20px; min-height:20px; flex:none; accent-color:var(--wine); }
.collection-body > .button { margin-top:8px; }
.payment-code-setting { padding:14px 0; border-top:1px solid var(--line); }
.payment-code-setting h3 { margin:0 0 12px; }
.payment-code-setting input[type=file] { width:100%; min-width:0; font-size:13px; }
/* Native single-choice controls keep the platform picker and a consistent chevron. */
select:not([multiple]):not([size]),select[size="1"]:not([multiple]) {
  appearance:none;
  -webkit-appearance:none;
  box-sizing:border-box;
  min-width:0;
  min-height:44px;
  padding:10px 44px 10px 14px;
  border:1px solid #dfe3e9;
  border-radius:var(--button-radius,6px);
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23687480' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:16px 16px;
  color:var(--ink);
  line-height:22px;
  cursor:pointer;
  text-overflow:ellipsis;
  transition:border-color .15s,box-shadow .15s;
}
select:not([multiple]):not([size]):hover,select[size="1"]:not([multiple]):hover { border-color:#aab3bf; }
select:not([multiple]):not([size]):focus-visible,select[size="1"]:not([multiple]):focus-visible { border-color:var(--wine); outline:2px solid #ead1d7; outline-offset:2px; }
select:not([multiple]):not([size]):disabled,select[size="1"]:not([multiple]):disabled { background-color:#f3f4f6; color:#8a929d; cursor:not-allowed; border-color:#e2e5e9; }
@media(forced-colors:active) { select:not([multiple]):not([size]),select[size="1"]:not([multiple]) { appearance:auto; -webkit-appearance:auto; background-image:none; padding-right:14px; } }
:root { --button-height:44px; --button-small-height:36px; --button-radius:6px; --button-gap:8px; }
.button { min-height:var(--button-height); border-radius:var(--button-radius); line-height:20px; vertical-align:middle; text-align:center; text-decoration:none; }
.button.small { min-height:var(--button-small-height); line-height:18px; }
.button:focus-visible { outline:2px solid var(--wine); outline-offset:2px; }
:is(.inquiry-tabs,.ai-credit-tabs,.marketing-plan-tabs,.marketing-plan-actions) { align-items:stretch; gap:var(--button-gap); }
:is(.inquiry-tabs,.ai-credit-tabs,.marketing-plan-tabs,.marketing-plan-actions) > .button { margin:0; min-height:var(--button-height); padding:9px 12px; font-size:14px; line-height:20px; border-radius:var(--button-radius); }
.inquiry-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.inquiry-tabs > .button { min-width:0; width:100%; white-space:nowrap; }
.marketplace-search { display:flex; align-items:center; gap:var(--button-gap); margin-top:14px; }
.marketplace-search input { flex:1; min-width:0; }
.marketplace-search .button { flex:none; }
.marketplace-body .inquiry-actions > .button { margin:0; }
.inquiry-section-tabs { padding-bottom:12px; border-bottom:1px solid var(--border,#e2e5e9); }
.inquiry-product-picker { display:grid; gap:6px; min-width:0; }
.inquiry-product-options { display:grid; gap:6px; max-height:240px; overflow:auto; }
.inquiry-product-options[hidden] { display:none; }
.inquiry-product-picker > .button[hidden] { display:none; }
.inquiry-product-options .inquiry-product-option { display:flex; flex-direction:column; align-items:flex-start; gap:3px; width:100%; min-width:0; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.marketplace-risk { background:#fff8ed; border:1px solid #e8d5b7; border-radius:10px; padding:12px; margin-bottom:14px; color:#614b2c; font-size:13px; line-height:1.65; overflow-wrap:anywhere; }
.marketplace-risk p { margin:6px 0; }
.marketplace-risk summary { cursor:pointer; font-weight:600; }
.marketplace-contact-note { color:var(--muted,#727b85); font-size:12px; }
.inquiry-form .marketplace-confirmation { display:flex; gap:8px; align-items:flex-start; font-size:13px; line-height:1.6; }
.inquiry-form .marketplace-confirmation input { flex:none; width:18px; height:18px; min-height:18px; padding:0; margin:2px 0 0; }
@media(max-width:360px) { .inquiry-tabs > .button { padding-inline:6px; font-size:13px; } }

/* Public merchant posts: image and one clear contact action. */
.marketplace-product-head{display:flex;gap:12px;align-items:flex-start}.marketplace-product-copy{flex:1;min-width:0}.marketplace-product-art{width:88px;height:100px;flex:none;display:flex;align-items:center;justify-content:center;background:#f6f7f8;border-radius:10px;overflow:hidden}.marketplace-product-art img{width:100%;height:100%;object-fit:contain}.marketplace-product-art .ui-icon{width:36px;height:36px;color:#929aa4}.marketplace-contact{display:flex;gap:10px;justify-content:space-between;align-items:center;margin:12px 0;flex-wrap:wrap}.marketplace-contact>span{min-width:0;overflow-wrap:anywhere}.marketplace-contact .marketplace-call{margin:0;min-height:44px;flex:none;text-decoration:none}.marketplace-upload-preview img{width:120px;height:120px;object-fit:contain;border-radius:10px;background:#f6f7f8}
@media(max-width:380px){.marketplace-product-art{width:70px;height:88px}.marketplace-product-head{gap:10px}.marketplace-card .inquiry-heading{flex-wrap:wrap}}

/* Bound merchant profile is a personal detail view; edit is explicit. */
.merchant-identity h2 {overflow-wrap:anywhere}
.merchant-details {margin:20px 0 0}
.merchant-details > div {display:grid;grid-template-columns:132px minmax(0,1fr);gap:16px;padding:16px 0;border-bottom:1px solid var(--border,#e2e5ea)}
.merchant-details dt {color:var(--muted,#747d87)}
.merchant-details dd {margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.merchant-license-preview {display:block;max-width:100%;height:auto;margin-top:16px}
@media(max-width:420px){.merchant-details > div{grid-template-columns:108px minmax(0,1fr);gap:12px}.merchant-identity .button{max-width:100%}}
.merchant-summary {padding:24px}
@media(max-width:600px){.merchant-summary{padding:16px}}

/* Records share the search row and button geometry on phone and desktop. */
.record-search-row { display:flex; flex:1 1 100%; min-width:0; gap:8px; grid-column:1 / -1; }
.record-search-row .search { flex:1; width:0; min-width:0; }
.record-search-row > .button { flex:none; white-space:nowrap; }

.merchant-chat-dialog{max-width:640px}.chat-body{display:flex;flex-direction:column;gap:10px}.chat-messages{height:min(45vh,420px);overflow:auto;display:flex;flex-direction:column;gap:12px;padding:8px;background:#f5f6f7;border-radius:10px}.chat-message{max-width:88%;padding:10px 12px;border:1px solid #e2e5e9;border-radius:12px;background:white;align-self:flex-start;overflow-wrap:anywhere}.chat-message.mine{align-self:flex-end;background:#f8e9ed;border-color:#edd5db}.chat-message p{white-space:pre-wrap;margin:5px 0 0}.chat-compose{display:flex;gap:10px;align-items:flex-end}.chat-compose textarea{flex:1;min-width:0;resize:vertical}.chat-thread{display:block;width:100%;white-space:pre-wrap;text-align:left;margin:10px 0;overflow-wrap:anywhere}.inquiry-section-tabs{flex-wrap:wrap}.chat-body h3{overflow-wrap:anywhere;margin:0}.chat-compose .button{flex-shrink:0}
.merchant-chat-dialog [hidden]{display:none!important}

.credit-form label { display:flex; flex-direction:column; gap:8px; margin:12px 0; }
.credit-form .collection-ack { flex-direction:row; align-items:center; }
.credit-form input:not([type=checkbox]),.credit-form select,.credit-form textarea { width:100%; min-width:0; padding:12px; border:1px solid var(--line); border-radius:var(--button-radius,9px); font:inherit; }
.credit-body .inquiry-card,.messages-body .inquiry-card { margin-top:12px; overflow-wrap:anywhere; }
.message-unread { border-left:3px solid var(--accent,#963447); }
.message-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.messages-body .inquiry-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; flex:1; max-width:340px; }
.message-category { display:flex; align-items:center; gap:8px; margin:0; color:var(--muted); font-size:13px; white-space:nowrap; }
.message-category select { width:120px; min-width:0; margin:0; }
.messages-body .message-card { padding:16px; margin:12px 0; border-radius:12px; }
.message-card > strong { display:block; font-size:15px; line-height:1.5; }
.message-card > p { color:var(--muted); font-size:14px; line-height:1.6; margin:8px 0 12px; }
.message-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:10px; border-top:1px solid var(--line); }
.message-footer small { min-width:0; color:var(--muted); font-size:12px; line-height:1.5; }
.message-footer .button { flex:none; margin:0; }
@media(max-width:560px) {
  .message-toolbar { flex-direction:column; align-items:stretch; gap:12px; }
  .messages-body .inquiry-tabs { max-width:none; }
  .message-category { justify-content:space-between; }
  .message-category select { width:160px; }
}

.nav-item,.menu-entry { position:relative; }
.message-count-badge { position:absolute; right:12px; top:8px; min-width:18px; padding:1px 5px; color:white; background:var(--accent,#963447); border-radius:20px; font-size:11px; line-height:18px; text-align:center; }
.message-count-badge[hidden] { display:none; }

/* Keep the channel contact and both actions visible on normal phone screens. */
.online-channel-dialog .dialog-head{padding:12px 16px}
.online-channel-dialog .dialog-body{padding:12px 16px}
.online-channel-contact .channel-intro{margin-bottom:10px}
.online-channel-contact .channel-contact-card{padding:8px}
.online-channel-contact .online-channel-identity{margin:0 0 6px;gap:10px}
.online-channel-contact .wine-contact-portrait{width:32px;height:40px}
.online-channel-contact .channel-qr-panel{padding:0 0 6px}
.online-channel-contact .contact-business-card{width:min(220px,100%);margin:6px auto}
.online-channel-contact .contact-business-photo{aspect-ratio:auto;height:min(180px,26vh)}
.online-channel-contact .contact-business-photo img{object-fit:contain}
.online-channel-contact .contact-business-photo>strong{font-size:16px;left:10px;bottom:10px}
.online-channel-contact .contact-business-bottom{padding:10px;gap:8px}
.online-channel-contact .contact-business-bottom>strong{font-size:14px}
.online-channel-contact .contact-business-qr{width:100px;height:100px}
.online-channel-contact .channel-platforms{margin-top:10px}

/* Match the compact purchasing card in the mini program. */
.wine-purchase{padding:12px 16px}.wine-purchase .wine-contact-identity{gap:10px;padding-bottom:6px}.wine-purchase .wine-contact-portrait{width:32px;height:40px;object-fit:contain}.wine-purchase .wine-contact-name h3{font-size:16px;margin:3px 0}.wine-purchase .wine-contact-product{padding:6px 10px}.wine-purchase .wine-contact-code{padding:4px 0 6px}.wine-purchase .contact-business-card{width:min(220px,100%);margin:6px auto}.wine-purchase .contact-business-photo{aspect-ratio:auto;height:min(140px,20vh)}.wine-purchase .contact-business-photo img{object-fit:contain}.wine-purchase .contact-business-photo>strong{font-size:16px;left:10px;bottom:10px}.wine-purchase .contact-business-bottom{padding:10px;gap:8px}.wine-purchase .contact-business-bottom>strong{font-size:14px}.wine-purchase .contact-business-qr{width:100px;height:100px}.wine-purchase .wine-contact-actions{padding-top:6px}

/* Mobile feedback, 2026-10-15: keep scrolling inside the active dialog. */
html:has(dialog[open]),body:has(dialog[open]) { overflow:hidden; overscroll-behavior:none; }
dialog { max-height:90vh; max-height:90dvh; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.dialog-head { position:sticky; top:0; z-index:2; background:var(--panel,#fff); }
.credit-body > .record-search-row { margin-bottom:16px; }
.credit-form > .button.secondary { margin-block:4px 16px; }
.menu-entry .message-count-badge { position:static; margin-left:auto; flex:none; align-self:center; }
.nav-item .message-count-badge { top:2px; right:calc(50% - 28px); }
.payment-settings { display:grid; gap:18px; }
.payment-settings > p { margin:0; }
.payment-code-setting { display:grid; gap:12px; min-width:0; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--panel,#fff); }
.payment-code-setting h3,.payment-code-setting p { margin:0; }
.payment-code-setting .collection-code { width:160px; max-width:100%; height:160px; object-fit:contain; justify-self:center; margin:0; }
.payment-code-setting input[type=file] { max-width:100%; padding:8px; font-size:13px; border:1px dashed var(--line); border-radius:8px; }
.payment-code-setting .collection-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0; }
.payment-code-setting .collection-actions .button { min-width:0; white-space:normal; margin:0; }
@media(min-width:700px) { dialog:has(.payment-settings) { width:min(760px,calc(100vw - 40px)); } .payment-settings { grid-template-columns:repeat(2,minmax(0,1fr)); } .payment-settings > p { grid-column:1/-1; } }

/* Contact panels: one advisor identity, a readable QR, then contact actions. */
.online-channel-contact .channel-contact-card{padding:14px;background:#fff}
.online-channel-contact .online-channel-identity,.wine-purchase .wine-contact-identity{gap:12px;margin:0;padding-bottom:12px;border-bottom:1px solid var(--line)}
.online-channel-contact .wine-contact-portrait,.wine-purchase .wine-contact-portrait{width:44px;height:44px;border-radius:10px;object-fit:cover;object-position:center 22%}
.online-channel-contact .channel-qr-panel{padding:0;background:transparent}
.online-channel-contact .contact-business-card,.wine-purchase .contact-business-card,.customer-support-body .contact-business-card{width:100%;max-width:280px;border:0;border-radius:0;margin:12px auto 8px;background:transparent}
.online-channel-contact .contact-business-bottom,.wine-purchase .contact-business-bottom,.customer-support-body .contact-business-bottom{display:flex;flex-direction:column;align-items:center;padding:0;gap:8px}
.online-channel-contact .contact-business-qr,.wine-purchase .contact-business-qr,.customer-support-body .contact-business-qr{width:176px;height:176px;object-fit:contain;padding:8px;border:1px solid var(--line);border-radius:12px;background:#fff;box-sizing:content-box}
.online-channel-contact .contact-business-bottom>strong,.wine-purchase .contact-business-bottom>strong,.customer-support-body .contact-business-bottom>strong{font-size:12px;color:var(--muted);padding:0;font-weight:400}
.online-channel-contact .channel-platforms{gap:10px;margin-top:14px}
.customer-support-body{text-align:center}

.merchant-page { display:grid; gap:16px; }
.merchant-payment-entry { padding:20px 24px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.merchant-payment-copy { min-width:0; }
.merchant-payment-copy h2 { margin:0 0 8px; }
.merchant-payment-copy p { margin:0; line-height:1.6; }
.merchant-payment-entry > .button { flex-shrink:0; }
@media(max-width:600px) {
  .merchant-page { gap:12px; }
  .merchant-payment-entry { padding:16px; flex-direction:column; align-items:stretch; gap:16px; }
  .merchant-payment-entry > .button { width:100%; min-height:44px; }
}

/* Shared business-page rhythm; keep camera controls and transaction behavior intact. */
.scan-box .button { min-height:44px; }
:root { --button-radius:8px; --button-gap:12px; }
.panel { border-radius:12px; }
.button { min-width:0; overflow-wrap:anywhere; }
.button .ui-icon { flex-shrink:0; }
:is(.receipt-actions,.dialog-actions,.row-actions,.collection-actions,.poster-card-actions,.poster-view-actions,.marketing-plan-actions,.inquiry-actions) { gap:var(--button-gap); }
:is(.dialog-actions,.row-actions,.poster-card-actions,.poster-view-actions,.marketing-plan-actions) { flex-wrap:wrap; align-items:stretch; }
:is(.receipt-actions,.dialog-actions,.row-actions,.poster-card-actions,.poster-view-actions,.marketing-plan-actions,.inquiry-actions) > .button { margin:0; }
.receipt-actions { flex-wrap:wrap; }
.receipt-actions > .button { flex:1 1 120px; min-height:44px; font-size:13px; padding:10px 12px; }
.dialog-actions > .button { flex:1 1 120px; }
.dialog-head { gap:12px; align-items:center; }
.dialog-head h2 { min-width:0; line-height:1.5; }
.dialog-head > .icon-button { flex:none; width:44px; height:44px; padding:10px; border-radius:8px; background:#f5f6f8; }
form.dialog-body { display:grid; gap:16px; }
form.dialog-body > :is(label,p,.error,.button) { margin:0; }
form.dialog-body > :is(.error,[role=status]):empty { display:none; }
form.dialog-body > label { gap:8px; }
form.dialog-body > .button.wide + .button.wide { margin-top:0; }
:is(.credit-body,.messages-body) { line-height:1.6; }
.credit-body { display:grid; gap:14px; }
.credit-body > :is(p,h3) { margin:0; }
.credit-body .inquiry-card { display:grid; gap:12px; margin:14px 0 0; }
.credit-body .inquiry-card > :is(p,.button) { margin:0; }
.messages-body > div > .button { margin:12px 0 0; }
.message-footer { flex-wrap:wrap; }
.inquiry-section-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
.subpage-head { flex-wrap:wrap; }
@media(max-width:800px) {
  .page-main { padding-inline:16px; }
  .page-main > .panel + .panel { margin-top:16px; }
  .section-head { gap:12px; padding:16px; }
  .section-head > div { min-width:0; }
  .section-head h2 { line-height:1.5; }
  .section-head p { line-height:1.6; }
  .button.small,.row-actions .button,.records-panel .section-head .button,.record-filters > .button { min-height:44px; font-size:13px; padding:10px 12px; }
  .inventory-panel .section-head > .button { font-size:13px; }
  .inventory-panel tbody tr { padding-top:16px; padding-bottom:16px; row-gap:8px; }
  .inventory-panel td:nth-child(6) { margin-top:8px; }
  .inventory-panel .row-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .inventory-panel .row-actions .button { width:100%; white-space:normal; }
  .inventory-panel .row-actions .ui-icon { width:16px; height:16px; }
  .records-panel tbody tr { padding:16px; row-gap:10px; }
  .record-filters { gap:12px; padding:0 16px 16px; }
  .record-search-row { gap:10px; }
  .record-count { line-height:1.6; }
  .menu-entry { padding:18px 16px; }
  .menu-entry-copy { gap:6px; }
  .menu-entry-copy small { font-size:12px; line-height:1.6; }
  .management-grid { gap:16px 6px; }
  .management-tool { gap:10px; min-height:72px; }
  .dialog-body { padding:18px 16px; }
  .dialog-head { padding:12px 16px; }
  .dialog-body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) { font-size:16px; }
  .inquiry-tabs { gap:10px; }
  .inquiry-tabs > .button { padding:10px 8px; font-size:13px; white-space:normal; }
  .message-card { padding:16px; }
  .message-category select { flex:1; width:auto; min-width:0; }
  .message-category { gap:16px; }
  .message-category > span { flex-shrink:0; }
  .wine-market-panel > .section-head { display:flex; flex-direction:column; align-items:stretch; gap:12px; }
  .wine-market-panel > .section-head h2 { margin:0; }
  .wine-market-panel > .section-head > .wine-share-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; width:100%; margin:0; }
  .wine-market-panel > .section-head .wine-share-actions > .button { width:100%; min-height:44px; font-size:13px; white-space:normal; margin:0; }
  .wine-market-panel > .section-head .wine-share-actions > .button:last-child { grid-column:1 / -1; }
  .stats .stat small { font-size:11px; line-height:1.6; }
  .stats .stat { min-width:0; }
  .stats .stat strong { overflow-wrap:anywhere; }
  .poster-ready-notice { gap:12px; }
}
@media(max-width:360px) {
  .page-main { padding-inline:12px; }
  .entry-pair { grid-template-columns:minmax(0,1fr); row-gap:12px; }
  .management-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .stats:not(.cost-stats) { grid-template-columns:repeat(2,minmax(0,1fr)); row-gap:12px; }
  .stats:not(.cost-stats) .stat:last-child:nth-child(odd) { grid-column:1 / -1; }
}

.dialog-head > .icon-button:focus-visible { outline:2px solid var(--wine); outline-offset:2px; }

/* Marketplace and birthday wine share one spacing and control scale. */
dialog.marketplace-dialog { width:min(720px,calc(100vw - 24px)); max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); overflow:hidden; border-radius:14px; }
dialog.marketplace-dialog[open] { display:flex; flex-direction:column; }
.marketplace-dialog > .dialog-head { flex:none; padding:12px 16px; gap:12px; }
.marketplace-dialog > .dialog-head h2 { margin:0; font-size:18px; line-height:26px; }
.marketplace-dialog > .dialog-head .icon-button { width:44px; height:44px; flex:none; margin:0; }
.marketplace-dialog > .dialog-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:16px; }
.marketplace-body,.marketplace-dialog .birthday-body { display:grid; gap:16px; }
.marketplace-dialog .button { min-height:44px; padding:10px 12px; font-size:14px; line-height:22px; border-radius:var(--button-radius); }
.marketplace-body > p,.birthday-intro > p { margin:0; font-size:13px; line-height:1.7; }
.marketplace-body .inquiry-section-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; padding:0; border:0; }
.marketplace-body .inquiry-section-tabs > .button { background:#f5f6f7; border-color:transparent; color:var(--ink); }
.marketplace-body .inquiry-section-tabs > .button[aria-pressed="true"] { background:#f8e9ed; color:var(--wine); border-color:#ead3d9; font-weight:600; }
.marketplace-body .marketplace-birthday-entry { display:grid; grid-template-columns:24px minmax(0,1fr) 16px; grid-template-rows:auto auto; column-gap:12px; row-gap:2px; width:100%; min-height:68px; margin:0; padding:12px 14px; text-align:left; background:#fff9f2; border:1px solid #eddcc3; }
.marketplace-birthday-entry > .ui-icon { grid-row:1 / 3; align-self:center; color:#986526; width:24px; height:24px; }
.marketplace-birthday-entry > .button-label { grid-column:2; font-size:15px; font-weight:600; }
.marketplace-birthday-entry > small { grid-column:2; color:#806f59; font-size:12px; line-height:18px; }
.marketplace-birthday-entry > .marketplace-entry-arrow { grid-column:3; grid-row:1 / 3; align-self:center; color:#986526; font-size:24px; }
.marketplace-controls { display:grid; gap:12px; min-width:0; padding:12px; background:#f7f8fa; border:1px solid #edf0f2; border-radius:10px; }
.marketplace-controls .marketplace-filters { margin:0; gap:8px; }
.marketplace-controls .inquiry-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; }
.marketplace-controls .inquiry-actions > .button { width:100%; min-width:0; margin:0; white-space:normal; }
.marketplace-controls .inquiry-actions > .birthday-stock-entry { grid-column:1 / -1; }
.marketplace-controls > .muted { margin:0; font-size:12px; line-height:1.7; }
.marketplace-controls > .muted:empty { display:none; }
.marketplace-controls .marketplace-search { margin:0; gap:8px; }
.marketplace-controls .marketplace-search input { height:44px; min-height:44px; padding:10px 12px; font-size:16px; border-radius:var(--button-radius); }
.marketplace-controls .marketplace-search > .button { min-width:64px; margin:0; }
.marketplace-body .marketplace-risk { margin:0; padding:12px; border-color:#e8e1d6; background:#fdfaf5; font-size:12px; line-height:1.7; }
.marketplace-body .marketplace-risk > strong { font-size:13px; }
.marketplace-body .marketplace-risk summary { font-weight:500; }
.marketplace-list { display:grid; gap:12px; min-width:0; }
.marketplace-list > .inquiry-card { margin:0; padding:14px; }
.marketplace-list .inquiry-card > strong,.marketplace-list .inquiry-heading strong { font-size:15px; line-height:1.5; }
.marketplace-list .inquiry-card p { font-size:13px; line-height:1.7; }
.marketplace-list > .marketplace-empty { margin:0; padding:24px 12px; text-align:center; font-size:13px; line-height:22px; background:#f8f9fa; border:1px dashed #e0e4e8; border-radius:10px; }
.birthday-intro { display:grid; gap:12px; }
.birthday-intro > .button { justify-self:start; margin:0; }
.marketplace-dialog .inquiry-form { gap:16px; }
.marketplace-dialog .inquiry-form label { margin:0; font-size:13px; }
.marketplace-dialog .inquiry-form > p { margin:0; font-size:12px; }
@media(min-width:600px) { .marketplace-body .inquiry-section-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); } .marketplace-dialog > .dialog-body { padding:20px; } }
@media(max-width:360px) { .marketplace-dialog > .dialog-body { padding:12px; } .marketplace-controls { padding:10px; } .marketplace-dialog .button { padding-inline:8px; font-size:13px; } }

/* Staged merchant onboarding shares the workbench buttons and layout. */
.onboarding-main .panel { padding: 20px; }
.onboarding-main h2 { margin: 0 0 10px; }
.onboarding-main p { line-height: 1.65; margin: 0 0 16px; }
.onboarding-main .entry-pair { row-gap: 10px; }
.onboarding-actions { display: grid; gap: 10px; }
@media (max-width: 600px) { .onboarding-main .panel { padding: 16px; } }

.wine-range-switch { display:flex; gap:8px; margin:12px 0; }
.wine-range-switch > .button { flex:1; min-width:0; margin:0; }
.wine-range-switch > .button[aria-pressed="true"] { color:#933547; border-color:#933547; background:#f9edef; }

.wine-price-chart { touch-action:none; }
.chart-cursor { stroke:#933547; stroke-dasharray:4 4; }
.chart-focus { fill:#933547; stroke:#fff; stroke-width:2; }
.chart-tooltip { fill:#933547; }
.chart-tooltip-text { fill:#fff; font-size:18px; font-weight:700; }

.wine-chart-readout { min-height:32px; margin:12px 0 0; font-size:20px; font-weight:700; color:#933547; }

/* Compact camera controls stay visible on mobile; served under style-src self. */
.camera-dialog .button[hidden]{display:none}.camera-dialog{display:flex;flex-direction:column;max-height:90vh;max-height:90dvh;overflow:hidden}.camera-dialog .dialog-head{flex-shrink:0}.camera-dialog .dialog-body{overflow-y:auto;min-height:0}.camera-dialog .scan-hint{margin:0 0 10px;line-height:1.5}.camera-dialog .date-capture-action{position:sticky;top:0;z-index:2;margin:0 0 12px;background:#fff}.camera-dialog .camera-stage{margin-bottom:12px}.camera-dialog:not(.date-camera-dialog) video{width:100%!important;height:clamp(180px,32vh,280px)!important;max-height:none;object-fit:cover;object-position:center;display:block}.camera-dialog .scan-modes{margin-bottom:10px}.camera-dialog .scan-modes button{padding:6px 4px;gap:3px}.camera-dialog .camera-actions{display:flex;gap:10px;flex-wrap:wrap}.camera-dialog .camera-actions .button.wide{flex:1;min-width:120px;width:auto;margin:0}

/* First-level member directory uses the same spacing as other management panels. */
.members-main > .panel { padding:20px; }
.members-main .credit-body > h2 { margin:0; }
.members-main .credit-body > .button { justify-self:start; }
.member-toolbar { display:flex; align-items:center; justify-content:space-between; gap:var(--button-gap); min-width:0; }
.member-toolbar h2 { margin:0; }
.member-toolbar > .button { margin:0 0 0 auto; flex:none; white-space:nowrap; }
.member-search-tools { display:flex; align-items:center; gap:var(--button-gap); min-width:0; width:100%; }
.member-search-tools .record-search-row { flex:1; width:100%; max-width:none; margin:0; }
.member-search-tools > .button { margin:0; flex:none; white-space:nowrap; }
.member-list { display:grid; gap:8px; min-width:0; }
.credit-body .member-card.inquiry-card { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; margin:0; padding:10px; }
.member-card-info { display:grid; gap:4px; min-width:0; line-height:1.45; }
.member-card-info p { margin:0; font-size:13px; }
.member-card-meta { display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 12px; min-width:0; }
.member-card-actions { display:flex; flex-direction:column; align-items:flex-end; gap:var(--button-gap); }
.member-card-actions > .button { flex:none; width:auto; margin:0; white-space:nowrap; }
@media (max-width:600px) {
  .member-search-tools { flex-wrap:wrap; }
  .member-search-tools .record-search-row { flex-basis:100%; }
  .member-search-tools > .button { margin-left:auto; }
}
@media (max-width:800px) {
  .members-main > .panel { padding:16px; }
}
.member-loyalty { color:var(--wine);font-weight:600;overflow-wrap:anywhere; }
.member-points-summary { background:var(--mint);border-radius:var(--radius,10px);padding:16px; }
.member-points-summary h3,.member-points-summary p { margin:0 0 8px; }
.member-detail { gap:12px; }
.member-detail-actions { display:flex; align-items:center; justify-content:space-between; gap:var(--button-gap); }
.member-detail-actions > .button { width:auto; margin:0; white-space:nowrap; }
.member-detail-profile,.member-detail-section { display:grid; gap:6px; min-width:0; }
.member-detail-profile > :is(h3,p),.member-detail-section > :is(h3,p) { margin:0; }
.member-detail-profile > p { font-size:13px; }
.member-detail .member-points-summary { padding:12px; display:grid; gap:4px; }
.member-detail .member-points-summary > :is(h3,p) { margin:0; }
.member-detail .member-points-summary p { font-size:13px; }
.credit-body .member-entry.inquiry-card { display:grid; gap:4px; margin:0; padding:10px; line-height:1.45; }
.member-entry p,.member-detail-extra p { margin:0; font-size:13px; }
.member-entry-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:2px 8px; min-width:0; }
.member-entry-time,.member-entry-meta { font-size:12px; color:var(--muted); }
.member-entry-time { white-space:nowrap; }
.member-entry-meta,.member-detail-extra .mono { overflow-wrap:anywhere; }
.member-entry-items { display:grid; gap:2px; min-width:0; }
.member-detail-extra { min-width:0; font-size:13px; }
.member-detail-extra > summary { cursor:pointer; color:var(--muted); padding:4px 0; line-height:1.45; }
.member-detail-extra[open] > summary { margin-bottom:4px; }
.member-detail-extra p + p { margin-top:4px; }
.member-tier-fields { border:1px solid var(--line);border-radius:8px;padding:12px;min-width:0;display:grid;gap:10px; }
.member-tier-fields input { min-width:0;width:100%;box-sizing:border-box; }
.member-birthday { display:flex; gap:var(--gap,12px); align-items:center; flex-wrap:wrap; }
.member-birthday-selects { display:flex; gap:12px; flex:1; min-width:180px; }
.member-birthday-selects select { flex:1; min-width:0; width:50%; }
.member-birthday .button { margin:0; }

/* Keep the exact submitted date image stable while candidates await review. */
.date-scan-frame{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#1c2924;z-index:1}.date-scan-frame[hidden]{display:none}.camera-stage.date-frame-fixed .scan-aim{display:none}.date-camera-dialog .date-scan-choices:empty{display:none}

/* Shared scanner chrome; date content inherits these same design tokens. */
.camera-dialog .camera-light-status{position:absolute;top:10px;right:10px;margin:0!important;padding:4px 8px;border-radius:6px;background:var(--mint);color:var(--green);font-size:12px;z-index:3;pointer-events:none}.camera-dialog .scan-modes[hidden]{display:none}.camera-dialog .camera-actions .button{min-height:var(--button-height,44px);border-radius:var(--button-radius,8px)}.date-original-dialog .dialog-body{padding:16px}.date-original-dialog .dialog-head{border-bottom:1px solid var(--line)}

/* Staged merchant onboarding shares the workbench buttons and layout. */
.onboarding-main .panel { padding: 20px; }
.onboarding-main h2 { margin: 0 0 10px; }
.onboarding-main p { line-height: 1.65; margin: 0 0 16px; }
.onboarding-main .entry-pair { row-gap: 10px; }
.onboarding-actions { display: grid; gap: 10px; }
@media (max-width: 600px) { .onboarding-main .panel { padding: 16px; } }



/* Same product pages remain visible while review restricts concrete actions. */
.onboarding-notice { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; margin-bottom:16px; }
.onboarding-notice p { margin:6px 0 0; line-height:1.5; }
.onboarding-notice > .button { flex-shrink:0; }
.review-status-body > p { line-height:1.65; }
@media(max-width:420px){ .onboarding-notice { align-items:flex-start; flex-direction:column; } }

/* Audit/support contacts live on My account, outside action prompts. */
.support-contact-card { padding:14px; scroll-margin-block:80px; }
.support-contact-card > h2 { font-size:15px; margin-bottom:10px; }
.support-contact-content { display:grid; grid-template-columns:minmax(0,1fr) 128px; align-items:center; gap:12px; }
.support-contact-content.no-qr { grid-template-columns:minmax(0,1fr); }
.support-contact-details { min-width:0; overflow-wrap:anywhere; }
.support-contact-name { margin:8px 0; font-weight:600; }
.support-contact-phone { min-height:40px; max-width:100%; padding:8px 10px; white-space:normal; }
.support-contact-code { text-align:center; }
.support-contact-qr { display:block; width:128px; max-width:100%; height:auto; margin:0 auto 4px; object-fit:contain; }
@media(max-width:800px) {
  .account-dialog[open] { display:flex; flex-direction:column; width:min(390px,calc(100vw - 32px)); max-height:min(640px,calc(100dvh - 32px)); overflow:hidden; }
  .account-dialog > .dialog-head { flex:none; padding:10px 14px; gap:8px; }
  .account-dialog > .dialog-head h2 { font-size:16px; line-height:1.35; }
  .account-dialog > .dialog-head .icon-button { width:36px; height:36px; min-height:36px; flex:none; }
  .account-dialog > .dialog-body { min-height:0; overflow-y:auto; padding:12px 14px; overscroll-behavior:contain; }
  .account-dialog > .dialog-body > p { font-size:12px; line-height:1.5; }
  .account-dialog .button.wide { min-height:42px; padding:9px 12px; }
  .account-dialog .dialog-body > .button.wide + .button.wide { margin-top:8px; }
  .account-dialog .merchant-form > button[type=submit] { position:sticky; bottom:0; z-index:1; box-shadow:0 -6px 0 3px white; }
}
@media(max-width:360px) {
  .support-contact-content { grid-template-columns:minmax(0,1fr) 112px; gap:8px; }
  .support-contact-qr { width:112px; }
}

/* Compact account cards keep readable inset and paragraph/action spacing. */
@media(max-width:800px) {
  .dialog-body { padding:14px 16px; }
  .account-dialog > .dialog-head { padding:12px 18px; }
  .account-dialog > .dialog-body { padding:16px 18px; }
  .account-dialog > .dialog-body > p { font-size:13px; line-height:1.65; }
  .account-dialog > .dialog-body > p + p { margin-top:8px; }
  .account-dialog > .dialog-body > p + .button { margin-top:14px; }
  .support-contact-card { padding:16px; }
}

/* Registration cards use the same generous text inset as review cards. */
@media(max-width:800px) {
  .account-dialog[open] { width:min(360px,calc(100vw - 32px)); }
  .account-dialog > .dialog-head { padding:14px 24px; }
  .account-dialog > .dialog-body { padding:18px 24px; }
  .account-dialog input:not([type=checkbox]):not([type=radio]),.account-dialog select,.account-dialog textarea { padding-inline:12px; }
}
@media(max-width:360px) {
  .account-dialog .phone-code-entry .button { padding-inline:10px; font-size:12px; }
}

/* Mobile dialogs: preserve text inset while reducing unused vertical space. */
@media(max-width:800px) {
  dialog:not(.account-dialog) > .dialog-head { padding:12px 20px; }
  dialog:not(.account-dialog) > .dialog-head h2 { margin:0; }
  dialog:not(.account-dialog) > .dialog-body { padding:14px 20px; }
  dialog:not(.account-dialog) > .dialog-body > p { margin-block:8px; line-height:1.6; }
  dialog:not(.account-dialog) > .dialog-body > p:first-child { margin-top:0; }
  dialog:not(.account-dialog) > form.dialog-body { gap:12px; }
  dialog:not(.account-dialog) > form.dialog-body > p { margin:0; }
  dialog:not(.account-dialog) .dialog-actions { margin-top:12px; gap:8px; }
  dialog:not(.account-dialog) .dialog-body > .button.wide + .button.wide { margin-top:8px; }
}

.onboarding-examples{border:1px dashed #c7cdd5;background:#fbfcfd}.onboarding-examples h2{margin:0 0 8px}.onboarding-examples .muted{margin:0 0 12px}.onboarding-example-row{display:flex;align-items:flex-start;gap:10px;padding:12px 0;border-top:1px solid #e7e9ec;overflow-wrap:anywhere}.onboarding-example-tag{flex:none;border-radius:4px;background:#edf0f3;color:#626b75;padding:2px 7px;font-size:12px;line-height:1.5}

/* Public quotation controls: stable sizes in both selected states. */
.wine-filter-types { display:flex; gap:8px; margin:14px 0; }
.wine-filter-types > button { flex:1; min-width:0; margin:0; }
.wine-filter-selects { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:12px 0; }
.wine-filter-selects label { display:flex; flex-direction:column; gap:5px; min-width:0; font-size:12px; }
.wine-filter-selects select { width:100%; min-width:0; min-height:38px; border:1px solid #dce2e7; border-radius:8px; background:#fff; color:#25323a; font-size:12px; padding:6px; }
.wine-filter-hint { font-size:12px; line-height:1.6; margin:10px 0; }
.wine-filter-types [aria-pressed="true"] { color:#933547; border-color:#933547; background:#fff3f4; }

/* Searchable trace product and counterparty fields. */
.trace-suggest{min-width:0;position:relative}.trace-suggest input{width:100%}.trace-suggestions{max-height:280px;overflow:auto;border:1px solid var(--line);border-radius:var(--button-radius,8px);margin-top:6px;background:var(--white,#fff)}.trace-suggestions[hidden]{display:none}.trace-suggestion{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;min-height:var(--button-height,44px);padding:10px 12px;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;color:inherit;overflow-wrap:anywhere}.trace-suggestion small{font-weight:normal;color:var(--muted)}.trace-suggestion:hover,.trace-suggestion[aria-selected=true]{background:var(--mint,#f3f6f4)}.trace-suggest-hint{font-size:12px;margin:6px 0}.trace-party-fields h3{margin-top:0}.trace-unit-queue{max-height:200px;overflow:auto}.trace-unit-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid var(--line)}.trace-unit-row .trace-code{min-width:0;overflow-wrap:anywhere}.trace-unit-row .button{flex:none;margin:0}.trace-party-fields .entry-pair>label{min-width:0}
.trace-suggestions{position:absolute;top:48px;left:0;right:0;z-index:20;margin-top:0;box-shadow:0 6px 18px #0002}

/* Let the account workspace use the available desktop width. */
.account-main { max-width:none; width:100%; }
@media(min-width:1100px) {
  .account-main { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:stretch; }
  .account-main > .panel { margin:0; min-width:0; }
  .account-main > :is(.account-card,.support-contact-card,.menu-group,.account-brand) { grid-column:1 / -1; }
  .account-main .management-tools { padding:18px; }
  .account-main .management-tools h2 { margin-bottom:14px; }
  .account-main .management-grid { gap:10px; }
  .account-main .management-grid:not(:has(> :nth-child(5))) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .account-main .management-tool { min-height:76px; padding:10px 6px; gap:8px; border:1px solid #edf0f4; border-radius:8px; background:#fafbfc; }
  .account-main .management-tool:hover { background:#faf0f1; }
  .account-main .menu-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; }
  .account-main .menu-group > h2 { grid-column:1 / -1; padding-bottom:12px; }
  .account-main .menu-entry { min-width:0; padding:16px 20px; border-top:1px solid var(--line); }
  .account-main .menu-group > .menu-entry:last-child:nth-child(even) { grid-column:1 / -1; }
  .account-main .menu-entry-copy { min-width:0; overflow-wrap:anywhere; }
  .account-main .account-profile-link { min-width:0; }
  .account-main .account-profile-link .muted { overflow-wrap:anywhere; }
}

/* 2026-10-22: compact product and inbound forms, with unchanged business handlers. */
dialog:has(> .product-registration),dialog:has(> .entry-inbound-form){width:min(540px,calc(100vw - 24px))}
dialog:has(> .product-registration) > .dialog-head,dialog:has(> .entry-inbound-form) > .dialog-head{padding:10px 16px}
form.dialog-body.product-registration,form.dialog-body.entry-inbound-form{gap:10px;padding:12px 16px 14px;scroll-padding-bottom:76px}
:is(.product-registration,.entry-inbound-form) label{margin:0;gap:5px;font-size:12px;line-height:1.45}
:is(.product-registration,.entry-inbound-form) :is(input,select,textarea):not([type=checkbox]):not([type=file]){min-width:0;font-size:16px;min-height:44px;padding:9px 10px;border-radius:8px}
:is(.product-registration,.entry-inbound-form) .button{min-height:44px;border-radius:8px;padding:9px 10px;line-height:1.35;gap:6px}
:is(.product-registration,.entry-inbound-form) .muted{font-size:12px;line-height:1.5}
.product-registration .product-entry-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.product-registration .product-entry-fields > label{margin:0}
.product-registration .product-identity{margin:0}
.product-registration .product-identity > label,.product-registration .product-identity > .standard-name-panel{grid-column:1/-1}
.product-registration .standard-name-panel{margin:0;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.product-registration .name-status{flex:1;min-width:160px;margin:0;color:var(--muted);font-size:12px}
.product-registration .standard-name-choices:empty{display:none}
.product-registration .standard-name-choices:not(:empty){flex-basis:100%}
.product-registration .standard-name-panel > .button{background:var(--white,#fff);border-color:var(--line);color:var(--ink);font-size:12px}
.product-registration .entry-scan-section{display:grid;gap:6px;padding:2px 0;border:0;border-radius:0;background:transparent}
.entry-scan-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.product-registration .entry-scan-actions > .button{margin:0;width:100%;font-size:13px;white-space:normal;justify-content:center}
.entry-scan-actions > .button:first-child{background:var(--white,#fff);border-color:var(--line);color:var(--ink)}
.entry-scan-actions > .button:last-child{background:var(--white,#fff);border-color:var(--line);color:var(--ink)}
.product-registration .registration-trace-panel,.product-registration .date-ocr-panel{margin:0;padding:0;gap:6px;min-width:0}
.product-registration .registration-trace-panel > p{margin:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.product-registration .registration-trace-panel > .button{min-height:44px;margin:4px 0 0;color:var(--wine);background:var(--white,#fff);border-color:var(--line)}
.product-registration .date-manual{margin:0;padding:0;border:0;background:transparent}
.product-registration .date-manual > summary{min-height:32px;display:list-item;align-content:center;font-size:12px;color:var(--muted);cursor:pointer}
.product-registration .date-ocr-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.product-registration .entry-stock-fields > .registration-pack-hint{grid-column:1/-1;margin:0;font-size:12px;line-height:1.5}
.product-registration .entry-stock-fields > .registration-pack-hint:empty{display:none}
.product-registration .entry-supplier-field{padding-top:8px;border-top:1px solid var(--line)}
.product-registration .registration-tools,.product-registration .entry-product-more{margin:0;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--white,#fff);font-size:12px}
.product-registration :is(.registration-tools,.entry-product-more)>summary{cursor:pointer;color:var(--muted);min-height:24px;line-height:24px}
.product-registration .entry-product-more .product-image-preview:not([hidden]){padding:6px;margin:8px 0;justify-content:flex-start;background:transparent;border:0}
.product-registration .entry-product-more .product-image-preview img{width:56px;height:56px;object-fit:contain}
.product-registration .entry-product-more .catalog-detail-preview:not([hidden]){margin:6px 0;padding:8px;font-size:12px;line-height:1.5}
.product-registration .entry-product-more .catalog-detail-preview p{margin:3px 0}
.product-registration .image-tools{gap:6px}
.product-registration .image-tools .button{font-size:12px;background:var(--white,#fff);color:var(--ink);border-color:var(--line)}
.product-registration .entry-save-actions{position:sticky;bottom:-14px;margin:0 -16px -14px;padding:10px 16px max(10px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);z-index:1}
.product-registration .entry-save-actions > .button{width:100%;margin:0;background:var(--wine,#a43d4b);color:#fff;border-color:transparent}
.entry-inbound-form > p:first-child{margin:0;font-size:14px;font-weight:600}
.entry-inbound-form .entry-pair{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.entry-inbound-form .trace-party-fields{padding:10px 0;border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);border-radius:0;background:transparent;margin:0}
.entry-inbound-form .trace-party-fields h3{font-size:13px;margin:0 0 8px;color:var(--ink)}
.entry-inbound-form .trace-party-fields label{margin:0}
.entry-inbound-form .trace-suggest-hint{margin:4px 0;font-size:12px}
.entry-inbound-form .party-more{margin-top:6px;font-size:12px}
.entry-inbound-form .party-more > summary{min-height:32px;line-height:32px;color:var(--muted);cursor:pointer}
.entry-inbound-form .trace-party-fields [role=status]:empty{display:none}
.entry-inbound-form .inbound-code-panel,.entry-inbound-form .date-ocr-panel{gap:6px;margin:0}
.entry-inbound-form .inbound-code-panel > p{margin:0;font-size:12px;line-height:1.5}
.entry-inbound-form .inbound-code-panel > .button{background:var(--white,#fff);border-color:var(--line);color:var(--ink);margin:0}
.entry-inbound-form .date-ocr-panel > .button{background:var(--white,#fff);border-color:var(--line);color:var(--ink);margin:0}
:is(.product-registration,.entry-inbound-form) :is(.button,input,select):focus-visible{outline:2px solid var(--wine);outline-offset:2px}
@media(min-width:600px){form.dialog-body.product-registration,form.dialog-body.entry-inbound-form{padding:16px 20px 18px}.product-registration .entry-save-actions{margin:0 -20px -18px;bottom:-18px;padding:10px 20px}}

.compact-input-suggestions{min-width:0;position:relative}
.compact-input-options{position:fixed;z-index:20;max-height:176px;overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 5px 18px #28141c22;padding:3px;box-sizing:border-box}
.compact-input-options[hidden]{display:none}
.compact-input-option{display:block;width:100%;min-height:40px;border:0;border-radius:4px;background:#fff;color:var(--ink);font:inherit;font-size:16px;text-align:left;padding:8px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
.compact-input-option:hover,.compact-input-option[aria-selected=true]{background:#f7eef0;color:var(--wine)}
.product-registration .standard-name-choices{max-height:min(220px,30dvh);overflow-y:auto;overscroll-behavior:contain}
.camera-zoom{display:flex;align-items:center;gap:8px;margin:8px 0}
.camera-zoom[hidden]{display:none}
.camera-zoom input{min-width:0;flex:1}
/* Continuous entry: readable controls, less whitespace, fixed save action. */
dialog.compact-entry-dialog{display:flex;flex-direction:column;box-sizing:border-box;width:min(540px,calc(100vw - 20px));max-height:calc(100dvh - 20px);overflow:hidden;padding:0}
dialog.compact-entry-dialog:not([open]){display:none}
.compact-entry-dialog>.dialog-head{flex:none;padding:8px 14px!important}
.compact-entry-dialog>.dialog-head h2{font-size:19px}
.compact-entry-dialog>form.dialog-body{display:flex!important;flex-direction:column;min-height:0;gap:0!important;padding:0!important;overflow:hidden}
.compact-entry-dialog .entry-content{padding:10px 14px;display:grid;gap:8px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding:12px}
.compact-entry-dialog .entry-save-actions{position:static!important;flex:none;margin:0!important;padding:8px 14px max(8px,env(safe-area-inset-bottom))!important;border-top:1px solid var(--line);background:#fff}
.compact-entry-dialog .entry-save-actions>.button{margin:0;width:100%;min-height:44px}
.compact-entry-dialog .entry-save-actions>.error{margin:0 0 6px;max-height:64px;overflow-y:auto;font-size:13px;line-height:1.4}
.compact-entry-dialog .entry-save-actions>.error:empty{display:none}
.compact-entry-dialog label{font-size:13px!important;gap:4px!important;margin:0!important;line-height:1.4}
.compact-entry-dialog :is(input,select,textarea):not([type=checkbox]):not([type=file]){font-size:16px!important;min-height:44px;padding:8px 10px!important}
.compact-entry-dialog :is(.product-entry-fields,.entry-pair){grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}
.compact-entry-dialog .product-identity{gap:6px!important}
.compact-entry-dialog .standard-name-panel{gap:4px 6px}
.compact-entry-dialog .name-status{font-size:12px;line-height:1.45;min-width:130px}
.compact-entry-dialog .standard-name-panel>.button{min-height:36px;padding:6px 8px}
.compact-entry-dialog .standard-name-choices{max-height:132px;overflow-y:auto}
.compact-entry-dialog .entry-content :is(p,.muted){margin:0;font-size:12px;line-height:1.45}
.compact-entry-dialog .entry-content p:empty{display:none}
.compact-entry-dialog .entry-supplier-field{padding-top:0;border:0}
.compact-entry-dialog :is(.registration-tools,.entry-product-more){padding:6px 8px;font-size:13px}
.compact-entry-dialog :is(.registration-tools,.entry-product-more)>summary{min-height:28px;line-height:28px}
.compact-entry-dialog .trace-party-fields{padding:0;border:0;margin:0}
.compact-entry-dialog .trace-party-fields h3{display:none}
.compact-entry-dialog .trace-suggestions{max-height:176px}
.compact-entry-dialog .trace-suggest-hint:empty{display:none}
.compact-entry-dialog .trace-unit-queue{max-height:120px;overflow-y:auto}
.compact-entry-dialog .date-ocr-panel{gap:6px}
.compact-entry-dialog .date-ocr-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.compact-entry-dialog .entry-scan-actions>.button{font-size:14px;min-height:44px}
.compact-entry-dialog .common-code-confirm{font-size:12px;line-height:1.4}
.camera-dialog .date-scan-choices{max-height:176px;overflow-y:auto;overscroll-behavior:contain}
.camera-dialog .camera-zoom{display:flex;align-items:center;gap:10px;flex:1;font-size:13px}
.camera-dialog .camera-zoom[hidden]{display:none}
.camera-dialog .camera-zoom input{min-width:0;width:100%}
@media(max-height:520px){.compact-entry-dialog>.dialog-head{padding:6px 12px!important}.compact-entry-dialog .entry-content{padding:8px 12px}.compact-entry-dialog .entry-save-actions{padding:6px 12px!important}.camera-dialog:not(.date-camera-dialog) video{height:150px!important}.camera-dialog .footnote{display:none}}
.compact-entry-dialog .entry-extra-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:start}
.compact-entry-dialog .entry-extra-tools:has(details[open]){grid-template-columns:minmax(0,1fr)}
.compact-entry-dialog .entry-extra-tools details>summary{font-size:12px}
.compact-entry-dialog .entry-product-more>label{margin-top:8px!important}


.recycle-body{display:flex;flex-direction:column;gap:12px;min-width:0}
.recycle-body .supplier-card{margin:0;overflow-wrap:anywhere}
.recycle-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.recycle-actions>.button{margin:0;min-height:40px;flex:1 1 auto}
.recycle-body input,.recycle-body select{width:100%;box-sizing:border-box;min-width:0}

.employee-actions{display:flex;flex-wrap:wrap;gap:8px;margin-block:8px}.employee-account-form .employee-permission{display:flex;align-items:center;gap:8px}.employee-account-form .employee-permission input{width:18px;min-width:18px;height:18px;margin:0}

/* Inventory workspace and searchable data management. */
.inventory-management-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.inventory-management-tabs>.button{flex:1;min-width:100px;margin:0}
.recycle-search{display:flex;gap:8px;align-items:center}
.recycle-search input{flex:1}
.recycle-search>.button{flex-shrink:0;margin:0}
.recycle-results{display:grid;gap:10px}
/* Keep scan records dense, with technical identifiers available on demand. */
.pda-audit-dialog{width:min(1080px,calc(100vw - 32px));max-width:1080px}
.pda-audit-body{display:flex;flex-direction:column;gap:12px;min-width:0}
.pda-audit-body p{margin:0;line-height:1.5}
.pda-audit-body .inventory-management-tabs{margin:0}
.pda-audit-filters{display:grid;grid-template-columns:1fr 1.5fr 1fr auto;gap:12px;align-items:end}
.pda-audit-filters label{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:13px}
.pda-audit-filters input,.pda-audit-filters select{width:100%;min-width:0;box-sizing:border-box}
.pda-audit-filters>.button{margin:0}
.pda-event-list,.pda-device-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pda-event-card,.pda-device-card{border:1px solid #dce3e9;border-radius:12px;padding:12px;min-width:0;overflow-wrap:anywhere;display:flex;flex-direction:column;gap:7px;background:#fff}
.pda-card-heading,.pda-event-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;line-height:1.5}
.pda-outcome{border-radius:6px;background:#edf4f8;color:#305569;padding:2px 7px;font-size:12px;white-space:nowrap}
.pda-scan-value{font-size:15px;font-weight:600;overflow-wrap:anywhere;line-height:1.5}
.pda-event-meta,.pda-event-card p,.pda-device-card p{font-size:12px}
.pda-event-card details{font-size:12px;line-height:1.6}
.pda-event-card summary{cursor:pointer;color:#526575}
.pda-audit-details{display:grid;grid-template-columns:84px minmax(0,1fr);gap:6px;margin:10px 0 0}
.pda-audit-details dd{margin:0;overflow-wrap:anywhere}
.pda-audit-details dt{color:#627382}
.pda-audit-note{font-size:12px;color:#627382}
.pda-event-panel>.button{margin-top:12px}
.pda-device-panel[hidden],.pda-event-panel[hidden]{display:none}
@media(max-width:700px){
 .pda-audit-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .pda-event-list,.pda-device-list{grid-template-columns:minmax(0,1fr)}
 .pda-audit-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 24px)}
 .pda-audit-dialog .dialog-body{padding:12px}
}
@media(max-width:360px){.recycle-search{flex-wrap:wrap}.recycle-search>.button{width:100%}}
/* Override generic dialog form spacing within the audit's compact toolbar. */
.pda-audit-filters{margin:0;padding:0}
.pda-audit-filters label{margin:0}
.pda-audit-filters input,.pda-audit-filters select{margin:0;min-height:40px;padding:8px 10px;font-size:14px}
.pda-audit-filters>.button{min-height:40px;padding:8px 12px}
.pda-audit-body>p{margin:0}
.pda-audit-filters{grid-template-columns:minmax(0,1fr) auto}
.pda-audit-advanced{grid-column:1/-1;font-size:13px}
.pda-audit-advanced summary{cursor:pointer;line-height:1.6;color:#526575}
.pda-audit-advanced>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:10px}

.management-business>.management-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.management-business .management-tool{min-width:0}
.management-business .management-tool>span{overflow-wrap:anywhere}

/* PDA audit: compact records, separated filters, touch-friendly management. */
.pda-audit-dialog .dialog-head{padding:12px 16px;gap:12px}
.pda-audit-dialog .dialog-head h2{font-size:17px;line-height:1.4;min-width:0}
.pda-audit-dialog .pda-audit-body{padding:14px 16px;gap:10px}
.pda-audit-body .inventory-management-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pda-audit-body .inventory-management-tabs>.button{margin:0;min-height:40px;padding:8px 12px}
.pda-audit-body .pda-audit-filters{gap:8px 10px;align-items:end;background:#f6f8fa;border:1px solid #e1e6eb;border-radius:10px;padding:10px}
.pda-audit-body .pda-audit-filters[hidden],.pda-audit-body .pda-audit-note[hidden]{display:none}
.pda-filter-actions{display:flex;gap:6px;align-items:center}
.pda-audit-body .pda-filter-actions>.button{margin:0;min-height:40px;padding:8px 12px;white-space:nowrap}
.pda-audit-body .pda-audit-filters label{margin:0;gap:5px;line-height:1.4}
.pda-audit-body .pda-audit-filters input,.pda-audit-body .pda-audit-filters select{margin:0;min-height:40px;padding:8px 10px;font-size:16px;line-height:1.4}
.pda-audit-body .pda-audit-advanced summary{padding:6px 0;min-height:32px;box-sizing:border-box;line-height:20px}
.pda-audit-body .pda-audit-advanced>div{gap:10px;margin-top:6px}
.pda-audit-body .pda-event-list{display:block;border:1px solid #dde4ea;border-radius:10px;overflow:hidden;background:#fff}
.pda-audit-body .pda-event-card{border:0;border-radius:0;border-bottom:1px solid #e5e9ed;padding:10px 12px;gap:4px}
.pda-audit-body .pda-event-card:last-child{border-bottom:0}
.pda-audit-body .pda-card-heading{flex-wrap:nowrap;gap:10px;line-height:1.4}
.pda-audit-body .pda-card-heading strong{min-width:0;overflow-wrap:anywhere;font-size:14px}
.pda-audit-body .pda-outcome{flex:none;font-size:12px;line-height:18px;padding:2px 7px}
.pda-audit-body .pda-outcome[data-outcome=accepted]{background:#edf6ef;color:#30663b}
.pda-audit-body .pda-outcome[data-outcome=rejected]{background:#fff0ed;color:#9b4032}
.pda-audit-body .pda-outcome[data-outcome=duplicate]{background:#fff5df;color:#805b16}
.pda-audit-body .pda-scan-value{font-size:15px;line-height:1.4;white-space:pre-wrap}
.pda-audit-body .pda-event-meta{font-size:12px;line-height:1.5;gap:3px 12px;color:#627382}
.pda-audit-body .pda-event-meta>span{min-width:0;overflow-wrap:anywhere}
.pda-audit-body .pda-event-meta time{white-space:nowrap;font-variant-numeric:tabular-nums}
.pda-audit-body .pda-event-detail summary{display:flex;justify-content:space-between;gap:10px;align-items:center;min-height:32px;line-height:1.5;cursor:pointer;list-style:none}
.pda-audit-body .pda-event-detail summary::-webkit-details-marker{display:none}
.pda-audit-body .pda-event-detail summary>span:first-child{min-width:0;overflow-wrap:anywhere}
.pda-detail-link{flex:none;color:#813548;font-weight:600}
.pda-detail-link::after{content:' ＋'}
.pda-event-detail[open] .pda-detail-link::after{content:' −'}
.pda-audit-body .pda-audit-details{grid-template-columns:78px minmax(0,1fr);gap:7px 10px;background:#f6f8fa;border-radius:8px;padding:10px;margin:6px 0 2px;font-size:12px;line-height:1.6}
.pda-audit-body .pda-audit-details :is(dt,dd){margin:0;white-space:pre-wrap}
.pda-audit-body .pda-device-card{padding:12px;gap:8px}
.pda-device-manage{font-size:13px;line-height:1.5}
.pda-device-manage summary{cursor:pointer;min-height:36px;line-height:36px}
.pda-audit-body .pda-device-manage label{margin:10px 0;gap:6px}
.pda-audit-body .pda-device-manage input{margin:0;min-height:42px;font-size:16px;padding:8px 10px;box-sizing:border-box}
.pda-device-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pda-audit-body .pda-device-actions>.button{margin:0;min-height:40px;padding:8px;white-space:normal}
@media(max-width:700px){
 .pda-audit-dialog{width:calc(100vw - 12px);max-height:calc(100dvh - 12px);border-radius:12px}
 .pda-audit-dialog .dialog-head{padding:10px 12px}
 .pda-audit-dialog .pda-audit-body{padding:10px;gap:8px}
 .pda-audit-body .pda-audit-filters{grid-template-columns:minmax(0,1fr) auto;padding:8px;gap:6px 8px}
 .pda-audit-body .pda-filter-actions>.button{padding:8px 10px}
 .pda-audit-body .pda-event-card{padding:8px 10px;gap:3px}
 .pda-audit-body .pda-event-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
 .pda-audit-body .pda-event-meta time{font-size:11px}
 .pda-audit-body .pda-audit-advanced>div{grid-template-columns:1fr}
}
.pda-audit-body .button[hidden]{display:none}
.pda-audit-dialog .pda-audit-body>p{margin:0;line-height:1.5;font-size:12px}
@media(min-width:701px){
 .pda-audit-body .pda-event-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0}
 .pda-audit-body .pda-event-card:nth-child(odd){border-right:1px solid #e5e9ed}
}

/* Keep the document action separate from the summary; IDs live in details. */
.pda-document-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;flex-wrap:wrap}
.pda-document-footer>.button{flex:none}
@media(max-width:600px){.pda-document-footer{align-items:flex-start;flex-direction:column}.pda-document-footer>.button{align-self:flex-end}}

.pda-document-footer{justify-content:flex-end}

/* Formal physical count: use the existing dialog and global button dimensions. */
.warehouse-stocktake fieldset{min-width:0;border:1px solid var(--line);border-radius:8px;padding:12px;margin:12px 0}
.warehouse-stocktake label{display:block;margin:10px 0;overflow-wrap:anywhere}
.warehouse-stocktake input,.warehouse-stocktake textarea{display:block;box-sizing:border-box;width:100%;max-width:100%;margin-top:6px}
.warehouse-stocktake .wide{white-space:normal;overflow-wrap:anywhere}
.warehouse-stocktake .mono,.warehouse-stocktake .error,.warehouse-stocktake details{overflow-wrap:anywhere}

.wechat-login-qr { display:block; width:240px; max-width:100%; height:auto; margin:0 auto; }

/* Continuous warehouse collection uses the installed PDA rules. */
.warehouse-inbound-dialog{width:min(720px,calc(100vw - 24px));}
.warehouse-inbound{gap:12px;display:flex;flex-direction:column;}
.warehouse-inbound .entry-pair>*{min-width:0;}
.warehouse-inbound .trace-party-fields{margin:8px 0;}
.warehouse-inbound .warehouse-date-modes{gap:28px;}
.warehouse-inbound-line{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid var(--border,#e5e7eb);}
.warehouse-inbound-line small{overflow-wrap:anywhere;flex:1 1 100%;}
.warehouse-inbound-submit{position:sticky;bottom:0;background:var(--surface,#fff);padding-top:8px;}
.warehouse-date-confirm{width:min(480px,calc(100vw - 24px));}

/* Continuous inbound uses its own scrollable form, without entry-content wrappers. */
dialog.compact-entry-dialog.warehouse-inbound-dialog > form.dialog-body {
  display:grid!important;
  grid-template-columns:minmax(0,1fr);
  grid-auto-rows:max-content;
  align-content:start;
  gap:12px!important;
  padding:14px 16px!important;
  overflow-y:auto;
  overscroll-behavior:contain;
}

.product-registration label.variant-registration-option:not([hidden]){display:grid;grid-template-columns:20px 1fr;align-items:center;column-gap:8px}.product-registration label.variant-registration-option[hidden]{display:none}.product-registration .variant-registration-option input[type=checkbox]{width:18px;height:18px;min-height:0;margin:0}.variant-registration-option small{grid-column:2}

dialog.compact-entry-dialog.warehouse-inbound-dialog > form.dialog-body{gap:7px!important;padding:8px 12px!important}
.warehouse-inbound .trace-party-fields,.warehouse-inbound p{margin:0}
.warehouse-inbound .inbound-code-panel,.warehouse-inbound .date-ocr-panel{min-width:0;margin:0;gap:5px}
.warehouse-inbound :is(input,select){min-width:0;width:100%;box-sizing:border-box}
.warehouse-inbound .entry-pair{align-items:end}
.warehouse-inbound .warehouse-inbound-status{margin:0 0 4px;line-height:1.35;font-size:13px;overflow-wrap:anywhere}
.warehouse-inbound .warehouse-inbound-status:empty{display:none}
.warehouse-inbound-submit{z-index:2;padding-top:4px}
.inbound-camera>.dialog-head,.warehouse-date-confirm>.dialog-head{padding:7px 12px!important}
.inbound-camera .dialog-body,.warehouse-date-confirm .dialog-body{padding:9px 12px}
.inbound-camera .scan-hint,.inbound-camera .camera-stage,.inbound-camera .date-capture-action{margin-bottom:6px}
.inbound-camera .camera-actions,.inbound-camera .dialog-body{gap:6px}

.warehouse-trace-codes{display:grid;gap:3px;min-width:0}
.warehouse-trace-codes ul{list-style:none;margin:0;padding:0;max-height:6em;overflow:auto}
.warehouse-trace-codes li{font-variant-numeric:tabular-nums;line-height:1.5;overflow-wrap:anywhere}
