/* Local acceptance fixes. Keep the existing design; make feedback visible. */
#notice:empty { display: none; }
#notice { display:none; position:fixed; top:16px; left:50%; transform:translateX(-50%); z-index:10000; width:max-content; max-width:calc(100vw - 32px); box-sizing:border-box; padding:14px 20px; border:1px solid #795734; border-radius:8px; background:#fffaf1; color:#302a24; box-shadow:0 6px 24px #0003; line-height:1.6; overflow-wrap:anywhere; }
.overflow { overflow-x:auto; max-width:100%; }
.overflow table { border-collapse:collapse; width:100%; }
.overflow th,.overflow td { padding:12px; text-align:left; border-bottom:1px solid var(--line); }
.row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:18px; }
.admin-card + .admin-card { margin-top:18px; }
.admin-card .field { max-width:640px; }
.admin-btn { display:inline-block; }

.action-dialog{width:min(440px,calc(100vw - 32px));border:1px solid var(--line);border-radius:10px;padding:24px;color:var(--ink);background:var(--paper);box-shadow:0 12px 48px #0005}
.action-dialog::backdrop{background:#0006}
.action-dialog label{display:block;margin-bottom:12px;font-size:18px}
.action-dialog input{box-sizing:border-box;width:100%;padding:12px;border:1px solid var(--line)}
.action-dialog button{padding:10px 20px;cursor:pointer}
.action-dialog button[type=submit]{background:var(--ink);color:var(--paper);border:1px solid var(--ink)}

#notice a{color:inherit;text-decoration:underline;font-weight:600}

/* Cart confirmation stays visible over the page without moving with scroll. */
#notice.cart-toast{top:24px;right:24px;left:auto;bottom:auto;transform:none;background:#3d2a20;color:#fff;border-color:#3d2a20;z-index:10000;opacity:1;transition:opacity .2s ease}
#notice.cart-toast.toast-hide{opacity:0}
@keyframes cart-bounce{50%{transform:scale(1.18)}}
.cart-count.cart-bounce{animation:cart-bounce .3s ease-out}
@media(max-width:767px){#notice.cart-toast{top:auto;right:auto;left:50%;bottom:calc(28px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);max-width:calc(100vw - 32px);padding:12px 16px;text-align:center}}
@media(prefers-reduced-motion:reduce){#notice.cart-toast,.cart-count.cart-bounce{transition:none;animation:none}}

/* Buyer and admin order detail share the same item and amount alignment. */
.order-money-layout{display:block;width:100%;min-width:0;max-width:none}
.order-money-layout>div{min-width:0}
.order-money-layout .overflow{width:100%;overflow:visible}
.order-money-layout .overflow table{width:100%;table-layout:fixed}
.order-money-layout .overflow th:first-child,.order-money-layout .overflow td:first-child{width:auto;white-space:normal;overflow-wrap:normal;word-break:normal}
.order-money-layout .overflow th:nth-child(2),.order-money-layout .overflow td:nth-child(2){width:116px;text-align:right}
.order-money-layout .overflow th:nth-child(3),.order-money-layout .overflow td:nth-child(3){width:68px;text-align:center}
.order-money-layout .overflow th:nth-child(4),.order-money-layout .overflow td:nth-child(4){width:116px;text-align:right}
.order-money-layout>div:last-child{width:208px;min-width:0;margin:20px 0 0 auto;padding-right:12px;box-sizing:border-box;justify-self:auto}
.order-money-layout>div:last-child h3{display:none}
.order-money-layout>div:last-child dl{display:grid;grid-template-columns:80px 116px;gap:10px 0;margin:0}
.order-money-layout>div:last-child dt{width:80px;white-space:nowrap}
.order-money-layout>div:last-child dd{width:116px;margin:0;text-align:right;white-space:nowrap}
.order-money-layout>div:last-child dt:last-of-type,.order-money-layout>div:last-child dd:last-of-type{font-weight:700;color:#3d2a20}
@media(max-width:767px){
 .order-money-layout{max-width:100%}
 .order-money-layout .overflow table{display:block;width:100%;min-width:0;table-layout:auto}
 .order-money-layout .overflow thead{display:none}
 .order-money-layout .overflow tbody{display:block}
 .order-money-layout .overflow tr{display:grid;grid-template-columns:1fr auto;gap:7px 12px;padding:14px 0;border-bottom:1px solid var(--line)}
 .order-money-layout .overflow td{display:block;width:auto!important;min-width:0;padding:0;border:0;white-space:normal!important;text-align:right!important;overflow-wrap:anywhere}
 .order-money-layout .overflow td:first-child{grid-column:1/-1;text-align:left!important;font-weight:600;color:#3d2a20;word-break:normal}
 .order-money-layout .overflow td:not(:first-child)::before{float:left;margin-right:16px;color:#655c53;font-weight:400}
 .order-money-layout .overflow td:nth-child(2),.order-money-layout .overflow td:nth-child(3),.order-money-layout .overflow td:nth-child(4){grid-column:1/-1}
 .order-money-layout .overflow td:nth-child(2)::before{content:'單價'}
 .order-money-layout .overflow td:nth-child(3)::before{content:'數量'}
 .order-money-layout .overflow td:nth-child(4)::before{content:'金額'}
 .order-money-layout>div:last-child{width:100%;margin-top:22px;padding-right:0}
 .order-money-layout>div:last-child dl{grid-template-columns:72px minmax(0,1fr)}
 .order-money-layout>div:last-child dt,.order-money-layout>div:last-child dd{width:auto}
}
