:root {
  --bg: #faf5ef;
  --white: #ffffff;
  --text: #1a1a1a;
  --muted: #5c534c;
  --line: #e5ddd2;
  --brown: #8b4513;
  --orange: #c45c1a;
  --danger: #b42318;
  --ok: #2f5d28;
  --ok-bg: #eef6ea;
  --font: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

a {
  color: var(--brown);
}

/* ----- Login ----- */
.page-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: var(--bg);
}

.login-shell {
  width: min(400px, 100%);
}

.login-panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.5rem 1.35rem;
}

.login-brand-wrap {
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
}

.login-logo {
  width: min(200px, 70vw);
  height: auto;
}

.login-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.login-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid var(--danger);
  background: #fff1ef;
  color: #8a2424;
  font-size: 0.88rem;
}

.login-form {
  display: grid;
  gap: 0.7rem;
}

.field {
  display: grid;
  gap: 0.28rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
.input,
select.input,
textarea.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d9cfc3;
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
}

.field input:focus,
.input:focus,
select.input:focus,
textarea.input:focus {
  outline: 2px solid rgba(196, 92, 26, 0.35);
  border-color: var(--orange);
}

.btn-primary {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.55rem 1.05rem;
  background: var(--orange);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
}

.btn-primary:hover {
  background: var(--brown);
}

.btn-ghost {
  appearance: none;
  border: 1px solid #cfc4b6;
  background: var(--white);
  color: var(--text);
  margin: 0;
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
}

.btn-ghost:hover {
  border-color: var(--brown);
  color: var(--brown);
}

.login-form .btn-primary {
  margin-top: 0.35rem;
  padding: 0.6rem 1rem;
  width: 100%;
}

