.pos-page-shell {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.pos-lead {
  margin: 0 0 22px;
  color: #000;
  line-height: 1.75;
}

.pos-connection-list,
.pos-mapping-list,
.pos-history-list,
.pos-detail-list {
  display: grid;
  gap: 14px;
}

/* POS操作の結果は、成功・失敗をひと目で判別できる通知カードとして表示する。 */
.pos-page-shell .form-message {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.pos-page-shell .form-message-info {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

.pos-page-shell .form-message-success {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.pos-page-shell .form-message-error {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.pos-connection-card,
.pos-mapping-card,
.pos-history-card,
.pos-detail-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}

.pos-connection-heading,
.pos-mapping-heading,
.pos-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pos-connection-heading h2,
.pos-mapping-heading h2,
.pos-history-heading h2 {
  margin: 0;
  color: #000;
  font-size: 20px;
}

.pos-status,
.pos-mapping-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f3f4f6;
  color: #000;
}

.pos-status-connected,
.pos-status-success,
.pos-mapping-status-mapped {
  background: #dcfce7;
  color: #166534;
}

.pos-status-pending_auth,
.pos-mapping-status-unmapped {
  background: #fef3c7;
  color: #92400e;
}

.pos-status-failed,
.pos-status-auth_failed,
.pos-mapping-status-conflict {
  background: #fee2e2;
  color: #b91c1c;
}

.pos-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.pos-meta-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #fff7ed;
}

.pos-meta-grid dt {
  color: #000;
  font-size: 12px;
}

.pos-meta-grid dd {
  margin: 4px 0 0;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pos-card-actions,
.pos-filter-bar,
.pos-form .page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

/* 一覧の最終カードと、その後に続く操作ボタンを分離する。 */
.pos-connection-list + .page-actions {
  margin-top: 24px;
}

.pos-mapping-list + .page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.pos-card-actions .app-primary-button,
.pos-card-actions .app-secondary-button,
.pos-filter-bar .app-secondary-button {
  min-height: 42px !important;
  font-size: 14px !important;
}

.pos-form {
  display: grid;
  max-width: 640px;
  gap: 16px;
}

.pos-form label,
.pos-filter-bar label {
  display: grid;
  gap: 7px;
  color: #000;
  font-size: 14px;
  font-weight: 700;
}

.pos-form input,
.pos-form select,
.pos-filter-bar input,
.pos-filter-bar select,
.pos-mapping-select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #000;
  box-sizing: border-box;
}

.pos-form-note {
  margin: 0;
  color: #000;
  font-size: 13px;
  line-height: 1.6;
}

.pos-mapping-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(200px, 1fr) minmax(240px, 1.5fr);
  align-items: end;
  gap: 16px;
}

.pos-mapping-card h2,
.pos-mapping-card p {
  margin: 0;
}

.pos-mapping-card p {
  margin-top: 5px;
  color: #000;
  font-size: 13px;
}

.pos-mapping-field {
  display: grid;
  gap: 7px;
  color: #000;
  font-size: 13px;
  font-weight: 700;
}

.pos-item-card {
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.25fr) minmax(230px, 1.45fr);
}

.pos-item-info strong {
  display: block;
  color: #000;
}

.pos-item-info span {
  display: block;
  margin-top: 5px;
  color: #000;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pos-filter-bar {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 14px;
  background: #fff7ed;
}

.pos-filter-bar label {
  flex: 1 1 180px;
}

.pos-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.pos-summary span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #000;
  font-size: 13px;
  font-weight: 700;
}

.pos-empty {
  margin: 0;
  padding: 22px;
  border: 1px dashed #d1d5db;
  border-radius: 14px;
  color: #000;
  text-align: center;
}

.pos-history-card {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, .7fr) repeat(4, minmax(66px, .45fr)) auto;
  align-items: center;
  gap: 12px;
}

.pos-history-card p,
.pos-detail-card p {
  margin: 0;
  color: #000;
  font-size: 13px;
}

.pos-history-card strong,
.pos-detail-card strong {
  display: block;
  color: #000;
}

.pos-error-text {
  grid-column: 1 / -1;
  margin: 0;
  color: #b91c1c;
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
  .pos-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
  .pos-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-mapping-card,
  .pos-item-card,
  .pos-history-card { grid-template-columns: 1fr 1fr; }
  .pos-mapping-field:last-child,
  .pos-history-card .pos-history-actions { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .pos-page-shell { margin-top: 12px; margin-bottom: 60px; }
  .pos-connection-card,
  .pos-mapping-card,
  .pos-history-card,
  .pos-detail-card { padding: 14px; }
  .pos-meta-grid,
  .pos-mapping-card,
  .pos-item-card,
  .pos-history-card { grid-template-columns: 1fr; }
  .pos-mapping-field:last-child,
  .pos-history-card .pos-history-actions { grid-column: auto; }
  .pos-card-actions,
  .pos-card-actions .app-primary-button,
  .pos-card-actions .app-secondary-button,
  .pos-filter-bar .app-secondary-button { width: 100%; }
  .pos-mapping-list + .page-actions,
  .pos-mapping-list + .page-actions .app-primary-button,
  .pos-mapping-list + .page-actions .app-secondary-button { width: 100%; }
  .pos-filter-bar { align-items: stretch; }
}
