/* 店舗管理画面 — 業務用の明るく落ち着いた画面（お客様画面のテーマとは別） */
:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #1d1b18; --muted: #6d675f; --dim: #9c958b; --line: #e6e2db; --line-2: #d6d0c6;
  --brand: #9a3412; --brand-soft: #fbeee6; --ai: #5b3fd6; --ai-soft: #efeafe; --ok: #1f7a4d; --ok-soft: #e5f4ec;
  --warn: #b45309; --warn-soft: #fdf1df; --ng: #b42318; --ng-soft: #fdecea;
  --r: 10px; --sans: "Zen Kaku Gothic New", "Hiragino Sans", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }

.btn { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ai { background: var(--ai); border-color: var(--ai); color: #fff; }
.btn.ai.soft { background: var(--ai-soft); color: var(--ai); border-color: transparent; }
.btn.danger { color: var(--ng); border-color: #f1c4bf; }
.btn.wide { width: 100%; height: 44px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.link { background: none; border: 0; color: var(--muted); padding: 0; }
.link:hover { color: var(--ink); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(154,52,18,.25); border-color: var(--brand); }

/* ログイン */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 20px 50px -30px rgba(0,0,0,.3); }
.login-card h1 { font-size: 20px; margin: 0; }
.login-card .sub { color: var(--muted); margin: 0 0 10px; font-size: 13px; }
.login-card .kicker { margin: 0; font-size: 12px; color: var(--brand); font-weight: 700; letter-spacing: .1em; }
.login-card label { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.store-pick { display: grid; gap: 8px; }
.store-pick button { text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.store-pick button.on { border-color: var(--brand); background: var(--brand-soft); }
.store-pick b { display: block; }
.store-pick small { color: var(--muted); }
.err { color: var(--ng); min-height: 1.4em; margin: 4px 0 0; font-size: 13px; }

/* 枠 */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar-l { display: flex; align-items: center; gap: 8px; font-size: 15px; white-space: nowrap; }
.logo { color: var(--brand); }
.ai-tag { font-size: 10px; background: var(--ai-soft); color: var(--ai); padding: 1px 5px; border-radius: 4px; margin-left: 2px; }
.bar-r { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 13px; white-space: nowrap; }
.pane { padding: 20px; max-width: 1180px; margin: 0 auto; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar #f-q { width: 220px; }
.count { color: var(--muted); font-size: 12.5px; margin-right: auto; }

/* メニュー一覧 */
.m-cat { margin-bottom: 22px; }
.m-cat h3 { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 500; display: flex; gap: 8px; align-items: baseline; }
.m-cat h3 b { color: var(--ink); font-size: 15px; }
.m-rows { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.m-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 110px 238px 64px; gap: 14px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.m-row:first-child { border-top: 0; }
.m-row:hover { background: #fcfbf9; }
.m-row .th { width: 52px; height: 40px; border-radius: 6px; background: var(--bg) center/cover; border: 1px solid var(--line); }
.m-row .nm b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row .nm small { color: var(--dim); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row .pr { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.m-row.hidden-item { opacity: .55; }
.tags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.tag { font-size: 10.5px; padding: 0 6px; border-radius: 4px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.rec { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.tag.miss { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.status { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.status button { border: 0; background: #fff; padding: 4px 10px; font-size: 12.5px; color: var(--muted); border-left: 1px solid var(--line-2); }
.status button:first-child { border-left: 0; }
.status button.on[data-s="販売中"] { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.status button.on[data-s="売り切れ"] { background: var(--ng-soft); color: var(--ng); font-weight: 700; }
.status button.on[data-s="非表示"] { background: #eceae6; color: var(--ink); font-weight: 700; }
.empty { padding: 40px; text-align: center; color: var(--dim); }

/* 編集ドロワー */
.drawer-wrap { position: fixed; inset: 0; z-index: 40; }
.scrim { position: absolute; inset: 0; background: rgba(20,16,12,.35); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--panel); overflow-y: auto; box-shadow: -20px 0 50px -20px rgba(0,0,0,.3); display: flex; flex-direction: column; animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.ed-head { position: sticky; top: 0; z-index: 2; background: var(--panel); display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ed-head h2 { margin: 0; font-size: 16px; }
.ed-body { padding: 18px 20px 30px; display: flex; flex-direction: column; gap: 16px; }
.ed-foot { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 10px; }
.ed-foot .btn.primary { margin-left: auto; min-width: 120px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f > label, .f-l { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.f > label .req { color: var(--ng); }
.f .help { font-size: 12px; color: var(--dim); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.photo { display: flex; gap: 14px; align-items: center; }
.photo .pv { width: 140px; height: 105px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg) center/cover; display: grid; place-items: center; color: var(--dim); font-size: 12px; flex: none; }
.i18n { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.i18n-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #faf9f7; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-weight: 500; }
.i18n-r { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); align-items: start; }
.i18n-r:nth-child(2) { border-top: 0; }
.i18n-r .lg { font-size: 12px; color: var(--muted); padding-top: 8px; }
.i18n-r .two { display: flex; flex-direction: column; gap: 6px; }
.describe { display: flex; gap: 8px; }
.describe input { flex: 1; }
.ai-note { font-size: 12px; color: var(--ai); }

/* カテゴリ */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 500; background: #faf9f7; white-space: nowrap; }
.tbl td input { width: 100%; }
.tbl td.nm { font-weight: 500; white-space: nowrap; }
.tbl td.acts { white-space: nowrap; }
.add-cat { display: flex; gap: 10px; margin-top: 12px; }
.add-cat input { width: 260px; }

/* デザイン */
.pane.design { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 22px; max-width: 1400px; align-items: start; }
.d-left { display: flex; flex-direction: column; gap: 12px; }
.ai-box { background: var(--panel); border: 1px solid #ddd3fb; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px -24px var(--ai); }
.ai-box h2 { font-size: 15px; margin: 0; color: var(--ai); }
.ai-box .hint { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid #ddd3fb; background: var(--ai-soft); color: var(--ai); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.ai-msg { background: var(--ai-soft); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.ai-msg .who { font-size: 11.5px; color: var(--ai); font-weight: 700; margin-bottom: 4px; }
.ai-msg .chg { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.ai-msg .chg span { font-size: 11px; background: #fff; color: var(--ai); border-radius: 4px; padding: 0 6px; }
.ai-msg.err { background: var(--ng-soft); color: var(--ng); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes rot { to { transform: rotate(360deg); } }
.draft-bar { border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draft-bar.has { background: var(--warn-soft); border: 1px solid #f3d9b3; }
.draft-bar.none { background: var(--ok-soft); border: 1px solid #c9e6d6; color: var(--ok); }
.draft-bar .msg { flex: 1; min-width: 180px; font-size: 13px; }
.adj { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.adj summary { padding: 12px 14px; font-weight: 500; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.adj summary::after { content: "＋"; color: var(--dim); }
.adj[open] summary::after { content: "－"; }
.adj summary::-webkit-details-marker { display: none; }
.adj .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 0 14px 14px; }
.adj .grid2 .full { grid-column: 1 / -1; }
.adj label.k { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.color { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 8px 3px 3px; background: #fff; }
.color input[type=color] { width: 30px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; }
.color code { font-size: 12px; color: var(--ink); }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.hist-row .when { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist-row .what { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-right { position: sticky; top: 76px; }
.pv-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; background: #ebe8e2; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 4px 12px; border-radius: 7px; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 500; }
.pv-stage { display: flex; justify-content: center; background: repeating-linear-gradient(45deg, #efece6 0 12px, #f3f0eb 12px 24px); border-radius: 16px; padding: 22px; min-height: 600px; }
.pv-frame { width: 390px; height: 780px; border-radius: 34px; border: 10px solid #1c1a17; overflow: hidden; background: #000; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); transition: width .25s, height .25s; transform-origin: top center; }
.pv-frame.pad { width: 820px; height: 640px; border-radius: 22px; }
.pv-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* QR */
.qr-tools label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; break-inside: avoid; }
.qr-card .s { font-size: 12px; color: var(--muted); }
.qr-card .t { font-size: 22px; font-weight: 700; }
.qr-card .q img, .qr-card .q canvas { width: 150px !important; height: 150px !important; }
.qr-card .u { font-size: 10px; color: var(--dim); word-break: break-all; text-align: center; }
.qr-card .m { font-size: 11.5px; color: var(--muted); }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1d1b18; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
.toast.ng { background: var(--ng); }

@media (max-width: 1080px) {
  .pane.design { grid-template-columns: 1fr; }
  .d-right { position: static; }
  .pv-frame.pad { width: 100%; }
}
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; height: auto; padding: 10px 14px 0; gap: 8px; }
  .bar-r { margin-left: auto; gap: 10px; }
  .pane { padding: 14px; }
  .m-row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .m-row .th { width: 44px; height: 36px; }
  .m-row .st, .m-row .ed { grid-column: 2 / -1; }
  .m-row .ed { display: none; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .pv-stage { padding: 10px; }
  .pv-frame { width: 100%; max-width: 390px; }
}
@media print {
  body { background: #fff; }
  .bar, .toolbar, .hint, .toast { display: none !important; }
  .pane { padding: 0; max-width: none; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); gap: 10mm; }
  .qr-card { border: 1px dashed #bbb; }
}

/* ================= 店家管理平台（左メニュー・在庫・アカウント） ================= */
.login-card .switch { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.link-btn { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 700; }
.ok-msg { background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 4px 0 0; }
.bar .who { color: var(--muted); }
.frame { display: grid; grid-template-columns: 196px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.side { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; padding: 14px 10px 30px; border-right: 1px solid var(--line); background: #fbfaf8; }
.side .grp { margin-bottom: 14px; }
.side .g { display: block; font-size: 11px; color: var(--dim); font-weight: 700; letter-spacing: .1em; padding: 0 10px 4px; }
.side button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.side button:hover { background: #f1eee9; color: var(--ink); }
.side button.on { background: var(--brand-soft); color: var(--brand); }
.side .ic { width: 20px; text-align: center; font-size: 15px; }
.main { min-width: 0; }
.main .pane { max-width: 1240px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card.narrow { max-width: 520px; }
.card .f { margin-bottom: 10px; }
h3.sec { font-size: 14px; color: var(--muted); margin: 22px 0 10px; font-weight: 700; }
h4.grp-h { margin: 16px 0 6px; font-size: 13px; color: var(--brand); }
.actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.badge { font-size: 11px; background: #eceae6; color: var(--muted); border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.badge.red { background: var(--ng-soft); color: var(--ng); }
.good { color: var(--ok); font-size: 13px; margin: 0; }
.dim { color: var(--dim); }
.r { text-align: right !important; font-variant-numeric: tabular-nums; }
.neg-t { color: var(--ng); }
.pos-t { color: var(--ok); }
td small, .qty small { color: var(--dim); font-size: 11px; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fcfbf9; }
.tbl tr.off td { opacity: .5; }

/* ホーム */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.small { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 4px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpis.small .kpi b { font-size: 18px; }
.kpi small { font-size: 11.5px; color: var(--dim); }
.kpi.warn { border-color: #f3d9b3; background: #fffaf2; }
.kpi.warn b { color: var(--warn); }
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash .card { margin: 0; }
.dash .card:first-child { grid-column: 1 / -1; }
.dash .card.wide { grid-column: 1 / -1; }
.alerts { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.kind { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #eceae6; color: var(--muted); white-space: nowrap; }
.kind.in { background: var(--ok-soft); color: var(--ok); }
.kind.out { background: #fdf1df; color: var(--warn); }
.kind.adjust { background: #e9eefc; color: #3a55b4; }

/* 在庫一覧 */
.barc { width: 90px; }
.lvl { display: block; height: 6px; border-radius: 3px; background: #eceae6; overflow: hidden; }
.lvl i { display: block; height: 100%; background: var(--ok); }
.lvl.low i { background: var(--warn); }
.lvl.neg i { background: var(--ng); }
.pill-st { font-size: 11.5px; padding: 1px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.pill-st.ok { background: var(--ok-soft); color: var(--ok); }
.pill-st.low { background: var(--warn-soft); color: var(--warn); }
.pill-st.neg { background: var(--ng-soft); color: var(--ng); }
.spark { width: 100%; height: 130px; color: var(--brand); background: #fcfbf9; border: 1px solid var(--line); border-radius: 10px; }
.spark circle { fill: var(--brand); }
.spark .t { font-size: 11px; fill: var(--dim); }

/* 仕入・出庫 */
.scan { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.scan-btn { height: 48px; padding: 0 22px; font-size: 15px; background: var(--ai); border-color: var(--ai); color: #fff; display: inline-flex; align-items: center; cursor: pointer; border-radius: 10px; }
.scan-btn.disabled { opacity: .5; pointer-events: none; }
.scan .hint { flex: 1; min-width: 240px; margin: 0; }
.scan-preview { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 16px; align-items: flex-start; }
.scan-preview img { width: 150px; max-height: 200px; object-fit: contain; border-radius: 6px; background: #f3f1ed; flex: none; }
.scan-st { font-size: 13.5px; flex: 1; }
.scan-st.ok { color: var(--ink); }
.scan-st.ng { color: var(--ng); }
.scan-st pre { white-space: pre-wrap; font-size: 12px; color: var(--muted); background: #faf9f7; padding: 8px; border-radius: 6px; max-height: 220px; overflow: auto; }
.spin.dark { border-color: rgba(91,63,214,.25); border-top-color: var(--ai); }
.tbl.lines td { vertical-align: top; }
.tbl.lines select, .tbl.lines input { width: 100%; }
.tbl.lines td:first-child { min-width: 220px; }
.tbl.lines .read { font-size: 11.5px; color: var(--ai); margin-top: 3px; }
.tbl.lines .b-name { margin-top: 6px; }
.lines-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.lines-foot .sum { font-size: 14px; color: var(--muted); }
.lines-foot .sum b { font-size: 20px; color: var(--ink); margin-left: 6px; }
details.ph { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
details.ph summary { display: grid; grid-template-columns: 92px minmax(0, 1fr) 70px 110px 130px; gap: 10px; padding: 10px 14px; cursor: pointer; align-items: center; list-style: none; font-size: 13.5px; }
details.ph summary::-webkit-details-marker { display: none; }
details.ph > .tbl, details.ph > p, details.ph > button { margin: 0 14px 12px; }
details.ph > .tbl { width: calc(100% - 28px); }
details.ph.cancel { opacity: .5; }

/* 棚卸 */
.ct-h { display: flex; justify-content: space-between; align-items: baseline; }
.tbl.ct tr.diff td { background: #fffaf2; }
.tbl.ct input.c-reason { width: 100%; }

/* 注文 */
.od-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.od { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.od-h { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.od-st { font-size: 12px; color: var(--c); border: 1px solid var(--c); border-radius: 999px; padding: 0 8px; }
.od pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13.5px; line-height: 1.7; }
.od-note { background: var(--warn-soft); color: var(--warn); font-size: 12.5px; padding: 5px 8px; border-radius: 6px; }
.od-f { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; }
.od-f span { display: flex; gap: 6px; }

/* 公開・アカウント */
.pub-h { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.pub-h h3 { margin-bottom: 4px; }
.pub-st { font-weight: 700; white-space: nowrap; padding: 4px 12px; border-radius: 999px; }
.pub-st.on { background: var(--ok-soft); color: var(--ok); }
.pub-st.off { background: #eceae6; color: var(--muted); }
.link-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.link-row .lk { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.link-row code { font-size: 12.5px; background: #faf9f7; padding: 6px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.link-row code b { color: var(--brand); font-weight: 500; }
.code-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.code-v { font-size: 28px; letter-spacing: .3em; font-family: ui-monospace, Menlo, monospace; background: #faf9f7; border: 1px dashed var(--line-2); border-radius: 10px; padding: 6px 16px; }
.tbl tr.pending td { background: #fffaf2; }
.tbl tr.disabled td { opacity: .55; }
.danger-zone { border-color: #f1c4bf; }
.danger-zone h3 { color: var(--ng); }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .frame { display: block; }
  .side { position: sticky; top: 0; z-index: 9; height: auto; display: flex; gap: 2px; overflow-x: auto; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .grp { display: contents; }
  .side .g { display: none; }
  .side button { width: auto; flex: none; white-space: nowrap; padding: 7px 10px; }
  .bar { position: static; }
  .kpi b { font-size: 20px; }
  details.ph summary { grid-template-columns: 1fr 1fr; }
  .link-row { grid-template-columns: 1fr auto auto; }
  .link-row .lk { grid-column: 1 / -1; }
  .scan-btn { width: 100%; justify-content: center; }
  /* 入力の表（仕入・出庫・棚卸）は 1 行を 1 枚のカードにする */
  .tbl.lines tr:first-child, .tbl.ct tr:first-child { display: none; }
  .tbl.lines tr, .tbl.ct tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
  .tbl.lines td, .tbl.ct td { border: 0; padding: 0 4px; min-width: 0 !important; }
  .tbl.lines td:first-child, .tbl.ct td:first-child { grid-column: 1 / -1; }
  .tbl.lines td:last-child { position: absolute; right: 18px; }
  .tbl.lines tr { position: relative; }
  .tbl.ct td:last-child { grid-column: 1 / -1; }
  .tbl.ct td.r { text-align: left !important; }
  .barc { display: none; }
}

/* 表示言語の切替（日本語／中文） */
.lang-sw { display: inline-flex; background: #ebe8e2; border-radius: 8px; padding: 2px; }
.lang-sw button { border: 0; background: none; padding: 3px 10px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.lang-sw button.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.login { position: relative; }
.login-lang { position: absolute; top: 16px; right: 16px; }