/* ----- Topbar / Home ----- */
.page-home {
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.topbar-logo {
  height: 48px;
  width: auto;
}

.topbar-nav {
  display: flex;
  gap: 1rem;
  margin-right: auto;
}

.topbar-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.topbar-nav a:hover {
  color: var(--orange);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-user {
  color: var(--muted);
  font-size: 0.9rem;
}

.home-main,
.close-main {
  width: min(640px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

/* 予約一覧（タブレット向け・表が見やすい幅） */
.res-list-main {
  width: min(1100px, calc(100% - 1.25rem));
}

.res-list-title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.page-res-list .res-filter {
  justify-content: flex-start;
  margin-bottom: 0.85rem;
}

.page-res-list .res-filter .btn-primary {
  text-decoration: none;
}

.res-list-table .col-pickup {
  width: 7.5rem;
  white-space: nowrap;
}

.res-list-table .col-name {
  width: 10rem;
  min-width: 9rem;
}

.res-list-table .col-tel {
  width: 7rem;
  white-space: nowrap;
}

.form-card {
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

.page-title {
  margin: 0 0 1rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.menu-list {
  display: grid;
  gap: 0.55rem;
}

.menu-item {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.menu-item:hover {
  border-color: #c4b5a4;
}

.menu-item-disabled {
  opacity: 0.65;
}

.menu-name {
  font-weight: 700;
  color: var(--brown);
  font-size: 1rem;
}

.menu-desc {
  color: var(--muted);
  font-size: 0.88rem;
}

.menu-meta {
  color: var(--orange);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.simple-section {
  margin-top: 2rem;
}

.simple-section h2,
.close-card h2,
.home-terminals h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--brown);
}

.simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--line);
}

.simple-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.simple-list li:last-child {
  border-bottom: 0;
}

.simple-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.simple-list a:hover {
  color: var(--orange);
}

.home-lead,
.crumb,
.muted {
  color: var(--muted);
}

.crumb a {
  color: var(--brown);
}

/* closes / reservations shared */
.close-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.inline-form,
.close-date-form,
.res-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.close-date-form label,
.res-filter label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.close-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--white);
}

.close-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.close-table th,
.close-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.close-table thead th,
.close-table tfoot th {
  background: #f3ebe1;
  font-weight: 600;
}

.close-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.close-table .diff {
  color: var(--danger);
  font-weight: 600;
}

.close-table .input {
  max-width: 9rem;
  margin-left: auto;
  display: block;
}

.status {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.78rem;
  border: 1px solid var(--line);
  background: var(--white);
}

.status-draft {
  color: var(--muted);
}

.status-confirmed {
  background: var(--ok-bg);
  border-color: #b7d2a8;
  color: var(--ok);
}

.close-card {
  margin-bottom: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  background: var(--white);
}

.close-card .field {
  margin-bottom: 0.9rem;
}

.close-summary {
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  background: var(--white);
}

.close-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.close-summary strong {
  font-size: 1.35rem;
}

.close-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
}

.product-import-form {
  display: inline-flex;
  margin: 0;
}

.flash-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.flash {
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.9rem;
}

.flash-success {
  background: var(--ok-bg);
  border-color: #b7d2a8;
}

.flash-error,
.flash-warning {
  background: #fff1ef;
  border-color: #e2b6b0;
  color: #8a2424;
}

.field-error {
  color: var(--danger);
  font-size: 0.78rem;
}

.readonly-value {
  margin: 0;
  padding: 0.6rem 0;
}

.res-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.res-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.res-options input {
  margin-right: 0.35rem;
}

/* 予約フォーム（タブレット向け・縦スクロール削減） */
.page-res-form .topbar {
  padding: 0.45rem 1rem;
}

.page-res-form .topbar-logo {
  height: 40px;
}

.res-main {
  width: min(1100px, calc(100% - 1.25rem));
  margin: 0 auto;
  padding: 0.75rem 0 1.25rem;
}

.res-form-tablet .res-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.res-form-tablet .btn-primary {
  margin-top: 0;
  padding: 0.5rem 1rem;
}

.res-columns {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.res-form-tablet .close-card-compact {
  padding: 0.7rem 0.85rem;
  margin-bottom: 0;
  height: 100%;
}

.res-form-tablet .close-card-compact h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.res-form-tablet .res-total {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}

.res-products-head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.res-add-row {
  appearance: none;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 1px solid #cfc4b6;
  background: var(--white);
  color: var(--brown);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.res-add-row:hover {
  border-color: var(--brown);
  background: #fff8f1;
}

.product-table .input-amount {
  font-variant-numeric: tabular-nums;
}

.res-form-tablet .subhead {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: var(--brown);
}

.res-form-tablet .field {
  gap: 0.2rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  align-content: start;
  align-self: start;
  width: 100%;
}

.res-form-tablet .field input,
.res-form-tablet .field select,
.res-form-tablet .field textarea,
.res-form-tablet .input {
  padding: 0.45rem 0.55rem;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.res-form-tablet .field input,
.res-form-tablet .field select,
.res-form-tablet select.input {
  height: 2.55rem;
  min-height: 2.55rem;
  max-height: 2.55rem;
}

.res-form-tablet .res-grid-2 {
  gap: 0.4rem 0.6rem;
  align-items: start;
}

.res-file-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.4rem;
  align-self: start;
}

.res-file-label {
  display: block;
  min-height: 1.2em;
  font-size: 0.8rem;
  line-height: 1.35;
}

.res-file-btn {
  align-self: flex-start;
  white-space: nowrap;
  height: 2.55rem;
  min-height: 2.55rem;
  padding: 0 0.7rem;
  font-size: 0.85rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.res-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.res-file-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
  margin-top: 0.4rem;
  font-size: 0.82rem;
}

.res-file-preview {
  display: block;
  width: 160px;
  height: 120px;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  border: 1px solid #e0d6c8;
  background: #fff;
}

.res-file-preview:not([src]),
.res-file-preview[src=""] {
  display: none;
}

.res-file-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: #a14a3a;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

.res-bottom-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 0.85rem 1.25rem;
  align-items: start;
}

.res-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.res-inline-field {
  display: grid !important;
  grid-template-columns: 5.5rem 1fr;
  align-items: start;
  gap: 0.55rem;
  margin-bottom: 0 !important;
}

.res-inline-field > span {
  padding-top: 0.55rem;
  font-size: 0.88rem;
  color: var(--brown);
  white-space: nowrap;
}

.res-inline-field-memo > span {
  padding-top: 0.45rem;
}

.res-inline-field .input,
.res-inline-field input,
.res-inline-field textarea {
  width: 100%;
  margin: 0;
}

.res-inline-field textarea {
  min-height: 3.4em;
  resize: vertical;
}

.res-form-tablet .res-options {
  gap: 0.35rem 0.55rem;
  font-size: 0.88rem;
}

.res-options-checks {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.res-options-checks label {
  display: block;
  margin: 0;
  cursor: pointer;
}

.res-options-checks label span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 7.5rem;
  font-size: 0.92rem;
  color: var(--text);
}

.res-options-checks input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--brown);
}

