@charset "UTF-8";
/* =============================================================
   パケット集計  スタイル
   モバイルファースト（BT-A500 / 320–480px を基準）。
   PC は中央寄せ＋最大幅。視認性・誤操作防止を優先。
   ============================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  color: #222;
  background: #f4f5f7;
  -webkit-text-size-adjust: 100%;
}

/* ページ全体ラッパー：モバイルは横幅いっぱい、PCは中央＋最大幅 */
.wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 10px 20px;
}

.title {
  font-size: 1.05rem;
  text-align: center;
  margin: 4px 0 8px;
  padding: 6px;
  background: #2c3e50;
  color: #fff;
  border-radius: 8px;
}
.subtitle {
  font-size: 1.05rem;
  margin: 18px 0 8px;
  border-left: 5px solid #2c3e50;
  padding-left: 8px;
}

/* ---------- メッセージ ---------- */
.msg {
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0;
  font-weight: bold;
  line-height: 1.5;
}
.msg-ok    { background: #e3f6e8; color: #1b7a3d; border: 1px solid #9ed8b2; }
.msg-error { background: #fdecea; color: #b3261e; border: 1px solid #f1a9a3; }
.msg-warn  { background: #fff8e1; color: #8a6d1b; border: 1px solid #ffe08a; }

.ok-text { color: #1b7a3d; }
.ng-text { color: #b3261e; }

/* =============================================================
   拠点選択メニュー（index.php）
   ============================================================= */
.warehouse-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 24px 0;
}
.wh-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: bold;
  color: #1a2733;
  padding: 28px 12px;
  border: 2px solid #2c3e50;
  border-radius: 12px;
  background: #eaf2fb;
  box-shadow: 0 2px 4px rgba(0,0,0,.12);
}
.wh-btn:active { transform: translateY(1px); }

/* =============================================================
   作業選択メニュー（menu.php）
   ============================================================= */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}
.action-btn {
  display: block;
  text-decoration: none;
  border: 2px solid #2c3e50;
  border-radius: 12px;
  padding: 20px 16px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.action-btn:active { transform: translateY(1px); }
.action-btn .act-main {
  display: block;
  font-size: 1.3rem;
  font-weight: bold;
  color: #1a2733;
}
.action-btn .act-sub {
  display: block;
  margin-top: 4px;
  font-size: .85rem;
  color: #667;
}
.act-scan  { background: #eaf6ee; border-color: #2f9e54; }
.act-check { background: #eef3fb; border-color: #2c7be5; }
.act-edi   { background: #fdf3e8; border-color: #d98a2b; }
.act-hist  { background: #f3eefb; border-color: #6f4bbf; }

.subtitle2 {
  font-size: .98rem;
  margin: 14px 0 6px;
  color: #444;
}

/* =============================================================
   スキャン画面（scan.php）
   ============================================================= */
.scan-area {
  width: 100%;
  height: 160px;          /* モバイル：確定ボタン下に注記が1行見える程度（縦ドラッグで拡大可） */
  min-height: 64px;
  font-size: 1.1rem;
  line-height: 1.5;
  padding: 8px;
  border: 2px solid #888;
  border-radius: 8px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.scan-area:focus {
  outline: none;
  border-color: #2c7be5;
  box-shadow: 0 0 0 3px rgba(44,123,229,.25);
}

/* サイズ選択：内部は radio、見た目はボタン。選択中だけ強調・他は控えめ */
.size-group {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.size-radio {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.size-label {
  flex: 1 1 0;
  text-align: center;
  padding: 9px 0;
  font-size: 1.12rem;
  font-weight: bold;
  border: 2px solid #cfd4da;
  border-radius: 10px;
  background: #f0f1f3;   /* 未選択は控えめ（淡色） */
  color: #8a9099;
  cursor: pointer;
  user-select: none;
}
/* 選択中だけくっきり強調 */
.size-radio:checked + .size-label {
  background: #2c7be5;
  border-color: #1c5fb8;
  color: #fff;
  box-shadow: 0 2px 6px rgba(44,123,229,.5);
}
.size-radio:focus + .size-label {
  outline: 3px solid rgba(44,123,229,.4);
}

/* 確定ボタン */
.confirm-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: bold;
  color: #fff;
  background: #d9534f;
  border: none;
  border-radius: 10px;
  padding: 12px;
  margin-top: 4px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.confirm-btn:active { transform: translateY(1px); }
.confirm-btn:disabled { opacity: .6; cursor: default; }
.confirm-btn.small {
  width: auto;
  display: inline-block;
  font-size: 1.05rem;
  padding: 12px 20px;
  background: #2c3e50;
}
/* 読み取り集計の直後に置く「サイズ反映CSVを出力」 */
.export-btn { margin: 6px 0 10px; }

.note {
  font-size: .82rem;
  color: #555;
  line-height: 1.5;
  margin: 6px 0;
}

/* 重複→サイズ更新の確認パネル（scan.php） */
.dup-panel { line-height: 1.7; }
.dup-panel .dup-list {
  margin: 8px 0;
  max-height: 120px;
  overflow-y: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .95rem;
  word-break: break-all;
  background: rgba(255,255,255,.6);
  border-radius: 6px;
  padding: 6px 8px;
}
.update-btn { background: #d98a2b; margin-top: 6px; } /* オレンジ＝サイズ更新 */

/* =============================================================
   読み取り履歴・修正（history.php）
   ============================================================= */
.hist-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.hist-filter {
  flex: 1 1 200px;
  font-size: 1.1rem;
  padding: 10px;
  border: 2px solid #888;
  border-radius: 8px;
}
.hist-filter:focus { outline: none; border-color: #2c7be5; box-shadow: 0 0 0 3px rgba(44,123,229,.25); }
.hist-count { font-size: .95rem; color: #555; white-space: nowrap; }

.hist-table td { vertical-align: middle; }
.hist-table .tn { font-family: "SFMono-Regular", Consolas, monospace; word-break: break-all; }
.hist-table .ts { white-space: nowrap; font-size: .85rem; color: #555; }
.hist-size {
  font-size: 1.05rem;
  padding: 8px 6px;
  border: 1px solid #888;
  border-radius: 6px;
  background: #fff;
}
.hist-del {
  font-size: .95rem;
  color: #b3261e;
  background: #fff;
  border: 1px solid #e0a9a4;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}
.hist-del:active { transform: translateY(1px); }

/* 下部リンク */
.sub-links {
  text-align: center;
  margin-top: 22px;
  font-size: .95rem;
}
.sub-links a { color: #2c7be5; text-decoration: none; }
.sub-links .sep { color: #aaa; margin: 0 6px; }

/* =============================================================
   集計 / チェック 表
   ============================================================= */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: #fff;
}
.summary-table th,
.summary-table td {
  border: 1px solid #cfd4da;
  padding: 10px 8px;
  text-align: left;
}
.summary-table th { background: #2c3e50; color: #fff; }
.summary-table .num { text-align: right; white-space: nowrap; }
.summary-table .wh-cell { background: #eef3f8; font-weight: bold; vertical-align: middle; }
.summary-table .subtotal td { background: #f7f9fb; font-weight: bold; }
.summary-table .grand td { background: #2c3e50; color: #fff; font-weight: bold; }

/* チェック画面 */
.import-form {
  background: #fff;
  border: 1px solid #cfd4da;
  border-radius: 8px;
  padding: 14px;
  margin: 12px 0;
}
.import-form input[type="file"] { display: block; margin: 8px 0 12px; width: 100%; }

.stat-box {
  background: #fff;
  border: 1px solid #cfd4da;
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0;
  line-height: 1.9;
  font-size: 1.05rem;
}

/* リセット（破壊的操作） */
.reset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
.reset-group form { margin: 0; }
.reset-btn {
  font-size: 1rem;
  font-weight: bold;
  color: #b3261e;
  background: #fff;
  border: 2px solid #e0a9a4;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
}
.reset-btn:active { transform: translateY(1px); }

/* =============================================================
   PC 表示（中央寄せ＋やや広め）
   ============================================================= */
@media (min-width: 768px) {
  body { background: #e9ecef; }
  .wrap {
    max-width: 640px;
    margin: 24px auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
  }
  .warehouse-list { max-width: 420px; margin: 28px auto; }

  /* スキャン画面：PC は従来どおり大きめ（モバイルの圧縮値を打ち消す） */
  .title       { font-size: 1.25rem; margin: 8px 0 14px; padding: 8px; }
  .scan-area   { height: auto; min-height: 180px; font-size: 1.25rem; line-height: 1.6; padding: 10px; }
  .size-group  { gap: 10px; margin: 16px 0; }
  .size-label  { padding: 18px 0; font-size: 1.3rem; }
  .confirm-btn { font-size: 1.3rem; padding: 18px; margin-top: 6px; }
  .note        { font-size: .9rem; line-height: 1.6; margin: 14px 0; }
}
