/* スマホの画面（一覧・リスト・拡大・ログイン）。印刷は print.html に別に持つ */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; background: #fff; color: #111; }
:root { color-scheme: light only; }
[hidden] { display: none !important; }
.wrap { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
@media (min-width: 600px) { body { background: #e4e7eb; } .wrap { box-shadow: 0 0 20px rgba(0,0,0,.12); } }

.bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #e3e5e8; background: #fafbfc; }
.bar h1 { font-size: 17px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sub { font-size: 12px; color: #666; font-weight: normal; }
.iconbtn { border: 0; background: none; font-size: 15px; padding: 6px 8px; color: #1a5fb4; cursor: pointer; text-decoration: none; white-space: nowrap; }

/* 一覧 */
.saved { list-style: none; margin: 0; padding: 0; }
.saved li a { display: flex; align-items: center; padding: 16px; border-bottom: 1px solid #eee; color: inherit; text-decoration: none; }
.saved .t { font-size: 16px; }
.saved .d { font-size: 12px; color: #777; margin-top: 2px; }
.saved .n { font-size: 13px; color: #555; white-space: nowrap; margin-left: 8px; }
.empty { padding: 24px 16px; color: #777; font-size: 14px; }
.panel { margin: 16px; padding: 14px; border: 1px solid #d5d9de; border-radius: 10px; background: #fafbfc; }
.panel h2 { font-size: 15px; margin: 0 0 10px; }
.panel label { display: block; font-size: 13px; color: #444; margin: 8px 0 4px; }
.panel input[type=text], .panel textarea { width: 100%; font-size: 16px; padding: 8px; border: 1px solid #bbb; border-radius: 6px; font-family: inherit; }
.panel textarea { min-height: 140px; font-family: "Consolas", "Menlo", monospace; font-size: 15px; }
.help { font-size: 12px; color: #666; line-height: 1.6; margin: 6px 0 0; }
.msg { margin: 10px 16px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.msg.warn { background: #fff6e0; border: 1px solid #e8c36a; }
.msg.err { background: #fdecea; border: 1px solid #e3a39c; color: #8a1c13; }
.msg:empty { display: none; }

/* 表示の切り替え */
.toolbar { position: sticky; top: 49px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid #e3e5e8; font-size: 13px; align-items: center; background: #fff; }
.seg { display: inline-flex; border: 1px solid #1a5fb4; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; color: #1a5fb4; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.seg button.on { background: #1a5fb4; color: #fff; }
.chip { border: 1px solid #aaa; background: #fff; border-radius: 16px; padding: 6px 10px; font-size: 13px; cursor: pointer; color: #333; }
.chip.on { border-color: #1a5fb4; background: #e8f0fb; color: #1a5fb4; }
.progress { margin-left: auto; color: #555; font-size: 12px; }

/* 商品の行 */
.item { padding: 12px 12px 14px; border-bottom: 1px solid #eee; }
.item.done { background: #f3f4f5; }
.item.done .name, .item.done .meta { color: #888; }
.item.none { background: #fff4f2; }
.row { display: flex; gap: 10px; align-items: flex-start; }
.no { font-size: 12px; color: #888; min-width: 18px; padding-top: 2px; }
.thumb { width: 56px; height: 56px; border-radius: 6px; background: #f0f1f3; flex: none; object-fit: contain; }
.large .thumb { width: 72px; height: 72px; }
.info { flex: 1; min-width: 0; }
.name { font-size: 15px; line-height: 1.35; font-weight: bold; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.large .name { font-size: 17px; }
.meta { font-size: 14px; margin-top: 4px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.meta:empty { display: none; }
.qty { font-size: 16px; font-weight: bold; }
.large .qty { font-size: 19px; }
.price { color: #a0410d; }
.status { border: 1px solid #bbb; border-radius: 14px; background: #fff; font-size: 12px; padding: 4px 9px; cursor: pointer; white-space: nowrap; flex: none; }
.status.s1 { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.status.s2 { background: #c62828; border-color: #c62828; color: #fff; }

/* バーコード: 白地・余白を含めて枠を付けない */
.bc { margin-top: 10px; display: flex; flex-direction: column; align-items: center; cursor: zoom-in; }
.bc svg, .zbc svg { display: block; background: #fff; }
.digits { font-family: "Consolas", "Menlo", monospace; font-size: 15px; letter-spacing: 2px; margin-top: 4px; }
.large .digits { font-size: 19px; }
.zoomhint { font-size: 11px; color: #1a5fb4; margin-top: 2px; }
.nojan { margin-top: 10px; padding: 14px; border: 1px dashed #c62828; border-radius: 8px; color: #c62828; text-align: center; font-size: 14px; }
.badjan { margin-top: 10px; text-align: center; }
.badjan small { display: block; color: #c62828; font-size: 12px; }
.pick { margin-top: 8px; font-size: 12px; color: #555; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pick select { font-size: 14px; padding: 4px; }
.footer { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.btn { display: block; width: 100%; text-align: center; padding: 13px; border-radius: 10px; font-size: 15px; border: 1px solid #1a5fb4; color: #1a5fb4; background: #fff; text-decoration: none; cursor: pointer; font-family: inherit; }
.btn.primary { background: #1a5fb4; color: #fff; }
.btn.danger { border-color: #c62828; color: #c62828; }
.btn:disabled { opacity: .5; }
.btns2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 編集 */
.edit .item { display: grid; grid-template-columns: 1fr 70px 90px; gap: 6px; align-items: center; }
.edit .item input { font-size: 15px; padding: 6px; border: 1px solid #bbb; border-radius: 6px; width: 100%; font-family: inherit; }
.edit .item .code { grid-column: 1 / 4; font-size: 12px; color: #666; display: flex; justify-content: space-between; }
.edit .item .title { grid-column: 1 / 4; }
.edit .item label { font-size: 12px; color: #c62828; white-space: nowrap; }

/* シンプル: 確認の印や進み具合を出さない */
.simple .status, .simple .progress, .simple .only-full { display: none !important; }

/* 1件の拡大 */
.zoom { position: fixed; inset: 0; z-index: 10; background: #fff; display: none; flex-direction: column; }
.zoom.open { display: flex; }
.zhead { display: flex; align-items: center; padding: 10px 12px; font-size: 13px; color: #666; }
.zhead .pos { flex: 1; text-align: center; }
.zbody { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 12px; overflow: hidden; }
.zinfo { display: flex; gap: 12px; align-items: center; width: 100%; max-width: 520px; margin-bottom: 18px; }
.zinfo .thumb { width: 84px; height: 84px; }
.zinfo .name { font-size: 18px; -webkit-line-clamp: 3; }
.zinfo .qty { font-size: 22px; margin-top: 6px; }
.zinfo .price { font-size: 15px; margin-top: 2px; }
.zbc { display: flex; flex-direction: column; align-items: center; }
.zbc .digits { font-size: 24px; letter-spacing: 3px; margin-top: 8px; }
.zbody.rot .zinfo { display: none; }
.zbody.rot .zbc { transform: rotate(90deg); }
.zfoot { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 8px; padding: 10px 12px 18px; }
.simple .zfoot { grid-template-columns: 1fr 1fr; }
.zfoot button { padding: 14px 4px; font-size: 15px; border-radius: 10px; border: 1px solid #bbb; background: #fff; cursor: pointer; color: #111; }
.zfoot .ok { background: #2e7d32; border-color: #2e7d32; color: #fff; font-weight: bold; }
.zsub { display: flex; justify-content: center; gap: 8px; padding: 0 12px 6px; }
.tip { font-size: 11px; color: #888; text-align: center; padding: 0 12px 6px; }