.product-table {
  table-layout: fixed;
  width: 100%;
}

.product-table .col-name {
  width: 68%;
}

.product-table .col-qty {
  width: 12%;
}

.product-table .col-amount {
  width: 20%;
}

.product-table th,
.product-table td {
  padding: 0.28rem 0.3rem;
}

.product-table thead th {
  text-align: center;
  font-size: 0.8rem;
}

.product-table .input,
.product-table input {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.38rem 0.4rem;
  display: block;
  font-size: 0.95rem;
}

.product-table .cell-qty input,
.product-table .cell-amount input {
  text-align: right;
}

@media (max-width: 900px) {
  .res-columns,
  .res-bottom-grid {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar-nav {
    order: 3;
    width: 100%;
  }

  .menu-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .menu-meta {
    white-space: normal;
  }

  .res-grid-2,
  .res-options {
    grid-template-columns: 1fr;
  }
}

/* ----- POS ----- */
.page-pos {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.page-pos .topbar {
  flex: 0 0 auto;
}

.pos-main {
  width: min(1280px, calc(100% - 1.25rem));
  margin: 0 auto;
  padding: 0.5rem 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.page-pos.is-pos-checkout .topbar {
  flex: 0 0 auto;
}

.page-pos.is-pos-checkout .pos-main {
  padding: 0;
}

.pos-checkout-stage {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  min-height: 0;
  background: var(--bg);
}

.pos-checkout-stage[hidden] {
  display: none !important;
}

.pos-checkout-panel {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-checkout-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.25rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pos-checkout-items {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1.25rem;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pos-checkout-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.6rem;
  row-gap: 0.05rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}

.pos-checkout-item-name {
  grid-column: 1;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-checkout-item-price {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--orange);
  white-space: nowrap;
}

.pos-checkout-item-meta {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.pos-checkout-summary {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
  display: grid;
  gap: 0.25rem;
}

.pos-checkout-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.pos-checkout-summary-row.is-discount strong {
  color: var(--muted);
}

.pos-checkout-summary-row.is-total {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown);
}

.pos-checkout-summary-row.is-total strong {
  color: var(--orange);
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.pos-checkout-foot {
  flex: 0 0 auto;
  padding: 1rem 1.25rem 1.25rem;
  background: transparent;
  margin-top: auto;
}

.pos-checkout-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.65rem;
}

.pos-checkout-pay-btn {
  appearance: none;
  border: 1px solid #d7cbbd;
  background: #f3ebe1;
  color: var(--brown);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  min-height: 2.8rem;
  width: auto;
  min-width: 7.5rem;
  max-width: 11rem;
  flex: 0 1 auto;
  cursor: pointer;
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

.pos-checkout-pay-btn:hover {
  background: #ebe0d4;
}

.pos-checkout-pay-btn.is-active {
  border-color: var(--orange);
  background: #f4c89a;
  color: #5a2d0c;
  box-shadow: inset 0 0 0 1px var(--orange);
}

.pos-checkout-back {
  min-height: 2.8rem;
  padding-left: 1rem;
  padding-right: 1rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pos-checkout-confirm {
  appearance: none;
  border: 1px solid #7eb6d4;
  background: #d8eef8;
  color: #1f5f7a;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  min-height: 2.8rem;
  min-width: 10rem;
  flex: 1 1 12rem;
  cursor: pointer;
  padding: 0.5rem 1.1rem;
  white-space: nowrap;
}

.pos-checkout-confirm:hover:not(:disabled) {
  background: #c5e5f4;
}

.pos-checkout-confirm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pos-checkout-foot:has(.pos-checkout-confirm:only-child),
.pos-checkout-foot:has(.pos-receipt-actions) {
  display: flex;
  justify-content: center;
}

.pos-checkout-foot:has(.pos-checkout-confirm:only-child) .pos-checkout-confirm {
  flex: 0 1 20rem;
}

.pos-checkout-body:has(.pos-receipt),
.pos-checkout-body:has(.pos-ryoshusho) {
  overflow: auto;
  align-items: center;
}

.pos-receipt {
  width: min(360px, 100%);
  margin: 0 auto;
  border: 1px solid #d8d2c8;
  background: #fffefb;
  padding: 1.1rem 1.15rem 1.2rem;
  display: grid;
  gap: 0.85rem;
  flex: 0 0 auto;
  color: #222;
  font-family: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", monospace;
  font-size: 0.86rem;
  line-height: 1.45;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.pos-receipt-head {
  text-align: center;
  display: grid;
  gap: 0.1rem;
}

.pos-receipt-doc {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pos-receipt-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.pos-receipt-corp,
.pos-receipt-addr,
.pos-receipt-tel,
.pos-receipt-reg {
  font-size: 0.8rem;
  color: #333;
}

.pos-receipt-meta-block,
.pos-receipt-promo,
.pos-receipt-foot {
  display: grid;
  gap: 0.05rem;
  text-align: left;
}

.pos-receipt-promo {
  margin-top: 0.1rem;
}

.pos-receipt-lines {
  display: grid;
  gap: 0.55rem;
}

.pos-receipt-item-name {
  word-break: break-word;
}

.pos-receipt-item-detail,
.pos-receipt-subtotal {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.pos-receipt-item-unit,
.pos-receipt-subtotal > span:first-child {
  justify-self: start;
}

.pos-receipt-item-qty,
.pos-receipt-qty {
  justify-self: center;
  text-align: center;
}

.pos-receipt-item-sum,
.pos-receipt-yen {
  justify-self: end;
  text-align: right;
}

.pos-receipt-item.is-discount .pos-receipt-item-name,
.pos-receipt-item.is-discount .pos-receipt-item-sum {
  color: var(--muted);
}

.pos-receipt-rule {
  border-top: 1px dashed #9a9a9a;
  margin: 0.1rem 0;
}

.pos-receipt-totals {
  display: grid;
  gap: 0.2rem;
}

.pos-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.pos-receipt-row.is-strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.pos-receipt-row.is-strong strong {
  font-weight: 700;
}

.pos-receipt-row.is-note {
  justify-content: flex-end;
  color: #333;
  font-size: 0.82rem;
}

.pos-receipt-foot {
  margin-top: 0.15rem;
  font-size: 0.8rem;
}

.pos-receipt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  width: min(360px, 100%);
  margin: 0 auto;
}

.pos-receipt-actions .pos-checkout-confirm,
.pos-receipt-actions .pos-receipt-issue {
  flex: 1 1 9rem;
  min-width: 8.5rem;
}

.pos-receipt-issue {
  appearance: none;
  border: 1px solid #d2c4b4;
  background: #f3ebe1;
  color: var(--brown);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  min-height: 2.8rem;
  cursor: pointer;
  padding: 0.5rem 1.1rem;
  white-space: nowrap;
}

.pos-receipt-issue:hover {
  background: #ebe0d4;
}

.pos-ryoshusho {
  width: min(360px, 100%);
  margin: 0 auto;
  border: 1px solid #d8d2c8;
  background: #fffefb;
  padding: 1.15rem 1.2rem 1.25rem;
  display: grid;
  gap: 0.75rem;
  flex: 0 0 auto;
  color: #222;
  font-size: 0.88rem;
  line-height: 1.45;
}

.pos-ryoshusho-top {
  display: grid;
  gap: 0.1rem;
  text-align: right;
  font-size: 0.82rem;
}

.pos-ryoshusho-title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.45em;
  padding: 0.15rem 0 0.1rem;
  text-indent: 0.45em;
}

.pos-ryoshusho-payee,
.pos-ryoshusho-proviso {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid #333;
  min-height: 2rem;
  padding: 0.15rem 0;
}

.pos-ryoshusho-name,
.pos-ryoshusho-proviso-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  padding: 0.2rem 0;
  outline: none;
}

.pos-ryoshusho-payee > span,
.pos-ryoshusho-proviso > span {
  flex: 0 0 auto;
}

.pos-ryoshusho-amount-block {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.15rem;
}

.pos-ryoshusho-amount {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.pos-ryoshusho-amount span {
  font-weight: 700;
}

.pos-ryoshusho-amount strong {
  font-size: 1.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.pos-ryoshusho-tax {
  display: grid;
  gap: 0.05rem;
  justify-items: end;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.pos-ryoshusho-note {
  text-align: center;
  margin: 0.15rem 0 0.25rem;
}

.pos-ryoshusho-merchant {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.35rem;
}

.pos-ryoshusho-shop {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
}

.pos-ryoshusho-addr,
.pos-ryoshusho-tel,
.pos-ryoshusho-reg {
  font-size: 0.8rem;
}

.pos-ryoshusho-foot {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.pos-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(160px, 0.7fr) minmax(280px, 1.4fr);
  gap: 0.65rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.pos-panel {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.pos-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: #f3ebe1;
}

.pos-panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--brown);
}

.pos-view-tabs-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pos-view-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pos-view-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.38rem 0.65rem;
  min-height: 2.3rem;
  cursor: pointer;
  white-space: nowrap;
}

.pos-view-tab.is-active {
  color: var(--brown);
  border-color: var(--orange);
  background: #fff7f0;
}

.pos-view-tab:hover {
  color: var(--brown);
}

.pos-past-filter-btn {
  appearance: none;
  border: 1px solid #d7cbbd;
  background: #f8f2ea;
  color: var(--brown);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.3rem 0.55rem;
  min-height: 2.1rem;
  cursor: pointer;
  white-space: nowrap;
}

.pos-past-filter-btn.is-active,
.pos-past-filter-btn[aria-expanded="true"] {
  border-color: var(--orange);
  background: #fff7f0;
}

.pos-past-filter-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.55rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  background: #fffdf9;
  max-width: 22rem;
}

.pos-past-filter-panel[hidden] {
  display: none !important;
}

.pos-past-filter-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.pos-past-filter-field .input {
  min-height: 2.2rem;
  font-size: 0.88rem;
  padding: 0.25rem 0.4rem;
}

.pos-past-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.pos-past-filter-apply {
  appearance: none;
  border: 1px solid #7eb6d4;
  background: #d8eef8;
  color: #1f5f7a;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 2.2rem;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
}

.pos-cat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: auto;
  border-top: 1px solid #d7cbbd;
  flex-shrink: 0;
}

.pos-icon-btn {
  appearance: none;
  border: 0;
  border-right: 1px solid #d7cbbd;
  background: #f3ebe1;
  color: var(--brown);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.45rem 0.25rem;
  min-width: 0;
  min-height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

.pos-icon-btn:last-child {
  border-right: 0;
}

.pos-icon-btn:hover {
  background: #ebe0d4;
}

.pos-icon-btn:active {
  background: #e2d5c6;
}

.pos-slip-item {
  border-bottom: 1px solid var(--line);
}

.pos-slip-btn {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
}

.pos-slip-item.is-selected .pos-slip-btn,
.pos-slip-btn:hover {
  background: #fff7f0;
}

.pos-slip-item.is-selected .pos-slip-btn {
  box-shadow: inset 3px 0 0 var(--orange);
}

.pos-slip-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pos-slip-title {
  font-weight: 700;
}

.pos-slip-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.pos-slip-total {
  font-weight: 700;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pos-past-item {
  border-bottom: 1px solid var(--line);
}

.pos-past-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.pos-past-row .pos-slip-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.pos-past-side {
  --pos-past-btn-w: 5.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  padding: 0.55rem 0.55rem 0.45rem 0;
  flex: 0 0 auto;
}

.pos-past-side-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.pos-past-side .pos-slip-total {
  box-sizing: border-box;
  width: var(--pos-past-btn-w);
  text-align: right;
  padding: 0 0.1rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pos-past-print-pair {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.25rem;
  width: auto;
}

.pos-past-print-pair .pos-past-print-btn {
  flex: 0 0 var(--pos-past-btn-w);
  width: var(--pos-past-btn-w);
  min-width: var(--pos-past-btn-w);
  max-width: var(--pos-past-btn-w);
}

.pos-past-print-btn {
  appearance: none;
  box-sizing: border-box;
  border: 1px solid #d7cbbd;
  background: #f8f2ea;
  color: var(--brown);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  width: var(--pos-past-btn-w);
  min-width: var(--pos-past-btn-w);
  max-width: var(--pos-past-btn-w);
  padding: 0.35rem 0.35rem;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

.pos-past-side-top > .pos-past-print-btn {
  width: var(--pos-past-btn-w);
  min-width: var(--pos-past-btn-w);
  max-width: var(--pos-past-btn-w);
}

.pos-past-print-btn:hover {
  background: #efe4d6;
}

.pos-past-print-btn.is-refund {
  border-color: #e0b4b0;
  background: #fceeee;
  color: var(--danger);
}

.pos-past-print-btn.is-refund:hover {
  background: #f6dddd;
}

.pos-past-item.is-open .pos-slip-btn {
  background: #fff7f0;
  box-shadow: inset 3px 0 0 var(--orange);
}

.pos-past-item.is-delete .pos-slip-title,
.pos-past-item.is-clear .pos-slip-title {
  color: var(--muted);
}

.pos-past-item.is-delete .pos-slip-total,
.pos-past-item.is-clear .pos-slip-total {
  color: var(--muted);
}

.pos-past-item.is-refund .pos-slip-title,
.pos-past-item.is-refund .pos-slip-total {
  color: var(--danger);
}

.pos-past-item.is-refunded .pos-slip-meta {
  color: var(--muted);
}

.pos-past-detail {
  padding: 0 0.85rem 0.7rem 1.1rem;
  display: grid;
  gap: 0.3rem;
}

.pos-print-root {
  display: none;
}

/* ----- ご予約伝票（印刷） ----- */
.res-print-root {
  display: none;
}

.res-slip {
  width: 148mm;
  margin: 0 auto;
  color: #111;
  background: #fff;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "MS PMincho", "Noto Serif JP", serif;
  font-size: 12.5pt;
  line-height: 1.35;
  border: 1px solid #111;
  box-sizing: border-box;
}

.res-slip table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
}

.res-slip th,
.res-slip td {
  border: 1px solid #111;
  vertical-align: middle;
  padding: 0.35em 0.5em;
}

/* 外枠と二重線にならないよう外周ボーダーを消す */
.res-slip-head tr:first-child th,
.res-slip-head tr:first-child td {
  border-top: 0;
}

.res-slip-head th:first-child,
.res-slip-items th:first-child,
.res-slip-items td:first-child,
.res-slip-foot td:first-child {
  border-left: 0;
}

.res-slip-head td:last-child,
.res-slip-items th:last-child,
.res-slip-items td:last-child,
.res-slip-foot td:last-child {
  border-right: 0;
}

.res-slip-foot tr:last-child td {
  border-bottom: 0;
}

.res-slip-head .res-slip-label {
  width: 18%;
  text-align: center;
  font-weight: 400;
  background: #fff;
}

.res-slip-name-label {
  position: relative;
  height: 4.2em;
  padding-top: 1.1em !important;
}

.res-slip-kana-label {
  display: block;
  position: absolute;
  top: 0.2em;
  left: 0;
  right: 0;
  font-size: 0.62em;
  letter-spacing: 0.05em;
}

.res-slip-pickup {
  letter-spacing: 0.06em;
  padding: 0.55em 0.75em !important;
}

.res-slip-num {
  display: inline-block;
  min-width: 1.6em;
  text-align: center;
}

.res-slip-customer {
  padding: 0.35em 0.75em 0.45em !important;
  height: 4.2em;
}

.res-slip-kana {
  font-size: 0.72em;
  letter-spacing: 0.08em;
  min-height: 1.1em;
  color: #333;
}

.res-slip-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5em;
  font-size: 1.15em;
  min-height: 1.4em;
  padding-right: 0.25em;
}

.res-slip-sama {
  flex: 0 0 auto;
}

.res-slip-tel {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-top: 0.25em;
  border-top: 1px solid transparent;
  font-size: 0.95em;
}

.res-slip-tel-label {
  flex: 0 0 auto;
}

.res-slip-tel-value {
  flex: 1 1 auto;
  border-bottom: 1px solid #111;
  min-height: 1.2em;
  padding: 0 0.2em 0.05em;
}

.res-slip-col-name { width: 62%; }
.res-slip-col-qty { width: 14%; }
.res-slip-col-amount { width: 24%; }

.res-slip-items thead th {
  text-align: center;
  font-weight: 400;
  padding: 0.3em 0.4em;
  border-top: 0;
}

.res-slip-items tbody td {
  height: 1.85em;
  padding: 0.2em 0.45em;
}

.res-slip-item-name {
  text-align: left;
}

.res-slip-item-qty,
.res-slip-item-amount {
  text-align: center;
}

.res-slip-total-label {
  text-align: right !important;
  padding-right: 1.2em !important;
  font-weight: 400;
  vertical-align: bottom !important;
}

.res-slip-total-cell {
  text-align: center;
  vertical-align: top !important;
  padding: 0.35em 0.45em 0.25em !important;
}

.res-slip-total-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35em;
  border: 1px solid #111;
  min-height: 1.7em;
  padding: 0.15em 0.4em;
  margin: 0 auto;
}

.res-slip-total-value {
  flex: 1 1 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.res-slip-yen {
  flex: 0 0 auto;
}

.res-slip-payment {
  margin-top: 0.25em;
  font-size: 0.78em;
  letter-spacing: 0.04em;
}

.res-slip-payment .is-marked {
  display: inline-block;
  border: 1px solid #111;
  border-radius: 999px;
  padding: 0 0.35em;
  line-height: 1.25;
}

.res-slip-dot {
  margin: 0 0.1em;
}

.res-slip-detail {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 0.55em 0.75em;
  border-bottom: 1px solid #111;
  min-height: 7.2em;
  padding: 0.45em 0.55em 0.5em;
}

.res-slip-detail-left {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  min-width: 0;
}

.res-slip-detail-row {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  gap: 0.4em;
  align-items: start;
  font-size: 0.95em;
}

.res-slip-detail-label {
  padding-top: 0.15em;
}

.res-slip-detail-value {
  min-height: 1.45em;
  padding: 0.1em 0.1em 0.15em;
  white-space: pre-wrap;
  word-break: break-word;
}

.res-slip-detail-memo .res-slip-detail-value {
  min-height: 2.8em;
  padding: 0.1em 0.1em;
}

.res-slip-detail-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.4em;
  padding-top: 0.1em;
}

.res-slip-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4em;
  min-width: 6.5em;
  font-size: 0.92em;
}

.res-slip-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  border: 1px solid #111;
  font-size: 0.85em;
  line-height: 1;
}

.res-slip-foot td {
  vertical-align: middle;
  padding: 0.35em 0.4em;
  border-top: 0;
}

.res-slip-received {
  width: 32%;
  font-size: 0.95em;
}

.res-slip-preview {
  width: 148mm;
  max-width: 100%;
  margin: 3mm auto 0;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid #111;
  background: #fff;
  page-break-inside: avoid;
  break-inside: avoid;
}

.res-slip-preview-img {
  display: block;
  width: 100%;
  height: 60mm;
  object-fit: contain;
  object-position: center;
  margin: 0;
  border: 0;
  background: #fff;
}

.res-slip-staff {
  width: 28%;
  font-size: 0.95em;
}

.res-slip-staff-name {
  display: inline-block;
  min-width: 4em;
  margin-left: 0.35em;
}

.res-slip-shop {
  width: 40%;
  font-size: 0.72em;
  line-height: 1.35;
  text-align: left;
  padding: 0.3em 0.45em !important;
}

@media print {
  body.is-printing:not(.is-printing-reservation) * {
    visibility: hidden !important;
  }

  body.is-printing:not(.is-printing-reservation) .pos-print-root,
  body.is-printing:not(.is-printing-reservation) .pos-print-root * {
    visibility: visible !important;
  }

  body.is-printing:not(.is-printing-reservation) .pos-print-root {
    display: block !important;
    position: absolute;
    inset: 0 auto auto 0;
    width: 80mm;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body.is-printing:not(.is-printing-reservation) .pos-print-root .pos-receipt,
  body.is-printing:not(.is-printing-reservation) .pos-print-root .pos-ryoshusho {
    width: 100%;
    border: 0;
    box-shadow: none;
    background: #fff;
    padding: 0;
  }

  /* 予約伝票: 非表示要素の高さで2ページになるのを防ぐ */
  body.is-printing-reservation {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.is-printing-reservation > *:not(.res-print-root) {
    display: none !important;
  }

  body.is-printing-reservation .res-print-root {
    display: block !important;
    position: static;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body.is-printing-reservation .res-slip,
  body.is-printing-reservation .res-slip-preview {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.is-printing-reservation .res-slip-preview {
    margin-top: 3mm;
  }

  @page {
    margin: 6mm;
    size: auto;
  }
}

.pos-past-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.86rem;
  color: var(--text);
}

.pos-past-line span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.pos-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.pos-order-empty,
.pos-empty-hint {
  padding: 1rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.pos-order-item {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.pos-order-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pos-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
}

.pos-order-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-order-row .pos-discount-btn {
  min-width: 3.8rem;
  height: 2.1rem;
  font-size: 0.85rem;
}

.pos-order-line {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  padding: 0.15rem 0;
  text-align: left;
  cursor: pointer;
}

.pos-order-line:hover {
  color: var(--brown);
}

.pos-order-discount-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.pos-discount-btn {
  appearance: none;
  min-width: 3.4rem;
  height: 2.6rem;
  border: 1px solid #d7cbbd;
  background: #f3ebe1;
  color: var(--brown);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0.7rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.pos-discount-btn:hover {
  background: #ebe0d4;
}

.pos-discount-btn:active {
  background: #e2d5c6;
}

.pos-order.is-pad-open .pos-order-list {
  display: none;
}

.pos-order.is-pad-open .pos-pad {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.pos-pad {
  border-top: 1px solid var(--line);
  background: #fffaf4;
  padding: 0.55rem 0.7rem 0.65rem;
  display: grid;
  gap: 0.4rem;
  flex: 0 0 auto;
  align-content: start;
}

.pos-pad[hidden] {
  display: none !important;
}

.pos-pad-body {
  display: grid;
  gap: 0.4rem;
  min-height: 0;
}

.pos-pad-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.pos-pad-head .btn-ghost {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.4rem 0.7rem;
}

.pos-pad-heading {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pos-pad-heading strong {
  color: var(--brown);
  font-size: 0.95rem;
}

.pos-pad-sub {
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-word;
}

.pos-pad-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brown);
  margin: 0;
}

.pos-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.pos-pad-grid-discount {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pos-pad-cell {
  appearance: none;
  border: 1px solid #d7cbbd;
  background: #f3ebe1;
  color: var(--brown);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  min-height: 2.45rem;
  cursor: pointer;
  padding: 0.3rem;
}

.pos-pad-cell:hover,
.pos-pad-cell.is-active {
  background: #ebe0d4;
  border-color: var(--orange);
}

.pos-pad-cell-wide {
  grid-column: span 1;
  font-size: 0.92rem;
}

.pos-pad-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  line-height: 1.15;
  font-size: 0.95rem;
}

.pos-pad-cell-stack span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.pos-pad-custom,
.pos-pad-custom-row {
  display: grid;
  gap: 0.4rem;
}

.pos-pad-custom-row {
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.35rem;
}

.pos-pad-input {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.55rem;
}

.pos-pad-preview {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pos-pad-back {
  width: 100%;
  margin-top: 0;
  padding: 0.4rem 0.7rem;
}

.pos-pad.is-discount .pos-pad-cell-stack {
  min-height: 2.55rem;
  font-size: 0.9rem;
}

.pos-pad.is-discount .pos-pad-cell-stack span {
  font-size: 0.72rem;
}

.pos-order-footer {
  border-top: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
  background: #faf6f1;
  flex: 0 0 auto;
}

.pos-checkout-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.6rem;
}

.pos-cart-discount-note {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.pos-checkout-bar .pos-discount-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pos-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brown);
  white-space: nowrap;
}

.pos-count strong {
  font-size: 1.25rem;
}

.pos-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

.pos-amount strong {
  font-size: 1.45rem;
  color: var(--orange);
}

.pos-yen {
  margin-left: 0.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.pos-checkout-btn {
  appearance: none;
  min-width: 3.4rem;
  height: 2.6rem;
  border: 1px solid #d7cbbd;
  background: #f3ebe1;
  color: var(--brown);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0.7rem;
  flex-shrink: 0;
}

.pos-checkout-btn:hover:not(:disabled) {
  background: #ebe0d4;
}

.pos-checkout-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pos-cat-list,
.pos-product-grid {
  padding: 0.65rem;
  display: grid;
  gap: 0.5rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overscroll-behavior: contain;
}

.pos-cat-btn,
.pos-product-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.pos-cat-btn {
  width: 100%;
  padding: 0.64rem 0.9rem;
  font-weight: 600;
}

.pos-cat-btn:hover,
.pos-product-btn:hover {
  border-color: #c4b5a4;
}

.pos-cat-btn.is-active {
  border-color: var(--orange);
  background: #fff7f0;
  color: var(--brown);
}

.pos-product-btn {
  width: 100%;
  padding: 0.64rem 0.9rem;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.pos-product-grid {
  grid-template-columns: 1fr;
}

.pos-product-name {
  font-weight: 600;
  text-align: left;
  min-width: 0;
}

.pos-product-price {
  color: var(--orange);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  margin-left: auto;
}

.master-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.master-cat-head h2 {
  margin: 0;
}

@media (max-width: 960px) {
  .page-pos {
    height: auto;
    max-height: none;
    overflow: auto;
  }

  .pos-main {
    overflow: visible;
    height: auto;
  }

  .pos-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .pos-panel {
    min-height: 280px;
    height: auto;
    max-height: 70dvh;
  }

  .pos-order {
    order: 3;
    max-height: 75dvh;
  }
}
