:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #3e291e;
  background: #e5d6c5;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; }
.site-header { background: #57331f; color: white; padding: 24px; }
.site-header h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.site-header p { margin: 8px 0 0; }
main { max-width: 1400px; margin: auto; padding: 20px; }
h2 { margin: 0 0 12px; font-size: 1.4rem; }
h3 { margin: 0; }
.pos-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.panel { padding: 20px; background: #f3e8db; border: 1px solid #c9ae92; border-radius: 16px; }
.hint, .storage-note { color: #654e3c; font-size: .95rem; line-height: 1.5; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
button { font: inherit; font-weight: 600; min-height: 48px; padding: 12px 16px; border: 1px solid #b59678; border-radius: 10px; color: #3e291e; background: #e6d2bc; cursor: pointer; touch-action: manipulation; }
button:active { background: #d4b590; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #b06a00; outline-offset: 3px; }
.product { min-height: 112px; text-align: left; }
.product span { display: block; margin-top: 10px; font-weight: 400; }
.cart-item { padding: 16px 0; border-bottom: 1px solid #e8d9c9; }
.item-heading, .order-heading { display: flex; gap: 12px; justify-content: space-between; align-items: start; }
.item-heading strong { overflow-wrap: anywhere; }
.item-heading span { white-space: nowrap; }
.quantity-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.quantity-controls button { min-width: 48px; }
.quantity { min-width: 24px; text-align: center; font-weight: 700; }
.remove { margin-left: auto; color: #91352c; background: #fff3ef; border-color: #e7c8c0; }
.totals p { display: flex; justify-content: space-between; gap: 12px; }
.grand-total { font-size: 1.3rem; font-weight: 700; }
fieldset { padding: 12px; border: 1px solid #b59678; border-radius: 10px; }
legend { font-weight: 600; }
.payment-options { display: flex; gap: 12px; }
.payment-options label { display: flex; align-items: center; gap: 10px; min-height: 48px; flex: 1; cursor: pointer; padding: 8px; }
input[type="radio"] { width: 22px; height: 22px; accent-color: #57331f; }
.primary { background: #57331f; border-color: #57331f; color: white; }
.primary:active { background: #3d2316; }
.wide { width: 100%; }
.orders-panel { margin-top: 20px; }
.orders-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.order-card { border: 1px solid #c9ae92; border-radius: 12px; padding: 16px; }
.order-card ul { padding-left: 22px; line-height: 1.7; }
.order-card time { display: block; margin-top: 12px; color: #654e3c; font-size: .9rem; }
.badge { padding: 6px 10px; border-radius: 20px; font-size: .85rem; font-weight: 700; background: #fae6be; }
.badge.preparing { background: #ead5bf; color: #674129; }
.badge.completed { background: #e2d6c7; color: #57331f; }
#message:empty { display: none; }
#message { padding: 14px; border-radius: 10px; background: #dfcbb3; }
#message.error { background: #ffe5df; color: #842a21; }
.storage-note { text-align: center; }
dialog { width: min(440px, calc(100% - 32px)); max-height: 90vh; overflow-y: auto; padding: 24px; border: 1px solid #b59678; border-radius: 16px; color: #3e291e; background: #f3e8db; }
dialog::backdrop { background: rgb(0 0 0 / 45%); }
.hazelnut-option { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px; background: #e6d2bc; border-radius: 10px; cursor: pointer; }
.hazelnut-option input { width: 24px; height: 24px; flex-shrink: 0; accent-color: #57331f; }
.hazelnut-option[hidden] { display: none; }
.customer-label { display: block; margin: 16px 0 8px; font-weight: 600; }
#customer-name { width: 100%; min-height: 48px; padding: 12px; border: 1px solid #b59678; border-radius: 10px; font: inherit; }
.dialog-actions { display: flex; gap: 12px; }
.dialog-actions button { flex: 1; }
#product-dialog-error { color: #842a21; }
#product-dialog-error:empty { display: none; }
#name-error { color: #842a21; }
#name-error:empty { display: none; }
#show-sales { margin-top: 16px; }
#sales-dialog { width: min(640px, calc(100% - 32px)); }
.sales-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.sales-table caption { text-align: left; color: #654e3c; margin-bottom: 12px; }
.sales-table th, .sales-table td { text-align: left; padding: 12px 6px; border-bottom: 1px solid #c9ae92; overflow-wrap: anywhere; }
.sales-table th:last-child, .sales-table td:last-child { text-align: right; white-space: nowrap; }
@media (max-width: 750px) {
  .pos-layout { grid-template-columns: 1fr; }
  main { padding: 12px; }
  .panel { padding: 16px; }
}

[hidden] { display: none !important; }
#login-panel { max-width: 440px; margin: 24px auto; }
#login-form label { display: block; margin: 16px 0 8px; font-weight: 600; }
#login-form input, #order-notes { width: 100%; padding: 12px; min-height: 48px; font: inherit; border: 1px solid #b59678; border-radius: 10px; }
#login-error { color: #842a21; }
.order-customer { font-size: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
.badge.ready { background: #f5df9b; color: #57331f; }
summary { min-height: 48px; cursor: pointer; font-size: 1.3rem; font-weight: 700; }
#connection { font-size: .95rem; }
