:root {
  --green-950: #1d3825;
  --green-800: #315c3d;
  --green-700: #3d7049;
  --green-100: #eaf2e9;
  --cream: #f7f4ea;
  --paper: #fffefa;
  --ink: #263229;
  --muted: #718076;
  --line: #dce3da;
  --red: #b64a43;
  --shadow: 0 14px 40px rgba(39, 60, 43, .09);
  --safe-top: env(safe-area-inset-top, 0px);
  --header-content-height: 76px;
  --header-height: calc(var(--header-content-height) + var(--safe-top));
  --connection-height: 34px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
button, [role="button"], summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Meiryo", sans-serif;
  min-height: 100vh;
  padding-bottom: 90px;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.auth-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  place-items: center;
  padding: calc(20px + var(--safe-top)) 20px 20px;
  background: linear-gradient(150deg, #183321 0%, #315c3d 100%);
}
.auth-overlay.open { display: grid; }
.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  text-align: center;
}
.login-mark {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  object-fit: cover;
  border: 1px solid rgba(49,92,61,.14);
  border-radius: 24px;
  background: white;
  box-shadow: 0 8px 24px rgba(31,66,40,.14);
}
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-card label {
  display: block;
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.login-card input {
  width: 100%;
  margin-top: 7px;
  padding: 13px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: 0;
  font-size: 20px;
}
.login-card input:focus { border-color: var(--green-700); }
.login-error { min-height: 22px; margin: 0 0 8px; color: var(--red) !important; font-size: 13px; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(20px, 4vw, 28px); }
h2 { margin-bottom: 0; font-size: clamp(22px, 4vw, 30px); }
h3 { margin-bottom: 0; font-size: 18px; }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding:
    calc(12px + var(--safe-top))
    max(18px, env(safe-area-inset-right))
    12px
    max(18px, env(safe-area-inset-left));
  color: white;
  background: var(--green-950);
  box-shadow: 0 5px 20px rgba(20, 40, 25, .18);
}
.app-header .eyebrow { color: #a9c8aa; }
.register-button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 13px;
  color: white;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8ed48c;
  box-shadow: 0 0 0 4px rgba(142,212,140,.12);
}
.connection-bar {
  position: sticky;
  z-index: 19;
  top: var(--header-height);
  min-height: var(--connection-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  color: #315c3d;
  background: #e5f1e6;
  border-bottom: 1px solid rgba(49,92,61,.12);
  font-size: 12px;
}
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #58a268; }
.connection-bar.offline { color: #8a4e22; background: #fff0dc; }
.connection-bar.offline .connection-dot { background: #d47738; }
.connection-bar.syncing { color: #365d82; background: #e7f0f8; }
.connection-bar.syncing .connection-dot { background: #4785b9; }
#pendingLabel { font-weight: 800; }
#syncNowButton { display: none; padding: 3px 8px; color: inherit; border: 1px solid currentColor; border-radius: 7px; background: transparent; font-size: 11px; font-weight: 800; }
.connection-bar.has-pending #syncNowButton { display: inline-block; }
.test-mode-banner {
  position: sticky;
  z-index: 18;
  top: calc(var(--header-height) + var(--connection-height));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  color: #723b06;
  background: #ffdba8;
  border-bottom: 1px solid #e5aa5b;
  font-size: 12px;
}
.test-mode-banner[hidden] { display: none; }
.test-mode-banner strong { padding: 3px 8px; color: white; border-radius: 999px; background: #c96818; }
body.test-mode .app-header { background: #713b13; }
body.test-mode .primary-button { background: #b65d18; }
body.test-mode .product-button { box-shadow: inset 0 0 0 2px rgba(192,96,22,.18); }
.history-mode-label { margin: 5px 0 0; color: #b65d18; font-size: 12px; font-weight: 800; }

main { width: min(1440px, 100%); margin: 0 auto; }
.view { display: none; padding: 22px; }
.view.active { display: block; }
.dashboard-date { margin: 5px 0 0; }
.dashboard-filter { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.dashboard-filter select,
.dashboard-filter input { padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 16px; }
.dashboard-range-fields { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi-card, .dashboard-card { border: 1px solid rgba(42,75,49,.1); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.kpi-card { min-height: 108px; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi-card span { color: var(--muted); font-size: 12px; font-weight: 800; }
.kpi-card strong { font-size: clamp(22px, 6vw, 32px); letter-spacing: -.04em; }
.kpi-card small { margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.kpi-primary { border-color: transparent; color: white; background: linear-gradient(145deg, #183f2c, #3d7049); }
.kpi-primary span { color: #c7ddca; }
.dashboard-highlight { margin-bottom: 12px; padding: 15px 18px; border-radius: 16px; color: var(--green-950); background: #e3f0e4; font-weight: 700; line-height: 1.6; }
.dashboard-grid { display: grid; gap: 12px; }
.dashboard-card { padding: 18px; }
.bar-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 7px; min-height: 185px; padding-top: 15px; }
.bar-column { height: 155px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-value { color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.bar-track { width: min(32px, 80%); height: 108px; display: flex; align-items: flex-end; overflow: hidden; border-radius: 8px; background: #edf0ea; }
.bar-fill { width: 100%; min-height: 3px; border-radius: 8px 8px 0 0; background: linear-gradient(#efa052, #d66b34); }
.bar-label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.rank-list, .summary-list, .hourly-chart { display: grid; gap: 2px; margin-top: 12px; }
.rank-row, .summary-row { min-height: 48px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child, .summary-row:last-child { border-bottom: 0; }
.rank-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #85501b; background: #fff0d9; font-size: 12px; font-weight: 900; }
.row-detail { min-width: 0; }
.row-detail strong, .row-detail span { display: block; }
.row-detail span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.row-total { font-weight: 900; white-space: nowrap; }
.hourly-chart { gap: 9px; }
.chart-help { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.hourly-group { overflow: hidden; border-radius: 12px; }
.hourly-group.expanded { background: #f3f7f2; }
.hourly-row { display: grid; width: 100%; grid-template-columns: 50px 1fr 64px 16px; align-items: center; gap: 9px; padding: 8px 7px; color: inherit; border: 0; border-radius: 12px; background: transparent; font: inherit; font-size: 12px; text-align: left; touch-action: manipulation; }
.hourly-row:active { background: var(--green-100); }
.hourly-label small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.hourly-track { height: 10px; overflow: hidden; border-radius: 99px; background: #edf0ea; }
.hourly-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--green-700); }
.hourly-chevron { color: var(--muted); font-size: 18px; transition: transform .15s ease; }
.hourly-group.expanded .hourly-chevron { transform: rotate(180deg); }
.quarter-hour-list { margin: 0 7px 7px 57px; padding: 5px 10px; border-left: 3px solid #bcd2c0; }
.quarter-hour-row { display: grid; grid-template-columns: minmax(105px, 1fr) 38px auto; align-items: center; gap: 7px; min-height: 31px; border-top: 1px solid #dfe8df; font-size: 11px; }
.quarter-hour-row:first-child { border-top: 0; }
.quarter-hour-row small { color: var(--muted); }
.quarter-hour-row strong { color: var(--green-800); }
.empty-dashboard { padding: 24px 0; color: var(--muted); text-align: center; }
.mobile-cart-bar {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px 10px 16px;
  color: white;
  border: 0;
  border-radius: 16px;
  background: var(--green-950);
  box-shadow: 0 8px 20px rgba(20,45,37,.16);
}
.mobile-cart-bar[hidden] { display: none; }
.mobile-cart-action { padding: 8px 10px; border-radius: 10px; color: var(--green-950); background: white; font-weight: 900; }
.category-tabs { display: flex; overflow-x: auto; gap: 7px; margin: -3px 0 14px; padding: 3px 1px 7px; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button { min-height: 40px; flex: 0 0 auto; padding: 8px 15px; color: var(--green-800); border: 1px solid #bfd0bf; border-radius: 999px; background: white; font-size: 13px; font-weight: 800; touch-action: manipulation; }
.category-tabs button.active { color: white; border-color: var(--green-800); background: var(--green-800); }
.register-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, .8fr); gap: 22px; }
.product-panel, .cart-panel, .card, .settings-list {
  border: 1px solid rgba(42, 75, 49, .1);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.product-panel { padding: 22px; }
.section-heading, .page-heading, .cart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.section-heading { margin-bottom: 18px; }
.page-heading { margin-bottom: 18px; }
.desktop-hint {
  display: none;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.icon-button, .close-button {
  width: 42px;
  height: 42px;
  color: var(--green-800);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 24px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.product-button {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  padding: 18px 12px 14px;
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  background: color-mix(in srgb, var(--product-color) 13%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--product-color) 25%, transparent);
  transition: transform .1s, box-shadow .1s;
}
.product-button:active { transform: scale(.97); }
.product-button .product-icon { display: block; margin-bottom: 7px; font-size: 42px; line-height: 1; }
.product-button strong { display: block; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.product-button b { display: block; margin-top: 5px; color: var(--product-color); font-size: 20px; }
.product-button .price-unit { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 800; }
.experience-badge { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 999px; color: #8a3e0c; background: #fff1d6; font-size: 11px; font-weight: 900; }
.stock-badge { display: inline-block; margin-top: 7px; padding: 3px 8px; border-radius: 999px; color: var(--green-800); background: rgba(255,255,255,.72); font-size: 11px; font-weight: 900; }
.cart-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  min-width: 27px;
  padding: 4px 7px;
  color: white;
  border-radius: 999px;
  background: var(--green-950);
  font-size: 13px;
}
.shortcut-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  display: none;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--green-800);
  border: 1px solid rgba(49,92,61,.2);
  border-radius: 7px;
  background: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 900;
}
.favorite-badge { position: absolute; bottom: 8px; left: 9px; display: grid; width: 25px; height: 25px; place-items: center; color: #9a621b; border-radius: 50%; background: #fff0c8; font-size: 13px; font-weight: 900; }

.cart-panel {
  position: sticky;
  top: calc(var(--header-height) + var(--connection-height) + 22px);
  align-self: start;
  overflow: hidden;
}
.cart-title { padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.text-button { padding: 7px; border: 0; background: transparent; font-weight: 700; }
.text-button.danger { color: var(--red); }
.cart-items { max-height: 34vh; overflow-y: auto; padding: 8px 18px 0; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item-info { display: flex; gap: 10px; align-items: center; min-width: 0; }
.mini-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; font-size: 24px; }
.cart-item-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-title-actions { display: flex; align-items: center; gap: 8px; }
.cart-item-info small { color: var(--muted); }
.quantity-control { display: flex; align-items: center; gap: 8px; }
.quantity-control button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 20px; }
.quantity-control b { min-width: 20px; text-align: center; }
.weight-control { display: flex; align-items: center; gap: 7px; }
.weight-control button { padding: 7px 9px; color: var(--green-800); border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 12px; font-weight: 800; }
.cart-empty, .empty-state { padding: 45px 20px; color: var(--muted); text-align: center; }
.cart-empty span, .empty-state > span { display: block; margin-bottom: 8px; font-size: 42px; }
.undo-clear-button { min-height: 42px; margin-top: 12px; padding: 9px 14px; color: var(--green-800); border: 1px solid #b9cdbb; border-radius: 11px; background: white; font-weight: 800; }
.undo-clear-button[hidden] { display: none; }
.checkout { padding: 18px 20px 20px; background: #f4f7f1; border-top: 1px solid var(--line); }
.total-row, .change-row { display: flex; align-items: baseline; justify-content: space-between; }
.total-row strong { color: var(--green-950); font-size: 34px; }
.money-field { display: block; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
.money-field div { display: flex; align-items: center; margin-top: 5px; padding: 0 14px; border: 2px solid var(--line); border-radius: 13px; background: white; }
.money-field div:focus-within { border-color: var(--green-700); }
.money-field b { font-size: 22px; }
.money-field input { width: 100%; padding: 11px 7px; border: 0; outline: 0; background: transparent; font-size: 24px; text-align: right; }
.unknown-amount-field { margin-bottom: 16px; }
.sale-date-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.sale-date-field input { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: white; font-size: 16px; }
.sale-date-field input:focus { border-color: var(--green-700); outline: 0; }
.sale-date-details { margin-top: 10px; }
.sale-date-details summary { width: fit-content; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; }
.sale-date-details.past-date summary { padding: 6px 9px; color: #963e35; border-radius: 8px; background: #fff0ee; }
.customer-type-field, .customer-area-field { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; border: 0; }
.customer-type-field { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.customer-area-field { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.customer-type-field legend, .customer-area-field legend { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.customer-type-field label, .customer-area-field label { position: relative; min-height: 42px; display: grid; place-items: center; color: var(--green-800); border: 1px solid #bfd0bf; border-radius: 10px; background: white; font-size: 12px; font-weight: 800; text-align: center; }
.customer-type-field input, .customer-area-field input { position: absolute; opacity: 0; }
.customer-type-field label:has(input:checked), .customer-area-field label:has(input:checked) { color: white; border-color: var(--green-800); background: var(--green-800); }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 14px; }
.quick-cash button { min-height: 42px; padding: 9px 3px; color: var(--green-800); border: 1px solid #bfcfbe; border-radius: 9px; background: white; font-size: 12px; font-weight: 800; touch-action: manipulation; }
.quick-cash button[data-cash="exact"],
.quick-cash button[data-cash-clear] { grid-column: span 2; }
.change-row { padding: 12px 0; border-top: 1px dashed #bccabb; }
.change-row strong { color: var(--green-800); font-size: 24px; }
.checkout-status { min-height: 20px; margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 800; text-align: center; }
.checkout-status.warning { color: #8a5b22; }
.checkout-status.shortage { padding: 7px; color: var(--red); border-radius: 8px; background: #fff0ee; }
.checkout-status.ready { color: var(--green-800); }
.primary-button {
  width: 100%;
  padding: 15px 20px;
  color: white;
  border: 0;
  border-radius: 13px;
  background: var(--green-800);
  box-shadow: 0 7px 18px rgba(49,92,61,.18);
  font-weight: 800;
}
.primary-button:disabled { cursor: not-allowed; opacity: .42; }
.primary-button.compact { width: auto; padding: 12px 18px; }
.secondary-button {
  width: 100%;
  margin-top: 10px;
  padding: 12px 18px;
  color: var(--red);
  border: 1px solid #e4c2bf;
  border-radius: 13px;
  background: white;
  font-weight: 800;
}

.page-note { margin: -6px 0 20px; color: var(--muted); }
.date-field { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.date-field input { padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.summary-grid article { padding: 18px; border-radius: 18px; background: var(--green-950); color: white; box-shadow: var(--shadow); }
.summary-grid span { display: block; margin-bottom: 7px; color: #bcd0bd; font-size: 13px; }
.summary-grid strong { font-size: clamp(22px, 4vw, 31px); }
.history-columns { display: grid; grid-template-columns: 1.4fr .7fr; gap: 20px; }
.card { padding: 20px; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.sale-row { border-top: 1px solid var(--line); }
.sale-row:first-child { border-top: 0; }
.sale-row { position: relative; padding-right: 64px; }
.sale-row.canceled { padding-right: 2px; }
.sale-row summary { display: grid; grid-template-columns: 65px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 15px 2px; cursor: pointer; list-style: none; }
.sale-row summary::-webkit-details-marker { display: none; }
.sale-time { color: var(--muted); font-weight: 700; }
.sale-description { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-description small { display: block; color: var(--muted); }
.sale-amount { color: var(--green-800); font-size: 19px; }
.sale-details { margin: -3px 0 14px 77px; padding: 12px; border-radius: 10px; background: var(--green-100); }
.sale-details div { display: flex; justify-content: space-between; margin: 5px 0; }
.sale-row.canceled { opacity: .62; }
.sale-row.canceled .sale-amount { color: var(--muted); text-decoration: line-through; }
.sale-row.canceled .sale-description > small { color: var(--red); font-weight: 800; }
.cancel-sale-button {
  position: absolute;
  top: 50%;
  right: 0;
  padding: 9px 11px;
  color: var(--red);
  border: 1px solid #dfb7b4;
  border-radius: 10px;
  background: white;
  font-weight: 800;
  transform: translateY(-50%);
}
.cancel-note { margin: 0 0 12px; color: var(--red); font-size: 13px; font-weight: 800; }
.product-total-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 12px; padding: 13px 2px; border-top: 1px solid var(--line); }
.product-total-row:first-child { border-top: 0; }
.product-total-row span { color: var(--muted); }

.closing-heading .page-note { margin: 6px 0 0; }
.closing-status-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 15px 18px;
  border: 1px solid #e2c99f;
  border-radius: 16px;
  color: #764814;
  background: #fff4df;
}
.closing-status-card > span { font-size: 18px; }
.closing-status-card strong { font-size: 17px; }
.closing-status-card p { margin: 3px 0 0; font-size: 13px; }
.closing-status-card.closed { color: #245b38; border-color: #bcd7c3; background: #e9f5ec; }
.closing-status-card.stale { color: #923e37; border-color: #e0b8b4; background: #fff0ee; }
.closing-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 18px; }
.closing-card { padding: 20px; }
.closing-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.closing-summary > div { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; border-radius: 14px; background: #f3f6f1; }
.closing-summary span { color: var(--muted); font-size: 12px; font-weight: 800; }
.closing-summary strong { font-size: clamp(20px, 4vw, 28px); }
.closing-help { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.closing-money-field { display: block; margin-bottom: 15px; font-weight: 800; }
.closing-money-field > span, .closing-money-field > small { display: block; }
.closing-money-field > small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.closing-money-field > div { display: flex; align-items: center; margin-top: 7px; padding: 0 14px; border: 2px solid var(--line); border-radius: 13px; background: white; }
.closing-money-field > div:focus-within { border-color: var(--green-700); }
.closing-money-field b { font-size: 22px; }
.closing-money-field input { width: 100%; padding: 12px 7px; border: 0; outline: 0; background: transparent; font-size: 25px; text-align: right; }
.expected-cash-row, .cash-difference-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; padding: 14px 15px; border-radius: 13px; background: var(--green-100); }
.expected-cash-row > div { display: flex; flex-direction: column; gap: 3px; }
.expected-cash-row small { color: var(--muted); font-size: 11px; }
.expected-cash-row strong, .cash-difference-row strong { font-size: 22px; }
.cash-difference-row { color: var(--green-800); background: #edf5ef; }
.cash-difference-row.empty { color: var(--muted); background: #f3f4f2; }
.cash-difference-row.empty strong { font-size: 16px; }
.cash-difference-row.negative, .cash-difference-row.positive { color: var(--red); background: #fff0ee; }
.closing-note-field { display: block; margin-bottom: 15px; color: var(--muted); font-size: 13px; font-weight: 800; }
.closing-note-field textarea { width: 100%; margin-top: 6px; padding: 11px; resize: vertical; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: white; font: inherit; }
.close-register-button { min-height: 54px; }
.export-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; margin-top: 18px; }
.export-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.year-field { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.year-field select { min-width: 110px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.export-buttons { display: flex; gap: 8px; }
.secondary-action-button { padding: 12px 18px; color: var(--green-800); border: 1px solid #bfcfbe; border-radius: 13px; background: white; font-weight: 800; }
.export-card .tax-note { grid-column: 1 / -1; margin: -8px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; }

.settings-list { overflow: hidden; }
.settings-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.settings-tools .page-note { margin: 0; }
.setting-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 15px 18px; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; font-size: 29px; }
.setting-info strong { display: block; font-size: 17px; }
.setting-info span { color: var(--green-800); font-weight: 800; }
.inactive-label { display: inline-block; margin-left: 8px; padding: 2px 7px; color: var(--muted); border-radius: 20px; background: #edf0ec; font-size: 11px; }
.edit-button { padding: 9px 13px; color: var(--green-800); border: 1px solid var(--line); border-radius: 10px; background: white; font-weight: 800; }
.order-buttons { display: flex; gap: 5px; }
.order-buttons button { width: 38px; height: 38px; padding: 0; color: var(--green-800); border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 20px; font-weight: 800; touch-action: manipulation; }
.order-buttons button:disabled { color: #aeb5ae; background: #f3f4f2; }

dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 28px 80px rgba(20,45,25,.25); }
dialog::backdrop { background: rgba(20,35,23,.55); backdrop-filter: blur(3px); }
dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 18px; }
dialog label:not(.switch-row) { display: block; margin-bottom: 15px; color: var(--muted); font-size: 13px; font-weight: 800; }
dialog input[type="text"], dialog input[type="number"], dialog select { width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font-size: 17px; }
dialog input[type="color"] { display: block; width: 100%; height: 46px; margin-top: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0 20px; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { margin-top: 3px; color: var(--muted); }
.switch-row input { width: 24px; height: 24px; accent-color: var(--green-700); }
.test-mode-switch { margin-top: -3px; padding: 10px 0 17px; border-top: 1px solid var(--line); }
.test-mode-switch input { accent-color: #c96818; }
.full-width-button { width: 100%; margin-top: 10px; }
.dialog-note { color: var(--muted); }
.customer-display-note { margin: 8px 0 16px; font-size: 11px; text-align: center; }
.weight-input-field > div { display: flex; align-items: center; margin-top: 7px; padding: 0 13px; border: 2px solid var(--line); border-radius: 12px; }
.weight-input-field > div:focus-within { border-color: var(--green-700); }
.weight-input-field input { margin: 0 !important; padding-inline: 4px !important; border: 0 !important; outline: 0; text-align: right; font-size: 26px !important; }
.weight-input-field b { font-size: 18px; }
.weight-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: -5px 0 16px; }
.weight-presets button { padding: 9px 2px; color: var(--green-800); border: 1px solid #bfcfbe; border-radius: 9px; background: white; font-size: 12px; font-weight: 800; }
.weight-total-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; padding: 14px; border-radius: 12px; background: var(--green-100); }
.weight-total-row strong { color: var(--green-800); font-size: 28px; }
.weight-total-row strong.stock-shortage { color: var(--red); }
.complete-dialog form { text-align: center; }
.complete-mark {
  display: inline-grid;
  width: 54px;
  height: 54px;
  margin-bottom: 10px;
  place-items: center;
  color: white;
  border-radius: 999px;
  background: var(--green-800);
  font-size: 28px;
  font-weight: 900;
}
.complete-total {
  margin: 18px 0;
  padding: 18px;
  border-radius: 16px;
  background: var(--green-100);
}
.complete-total span { display: block; color: var(--muted); font-weight: 800; }
.complete-total strong { color: var(--green-950); font-size: clamp(42px, 13vw, 62px); line-height: 1.05; }
.checkout-confirm-dialog { width: min(560px, calc(100% - 24px)); }
.confirm-date-warning { margin-bottom: 12px; padding: 10px 12px; color: #963e35; border: 1px solid #e6bbb6; border-radius: 10px; background: #fff0ee; font-size: 13px; font-weight: 900; text-align: center; }
.confirm-date-warning[hidden] { display: none; }
.confirm-checkout-items { max-height: 34vh; overflow-y: auto; margin-bottom: 13px; border-block: 1px solid var(--line); }
.confirm-checkout-items > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.confirm-checkout-items > div:first-child { border-top: 0; }
.confirm-checkout-items span, .confirm-checkout-items strong, .confirm-checkout-items small { display: block; }
.confirm-checkout-items small { margin-top: 3px; color: var(--muted); }
.confirm-customer-row, .confirm-money-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; }
.confirm-customer-row { margin-bottom: 5px; color: var(--muted); border-bottom: 1px dashed var(--line); }
.confirm-money-row strong { font-size: 20px; }
.confirm-money-row:first-of-type strong { font-size: 28px; }
.confirm-money-row.change { margin-bottom: 13px; color: var(--green-800); }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 100px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: white;
  border-radius: 999px;
  background: var(--green-950);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: rgba(255,254,250,.96);
  backdrop-filter: blur(12px);
}
.nav-button { padding: 6px; color: var(--muted); border: 0; background: transparent; font-size: 12px; font-weight: 700; }
.nav-button span { display: block; margin-bottom: 2px; font-size: 22px; }
.nav-button.active { color: var(--green-800); }

@media (min-width: 901px) {
  body { padding-bottom: 0; }
  main { padding-left: 96px; }
  .bottom-nav {
    top: calc(var(--header-height) + var(--connection-height));
    right: auto;
    width: 96px;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 82px);
    align-content: start;
    padding: 12px 8px;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: rgba(255,254,250,.98);
  }
  .nav-button {
    border-radius: 14px;
    font-size: 13px;
  }
  .nav-button span { font-size: 25px; }
  .nav-button:hover { background: var(--green-100); }
  .nav-button.active { background: var(--green-100); }
  .dashboard-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-wide { grid-column: 1 / -1; }
  .mobile-cart-bar { display: none !important; }
  .desktop-hint { display: block; }
  .shortcut-badge { display: grid; }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .product-button:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--product-color) 30%, transparent),
      0 9px 20px rgba(40,60,44,.1);
  }
  .primary-button:hover:not(:disabled) { background: var(--green-700); }
  .edit-button:hover, .quick-cash button:hover { background: var(--green-100); }
}

@media (max-width: 900px) {
  .view { padding: 16px; }
  .register-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .cart-items { max-height: none; }
  .history-columns { grid-template-columns: 1fr; }
  .closing-layout { grid-template-columns: 1fr; }
  .export-card { grid-template-columns: 1fr; }
  .export-card .tax-note { grid-column: auto; }
  .mobile-cart-bar {
    position: static;
  }
}
@media (max-width: 560px) {
  :root {
    --header-content-height: 67px;
  }
  body { padding-bottom: 80px; }
  .test-mode-banner { align-items: flex-start; font-size: 11px; }
  .app-header .eyebrow { display: none; }
  .view { padding: 12px; }
  .product-panel { padding: 14px; border-radius: 18px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-button { min-height: 122px; padding: 14px 8px 10px; }
  .product-button .product-icon { font-size: 37px; }
  .product-button strong { font-size: 15px; }
  .product-button b { font-size: 18px; }
  .cart-panel, .card, .settings-list { border-radius: 18px; }
  .summary-grid { gap: 7px; }
  .summary-grid article { padding: 13px 10px; border-radius: 14px; }
  .summary-grid span { font-size: 11px; }
  .page-heading { align-items: flex-end; }
  .dashboard-filter { width: 100%; justify-content: stretch; }
  .dashboard-filter .date-field,
  .dashboard-range-fields { width: 100%; }
  .dashboard-filter select,
  .dashboard-filter input { width: 100%; }
  .sale-row summary { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 7px; }
  .sale-details { margin-left: 60px; }
  .settings-tools { align-items: stretch; flex-direction: column; }
  .settings-tools button { width: 100%; }
  .setting-row { grid-template-columns: 48px minmax(0, 1fr) auto; padding: 13px 12px; gap: 9px; }
  .setting-row .edit-button { grid-column: 2; justify-self: start; }
  .order-buttons { grid-column: 3; grid-row: 1 / span 2; }
  .setting-icon { width: 46px; height: 46px; }
  .quick-cash { grid-template-columns: repeat(4, 1fr); }
  .closing-heading { align-items: flex-end; }
  .closing-summary { gap: 7px; }
  .closing-summary > div { min-height: 82px; padding: 12px; }
  .export-buttons { display: grid; grid-template-columns: 1fr; }
  .export-buttons .primary-button, .secondary-action-button { width: 100%; }
  .nav-button { padding-inline: 2px; font-size: 10px; }
  .nav-button span { font-size: 20px; }
}
