/* 売場台帳の見た目。
   考え方: 「売場の設計図」。棚割（本部）は設計図の藍、営業支援（現場）は売場のサインの朱。
   紙のような地に、細い罫線と、数字・品番は等幅で。棚割の図は方眼紙の上に描く。
   社内ネットワークだけで動くように、フォントとアイコンは同梱している（public/vendor）。 */
@import url("/static/vendor/fonts/fonts.css");

:root {
  --font: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: "IBM Plex Mono", "BIZ UDPGothic", ui-monospace, monospace;

  --bg: #f3f2ee;
  --surface: #ffffff;
  --sunken: #f8f7f4;
  --ink: #15181c;
  --ink-2: #3a4048;
  --sub: #6a7079;
  --faint: #9ba1a8;
  --rule: #e1ded6;
  --rule-2: #eceae4;
  --hover: #f7f6f2;

  --side: #14171b;
  --side-2: #1d2126;
  --side-ink: #c4c9d0;
  --side-faint: #737a84;

  /* 棚割（本部）の色。営業支援の側では下で差し替える */
  --accent: #2b47c3;
  --accent-ink: #1e3594;
  --accent-soft: #e9edfb;
  --accent-line: #b9c6f2;

  --ok: #1d7a4b;
  --ok-soft: #e2f2e9;
  --warn: #a96300;
  --warn-soft: #fbf0d8;
  --bad: #c0331f;
  --bad-soft: #fbe5e0;

  --r: 7px;
  --r-lg: 11px;
  --shadow: 0 1px 2px rgba(21, 24, 28, 0.05);
  --shadow-lg: 0 14px 34px -12px rgba(21, 24, 28, 0.22), 0 2px 6px rgba(21, 24, 28, 0.06);
  --grid-a: #e3e8f3;
  --grid-b: #eff2f8;
}
body.side-field,
.side-field {
  --accent: #d9530f;
  --accent-ink: #a53d07;
  --accent-soft: #fdeee3;
  --accent-line: #f4c3a3;
}

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.65;
  letter-spacing: 0.01em;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.mono, .num { font-family: var(--mono); font-feature-settings: normal; letter-spacing: 0; }
.mono { font-size: 0.9em; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.dim { color: var(--faint); }
.warn { color: var(--bad); }
.sub { color: var(--sub); font-size: 0.88rem; }
.pre { white-space: pre-wrap; }

/* ───────── 枠組み ───────── */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand svg, .brand .mark-img { width: 30px; height: 30px; flex: none; }
.brand span { display: grid; line-height: 1.2; }
.brand b { font-size: 1.12rem; letter-spacing: 0.08em; }
.brand small { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.22em; color: var(--side-faint); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 12px; padding: 3px; border-radius: 10px; background: #ffffff0d; }
.modes a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; border-radius: 8px; color: var(--side-ink); text-align: center; line-height: 1.25; }
.modes a:hover { background: #ffffff0f; text-decoration: none; color: #fff; }
.modes a .ic { width: 17px; height: 17px; }
.modes a b { font-size: 0.86rem; letter-spacing: 0.04em; }
.modes a small { font-size: 0.62rem; color: var(--side-faint); }
.modes a.on { background: var(--accent); color: #fff; box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.5); }
.modes a.on small { color: #ffffffc4; }
.modetext { margin: 10px 18px 4px; font-size: 0.74rem; line-height: 1.55; color: var(--side-faint); }

.side nav { padding: 10px 10px 14px; display: grid; gap: 1px; }
.side nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 8px; color: var(--side-ink); font-weight: 700; font-size: 0.92rem; }
.side nav a .ic { color: var(--side-faint); }
.side nav a:hover { background: #ffffff0b; color: #fff; text-decoration: none; }
.side nav a.on { background: #ffffff14; color: #fff; }
.side nav a.on .ic { color: var(--accent-line); }
.side nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side nav p { margin: 16px 12px 5px; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.2em; color: var(--side-faint); }
.who { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid #ffffff12; display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; font-size: 0.84rem; }
.who .avatar { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--side-2); border: 1px solid #ffffff1c; color: #fff; font-weight: 700; }
.who b { color: #fff; font-size: 0.9rem; line-height: 1.3; }
.who i { font-style: normal; font-size: 0.7rem; color: var(--side-faint); }
.who .links { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 10px; }
.who .links a, .who .links button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; border-radius: 7px; border: 1px solid #ffffff17; background: none; color: var(--side-ink); font: inherit; font-size: 0.74rem; cursor: pointer; }
.who .links a:hover, .who .links button:hover { background: #ffffff0d; color: #fff; text-decoration: none; }
.who .links .ic { width: 14px; height: 14px; }
.who form { flex: 1; display: flex; }
.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

.main { padding: 26px 32px 72px; min-width: 0; }

/* ───────── 見出しと操作 ───────── */
.head { display: flex; align-items: flex-end; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { font-size: 1.62rem; line-height: 1.35; letter-spacing: 0.02em; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.head h1 small { font-size: 0.86rem; font-weight: 400; color: var(--sub); letter-spacing: 0.02em; }
.eyebrow { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--accent-ink); margin-bottom: 2px; }
.count { color: var(--sub); padding-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count b { color: var(--ink); font-family: var(--mono); font-size: 1.15rem; font-weight: 600; letter-spacing: 0; }
.acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead { color: var(--sub); max-width: 100ch; margin: -10px 0 18px; font-size: 0.9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; line-height: 1; box-shadow: var(--shadow); transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { border-color: #c9c5bb; background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), inset 0 1px 0 #ffffff26; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: #15181c0d; }
.btn.ng { color: var(--bad); }
.btn.ng:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { height: 30px; padding: 0 11px; font-size: 0.82rem; }
.btn.big { height: 44px; padding: 0 26px; font-size: 1rem; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary.small { box-shadow: none; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid; font-size: 0.92rem; }
.flash.ok { background: var(--ok-soft); border-color: #bfe2cd; color: #134d31; }
.flash.ng { background: var(--bad-soft); border-color: #f1c3b9; color: #7d2112; }
.flash.info { background: var(--warn-soft); border-color: #eed6a3; color: #6b4300; }
.flash ul { margin-top: 4px; padding-left: 1.2em; list-style: disc; }
ul.flash { display: block; padding-left: 30px; list-style: disc; }
main > .flash:first-child { animation: drop 0.35s ease-out; }

/* ───────── 入力 ───────── */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #d6d2c8; border-radius: var(--r);
  padding: 7px 11px; min-height: 38px; max-width: 100%; transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { line-height: 1.6; }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }
input[type="search"] { padding-left: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ba1a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px center; background-size: 16px; }
input[type="color"] { padding: 3px; width: 64px; height: 38px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--accent); width: 16px; height: 16px; }
input[type="file"] { padding: 6px; background: var(--sunken); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #c2bdb1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; padding: 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.filters input[type="search"] { flex: 1 1 300px; min-width: 220px; }
.filters select { flex: 0 1 auto; }
.clear { margin-left: 4px; font-size: 0.86rem; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.88rem; cursor: pointer; user-select: none; }
.range { display: inline-flex; align-items: center; gap: 6px; color: var(--sub); font-size: 0.88rem; }

/* ───────── 表 ───────── */
.tablewrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow); }
.tablewrap.half { max-width: 820px; }
table.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.list th { text-align: left; font-size: 0.76rem; font-weight: 700; color: var(--sub); background: var(--sunken); border-bottom: 1px solid var(--rule); padding: 0; white-space: nowrap; position: sticky; top: 0; z-index: 1; letter-spacing: 0.04em; }
.list th.r { text-align: right; }
.list th a { display: flex; align-items: center; gap: 4px; padding: 10px 14px; color: inherit; }
.list th.r a { justify-content: flex-end; }
.list th a:hover { color: var(--ink); text-decoration: none; }
.list th a.on { color: var(--accent-ink); }
.list th i { font-style: normal; font-size: 0.66rem; }
.list thead th:not(:has(a)) { padding: 10px 14px; }
.list td { padding: 10px 14px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.list td.r { font-family: var(--mono); font-size: 0.92rem; letter-spacing: 0; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr { transition: background 0.1s; }
.list tbody tr:hover td { background: var(--hover); }
.list td a { color: var(--ink); font-weight: 700; }
.list td a:hover { color: var(--accent-ink); }
.list td a small { font-weight: 400; color: var(--sub); }
.list td .btn { color: var(--ink); }
.list td .btn.primary { color: #fff; }
.list td.mono, .list td .mono { color: var(--sub); }
.list.hist td { vertical-align: top; }
.none { color: var(--sub); padding: 30px 14px !important; text-align: center; }
p.none { text-align: left; padding: 4px 0 !important; }
.memo { min-width: 220px; color: var(--ink-2); }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 0.74rem; font-weight: 700; background: #ebe9e3; color: #4c535b; white-space: nowrap; letter-spacing: 0.02em; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.tag.t0 { background: var(--ok-soft); color: var(--ok); }
.tag.t1, .tag.t3 { background: var(--warn-soft); color: var(--warn); }
.tag.t2 { background: var(--bad-soft); color: var(--bad); }
.kind { display: inline-block; padding: 1px 9px; border-radius: 4px; font-size: 0.76rem; font-weight: 700; color: #fff; white-space: nowrap; }
.due.over { color: var(--bad); font-weight: 700; }
.due.over::after { content: " 期限切れ"; font-size: 0.74rem; }
.act { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.diff { font-size: 0.86rem; display: grid; gap: 2px; color: var(--ink-2); }
.diff.flat { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.diff b { color: var(--sub); font-weight: 700; margin-right: 4px; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 18px; }
.pager a { padding: 5px 12px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font-size: 0.86rem; font-weight: 700; }
.pager a:hover { border-color: var(--accent-line); text-decoration: none; }
.pager span { color: var(--sub); font-family: var(--mono); font-size: 0.84rem; padding: 0 10px; }

.tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; padding: 9px 14px 11px; color: var(--sub); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); }
.tabs a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tabs b { font-family: var(--mono); font-weight: 600; margin-left: 4px; color: var(--sub); font-size: 0.84rem; }
.tabs a.on b { color: var(--accent-ink); }

/* ───────── 入力の画面 ───────── */
.edit .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.edit label { display: grid; gap: 5px; align-content: start; }
.edit label.wide { grid-column: span 2; }
.edit label.full { grid-column: 1 / -1; }
.edit label > span { font-size: 0.8rem; color: var(--ink-2); font-weight: 700; letter-spacing: 0.02em; }
em { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--bad); margin-left: 6px; }
.edit input, .edit select, .edit textarea { width: 100%; }
.edit > .block { margin-top: 24px; }
.bar { display: flex; align-items: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.stamp { color: var(--sub); font-size: 0.82rem; font-family: var(--mono); letter-spacing: 0; }
.danger { margin-top: 28px; padding-top: 16px; border-top: 1px dashed var(--rule); }
form.inline { display: flex; gap: 6px; align-items: center; }
form.inline input { width: 230px; }
input.qty { width: 88px; text-align: right; font-family: var(--mono); }

/* ───────── 箱・数字 ───────── */
.block { margin-top: 32px; }
.block > h2, .block > div > h2 { display: flex; align-items: center; gap: 12px; font-size: 1rem; letter-spacing: 0.04em; margin-bottom: 12px; }
.block > h2::after, .block > div > h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.block > p { margin-top: 10px; }
.block > .sub { margin: -4px 0 12px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.card h2 { font-size: 1rem; }
.card h2 a { color: var(--ink); }
h2.group { font-size: 0.92rem; margin: 26px 0 12px; color: var(--sub); display: flex; align-items: center; gap: 12px; }
h2.group::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 8px; }
.summary li { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 12px 16px 13px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.summary span { font-size: 0.76rem; color: var(--sub); font-weight: 700; }
.summary b { font-family: var(--mono); font-size: 1.65rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.nums { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--sub); font-size: 0.86rem; }
.nums b { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }

.rows { border-top: 1px solid var(--rule-2); }
.rows a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--rule-2); color: var(--ink-2); font-size: 0.88rem; }
.rows a:hover { color: var(--accent-ink); text-decoration: none; background: linear-gradient(90deg, transparent, var(--accent-soft)); }
.rows b { font-family: var(--mono); font-weight: 600; font-size: 0.96rem; color: var(--ink); }
.rows b.warn { color: var(--bad); }

.steps { list-style: none; counter-reset: s; display: grid; gap: 8px; margin-bottom: 18px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 0.92rem; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: 0.78rem; font-weight: 600; }
.notes { list-style: disc; padding-left: 1.3em; display: grid; gap: 5px; font-size: 0.92rem; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips li { background: var(--surface); border: 1px solid var(--rule); border-radius: 5px; padding: 2px 10px; font-size: 0.84rem; }
.chips li.warn { border-color: var(--bad); }
details { margin: 12px 0; }
summary { cursor: pointer; font-weight: 700; }
.warns { margin-top: 6px; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 8px 12px 8px 30px; list-style: disc; font-size: 0.86rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 24px; margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow); }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 0.74rem; color: var(--sub); font-weight: 700; letter-spacing: 0.04em; }
.facts dd { margin: 0; }

/* ───────── 棚割の図・札 ───────── */
svg.plano { display: block; font-family: var(--font); user-select: none; -webkit-user-select: none; }
.blueprint, .sheet, .pe-canvas, .pcard .pic {
  background-color: #fcfdff;
  background-image: linear-gradient(var(--grid-a) 1px, transparent 1px), linear-gradient(90deg, var(--grid-a) 1px, transparent 1px), linear-gradient(var(--grid-b) 1px, transparent 1px), linear-gradient(90deg, var(--grid-b) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
  background-position: -1px -1px;
}
.sheet { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 12px; margin-bottom: 14px; }
.sheet svg { width: 100%; height: auto; max-height: 78vh; }

.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.pcards.wide { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.pcard { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px; align-items: start; box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.pcard:hover { border-color: var(--accent-line); box-shadow: var(--shadow-lg); }
.pcard .pic { display: grid; place-items: center; border: 1px solid var(--rule-2); border-radius: var(--r); height: 176px; padding: 6px; }
.pcard .pic:hover { text-decoration: none; }
.pcard .pic svg { max-width: 100%; max-height: 164px; width: auto; height: 164px; }
.pcard > div { display: grid; gap: 7px; align-content: start; min-width: 0; }
.pcard h3 { font-size: 1.02rem; line-height: 1.4; }
.pcard h3 a { color: var(--ink); }
.pcard h3 a:hover { color: var(--accent-ink); }
.pcard p:has(.tag) { display: flex; flex-wrap: wrap; gap: 5px; }
.pcard form.inline { flex-wrap: wrap; margin-top: 4px; }
.pcard form.inline select { flex: 1 1 120px; min-width: 0; }
form.inline.add { margin-top: 14px; flex-wrap: wrap; padding: 10px; border: 1px dashed var(--rule); border-radius: var(--r-lg); background: var(--sunken); }
form.inline.add select { max-width: 320px; }
.bulk { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 10px 14px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 2; box-shadow: var(--shadow-lg); }
.vers { display: grid; gap: 0; max-height: 260px; overflow: auto; }
.vers li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule-2); font-size: 0.88rem; }
.vers li:last-child { border-bottom: 0; }
.vers span { color: var(--sub); font-size: 0.82rem; }
.vers li a + a, .vers li .tag { margin-left: auto; }

/* ───────── 写真 ───────── */
.imgbox { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.imgbox > div { display: grid; gap: 8px; }
.imgbox img { width: 150px; height: 150px; object-fit: contain; background: var(--sunken); border: 1px solid var(--rule-2); border-radius: var(--r); }
.swatch { width: 96px; height: 96px; border-radius: var(--r); border: 1px solid #0002; flex: none; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.photos figure { display: grid; gap: 6px; justify-items: start; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); border: 1px solid var(--rule); display: block; }

/* ───────── 入口: 棚割の「やること」 ───────── */
/* 仕事の順の道しるべ（細い 1 行） */
.trail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: -8px 0 20px; font-size: 0.84rem; color: var(--sub); }
.trail li { display: flex; align-items: center; }
.trail li + li::before { content: ""; width: 22px; height: 1px; background: #cfcbc0; margin: 0 8px; }
.trail a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 700; }
.trail i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: 0.72rem; font-weight: 600; }
/* 今やること: 文と、押す所 1 つ */
.todo > h2 { font-size: 1rem; letter-spacing: 0.04em; margin-bottom: 10px; }
.todolist { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.todolist li { display: flex; align-items: center; gap: 12px 18px; padding: 14px 18px; }
.todolist li + li { border-top: 1px solid var(--rule-2); }
.todolist p { flex: 1; min-width: 0; font-size: 1rem; line-height: 1.55; }
.todolist p b { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; }
.todolist p small { display: block; color: var(--sub); font-size: 0.82rem; }
.todolist .btn { flex: none; min-width: 124px; }
.todolist .btn .ic { order: 2; }
.todo-none { display: flex; align-items: center; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); color: var(--ok); font-weight: 700; }
details.more > summary { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-size: 0.88rem; list-style: none; padding: 4px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; font-size: 0.74rem; }
details.more[open] > summary::before { content: "▾"; }
details.more > summary + * { margin-top: 8px; }
.planlist td:first-child small { display: block; }
/* 初めて開いたとき */
.start { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 26px; display: grid; gap: 16px; }
.start + .start { margin-top: 16px; }
.start h2 { font-size: 1.12rem; }
.start3 { display: grid; gap: 0; }
.start3 li { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
.start3 li + li { border-top: 1px solid var(--rule-2); }
.start3 i { flex: none; font-style: normal; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-weight: 600; }
.start3 div { flex: 1; min-width: 0; display: grid; }
.start3 div b { font-size: 1.05rem; }
.start3 div span { color: var(--sub); font-size: 0.9rem; }
.start3 .later { flex: none; color: var(--faint); font-size: 0.82rem; }
.start.try { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; background: var(--sunken); box-shadow: none; }
.start.try > div { flex: 1 1 320px; display: grid; gap: 4px; }
.start.try h2 { font-size: 1rem; }
/* 設定の入口 */
.block.first { margin-top: 0; }
.setlist { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.setlist li + li { border-top: 1px solid var(--rule-2); }
.setlist a { display: flex; align-items: center; gap: 14px; padding: 13px 16px; color: var(--ink); }
.setlist a:hover { background: var(--hover); text-decoration: none; }
.setlist a > span:nth-child(2) { flex: 1; min-width: 0; display: grid; line-height: 1.45; }
.setlist small { color: var(--sub); font-size: 0.84rem; }
.setlist a > .ic { color: var(--faint); }
.set-ic { flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
/* 文の下にボタン（左寄せ）。右下に置くと、たなべ君の窓を開いたままの幅の狭い画面で、窓の下に隠れて押せない */
.setcard { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
@media (max-width: 820px) {
  .todolist li { flex-wrap: wrap; padding: 14px; }
  .todolist p { flex-basis: 100%; }
  .todolist .btn { flex: 1; height: 40px; }
  .start { padding: 18px 16px; }
  .start3 li { flex-wrap: wrap; gap: 8px 12px; }
  .start3 div { flex-basis: calc(100% - 50px); }
  .start3 .btn { width: 100%; height: 42px; }
  .start3 .later { margin-left: 46px; }
  .trail li + li::before { width: 10px; margin: 0 5px; }
}

/* ───────── 入口: 営業支援の「今日まわる店」 ───────── */
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.vcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.vcard .who-line { font-size: 0.76rem; color: var(--sub); display: flex; gap: 8px; flex-wrap: wrap; }
.vcard h3 { font-size: 1.1rem; line-height: 1.35; margin: 1px 0 7px; }
.vcard h3 a { color: var(--ink); }
.vcard h3 a:hover { color: var(--accent-ink); }
.vcard .last { text-align: right; font-size: 0.74rem; color: var(--sub); line-height: 1.4; margin-bottom: 8px; }
.vcard .last b { display: block; font-family: var(--mono); font-size: 0.96rem; color: var(--ink); font-weight: 600; }
.vcard .last b.warn { color: var(--bad); }
.whys { display: flex; flex-wrap: wrap; gap: 4px; }
.why { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; background: #ebe9e3; color: #4c535b; }
.why.over { background: var(--bad); color: #fff; }
.why.due { background: var(--accent); color: #fff; }
.why.never, .why.long { background: var(--warn-soft); color: var(--warn); }
.why.shelf, .why.out, .why.pop { background: var(--bad-soft); color: var(--bad); }

/* ───────── 店舗のページ ───────── */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 8px; }
.hero > div { padding: 18px 22px; }
.hero > div + div { border-left: 1px solid var(--rule-2); background: var(--sunken); }
.hero dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.hero dt { font-size: 0.72rem; color: var(--sub); font-weight: 700; letter-spacing: 0.04em; }
.hero dd { font-size: 0.92rem; }
.hero .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.hero .stats div { display: grid; }
.hero .stats span { font-size: 0.72rem; color: var(--sub); font-weight: 700; }
.hero .stats b { font-family: var(--mono); font-size: 1.5rem; font-weight: 600; line-height: 1.25; }
.hero .stats small { font-size: 0.74rem; color: var(--sub); }

/* ───────── 棚割の編集（作業用の画面） ───────── */
.pe-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 12px; }
.pe-meta label { display: grid; gap: 3px; font-size: 0.74rem; font-weight: 700; color: var(--sub); }
.pe-meta .grow { flex: 1 1 260px; }
.pe-meta input { width: 100%; min-width: 200px; }
.pe { display: grid; grid-template-columns: 272px minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
.pe-pal, .pe-side { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 10px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.pe-pal { height: calc(100vh - 200px); min-height: 520px; display: flex; flex-direction: column; position: sticky; top: 12px; }
.pe-pal input[type="search"], .pe-pal select { width: 100%; }
.pe-pal ul { overflow-y: auto; display: grid; gap: 4px; align-content: start; margin: 0 -4px; padding: 0 4px 4px; flex: 1; min-height: 0; }
.pe-pal li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 7px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--surface); cursor: grab; transition: border-color 0.1s, background 0.1s; }
.pe-pal li:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.pe-pal li.none { display: block; cursor: default; border: 0; background: none; color: var(--sub); font-size: 0.84rem; }
.pe-pal .sw { width: 22px; height: 28px; border-radius: 3px; border: 1px solid #0002; }
.pe-pal .nm { font-size: 0.84rem; line-height: 1.35; overflow: hidden; }
.pe-pal .nm b { font-family: var(--mono); font-size: 0.74rem; font-weight: 600; color: var(--sub); letter-spacing: 0; }
.pe-pal .nm small { display: block; color: var(--sub); font-size: 0.72rem; }
.pe-pal i { font-style: normal; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; }
.pe-pal .add { border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; width: 26px; height: 26px; font-weight: 700; cursor: pointer; color: var(--ink); display: grid; place-items: center; padding: 0; }
.pe-pal .add:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pal-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: var(--sunken); border: 1px solid var(--rule-2); border-radius: 9px; }
.pal-tabs button { border: 0; background: none; border-radius: 6px; padding: 6px 0; font: inherit; font-weight: 700; font-size: 0.88rem; cursor: pointer; color: var(--sub); }
.pal-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.pal-box { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.pal-box[hidden] { display: none; }
.pe-pal li[data-popid] { grid-template-columns: 54px minmax(0, 1fr) auto; }
.pe-pal li.pophead { display: block; border: 0; background: none; padding: 6px 2px 0; font-size: 0.74rem; font-weight: 700; color: var(--accent-ink); cursor: default; letter-spacing: 0.04em; }

.pe-main { min-width: 0; }
.pe-mode { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 10px; padding: 3px; background: var(--ink); border-radius: 10px; }
.pe-mode button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; color: #c4c9d0; font: inherit; font-size: 0.98rem; font-weight: 700; padding: 8px 22px; border-radius: 8px; cursor: pointer; }
.pe-mode button:hover { color: #fff; }
.pe-mode button.on { background: var(--accent); color: #fff; }
.pe-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.pe-tools .sp { flex: 1; }
.pe-tools select { height: 30px; min-height: 0; padding-top: 2px; padding-bottom: 2px; font-size: 0.84rem; font-weight: 700; }
.pe-tools .state { flex: 1 1 0; min-width: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.84rem; color: var(--sub); margin: 0 6px; }
.pe-tools .state.warn { color: var(--bad); font-weight: 700; }
.legend { flex: 1 1 0; min-width: 0; font-size: 0.78rem; line-height: 1.4; }
.pe-canvas { height: calc(100vh - 330px); min-height: 520px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 2px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04); }
.pe-canvas .it, .pe-canvas .pop { cursor: grab; }
.pe-canvas .row { cursor: ns-resize; }
.pe-main > .sub { margin-top: 6px; }
.pe-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.pe-side h3 { font-size: 0.96rem; line-height: 1.4; }
.pe-side > div { display: grid; gap: 9px; }
.pe-side > div + div { border-top: 1px solid var(--rule-2); padding-top: 12px; }
.pe-side label { display: grid; gap: 3px; font-size: 0.76rem; font-weight: 700; color: var(--sub); }
.pe-side input, .pe-side select { width: 100%; }
.pe-side .flash { margin: 0; font-size: 0.84rem; padding: 7px 10px; }
.pe-side ul.flash { padding-left: 26px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper span { font-size: 0.78rem; font-weight: 700; color: var(--sub); margin-right: auto; }
.stepper b { font-family: var(--mono); font-size: 1.5rem; font-weight: 600; min-width: 2ch; text-align: center; }
.stepper .btn { width: 34px; padding: 0; font-size: 1.05rem; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-hold { margin-top: 8px; min-height: 48px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--surface); border: 1.5px dashed #cdc9be; border-radius: var(--r-lg); padding: 8px 12px; }
.pe-hold.over { border-color: var(--accent); background: var(--accent-soft); }
.pe-hold > b { font-size: 0.82rem; margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 2px 4px 2px 6px; font-size: 0.82rem; cursor: grab; }
.chip .sw { width: 14px; height: 18px; border-radius: 2px; border: 1px solid #0002; }
.chip b { font-family: var(--mono); font-size: 0.74rem; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--sub); font-size: 1rem; line-height: 1; padding: 2px 4px; }
.chip button:hover { color: var(--bad); }
.pe-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; padding: 5px 11px; border-radius: 7px; font-size: 0.84rem; font-weight: 700; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: var(--shadow-lg); }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; box-shadow: none; }
.seg .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.seg .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.stage3d { height: calc(100vh - 290px); min-height: 460px; background: #e8e4d8; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.pe .stage3d { height: calc(100vh - 330px); min-height: 520px; }
.stage3d canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.stage3d canvas:active { cursor: grabbing; }
.pick3 { min-height: 1.6em; margin: 6px 0 2px; color: var(--ink); font-weight: 700; font-size: 0.9rem; }

/* POP の絵と、商品に合う POP */
.popthumb { width: 54px; height: 40px; object-fit: contain; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; flex: none; display: grid; place-items: center; font-size: 0.6rem; font-weight: 700; color: #7a1f12; overflow: hidden; line-height: 1.1; text-align: center; }
.popbig { width: 100%; max-height: 150px; object-fit: contain; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.relpops { display: grid; gap: 6px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-lg); padding: 10px; }
.relpops h4 { margin: 0; font-size: 0.84rem; color: var(--accent-ink); }
.relpop { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--surface); border-radius: var(--r); padding: 5px 6px; }
.relpop .nm { font-size: 0.8rem; line-height: 1.35; overflow: hidden; }
.relpop small { display: block; color: var(--sub); font-size: 0.7rem; }
.diff2 h3 { margin: 0 0 6px; font-size: 0.92rem; }
.diff2 .sheet svg { max-height: 62vh; }

/* ───────── ログイン ───────── */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr); background: var(--bg); }
.gate-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background-color: #10141a;
  background-image: linear-gradient(#ffffff0b 1px, transparent 1px), linear-gradient(90deg, #ffffff0b 1px, transparent 1px), linear-gradient(#ffffff05 1px, transparent 1px), linear-gradient(90deg, #ffffff05 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px;
}
.gate-art::after { content: ""; position: absolute; inset: auto -20% -40% auto; width: 70%; aspect-ratio: 1; background: radial-gradient(circle, #2b47c355, transparent 65%); pointer-events: none; }
.gate-art .mark { display: flex; align-items: center; gap: 12px; }
.gate-art .mark svg, .gate-art .mark .mark-img { width: 40px; height: 40px; }
.gate-art .mark b { font-size: 1.5rem; letter-spacing: 0.12em; color: #fff; line-height: 1.3; }
.gate-art .mark small { display: block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.3em; color: #8a929c; font-weight: 400; }
.gate-art h1 { font-size: clamp(1.8rem, 3.2vw, 2.7rem); line-height: 1.45; letter-spacing: 0.04em; margin: 40px 0 16px; }
.gate-art h1 em { font-size: inherit; font-weight: inherit; margin: 0; }
.gate-art h1 em.c1 { color: #8fa4ff; }
.gate-art h1 em.c2 { color: #ff9b63; }
.gate-art p { color: #a9b0b9; max-width: 34em; font-size: 0.94rem; }
.gate-art .drawing { position: relative; z-index: 1; width: min(520px, 100%); margin-top: 36px; }
.gate-art .sides { display: flex; gap: 22px; margin-top: 28px; font-size: 0.84rem; color: #c4c9d0; flex-wrap: wrap; }
.gate-art .sides span { display: flex; align-items: center; gap: 8px; }
.gate-art .sides i { width: 10px; height: 10px; border-radius: 3px; background: #2b47c3; }
.gate-art .sides span + span i { background: #d9530f; }
.gate-form { display: grid; place-items: center; padding: 40px 28px; }
/* 絵の側を出さない形（運営者の入口・パスワードの決め直し など）。上に細い帯、下に欄だけ */
.gate.plain { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.gate-bar { display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: #10141a; color: #fff; }
.gate-bar svg, .gate-bar .mark-img { width: 28px; height: 28px; flex: none; }
.gate-bar b { letter-spacing: 0.12em; }
.gate-bar small { color: #a9b0b9; font-size: 0.8rem; margin-left: 6px; }
.gate.plain .gate-form { place-items: start center; padding-top: min(14vh, 120px); }
.login { width: min(380px, 100%); display: grid; gap: 16px; animation: rise 0.5s ease-out both; }
.login h2 { font-size: 1.5rem; letter-spacing: 0.04em; }
.login > p:not(.flash) { color: var(--sub); margin-top: -10px; font-size: 0.9rem; }
.login label { display: grid; gap: 5px; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.login input { height: 46px; font-size: 1rem; }
.login .btn { height: 48px; font-size: 1.02rem; margin-top: 4px; }
.login .foot { font-size: 0.78rem; color: var(--faint); margin-top: 8px; }
.login p, .login .flash span, .login .foot { word-break: auto-phrase; text-wrap: pretty; }
.login .codehelp summary { cursor: pointer; color: var(--accent-ink); }
.login .codehelp p { margin-top: 6px; color: var(--sub); }
.login .gate-btns { display: grid; gap: 10px; margin: 0; }

/* ───────── 動き ───────── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.vcards > *, .summary > *, .pcards > *, .cards > * { animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.vcards > :nth-child(2), .summary > :nth-child(2), .pcards > :nth-child(2), .cards > :nth-child(2) { animation-delay: 0.04s; }
.vcards > :nth-child(3), .summary > :nth-child(3), .pcards > :nth-child(3), .cards > :nth-child(3) { animation-delay: 0.08s; }
.vcards > :nth-child(4), .summary > :nth-child(4), .pcards > :nth-child(4), .cards > :nth-child(4) { animation-delay: 0.12s; }
.vcards > :nth-child(n + 5), .summary > :nth-child(n + 5), .pcards > :nth-child(n + 5), .cards > :nth-child(n + 5) { animation-delay: 0.16s; }
.vcards > :nth-child(n + 9), .pcards > :nth-child(n + 9) { animation: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ───────── 幅が狭いとき ───────── */
.mtop { display: none; }
@media (max-width: 1180px) {
  .pe { grid-template-columns: 240px minmax(0, 1fr); }
  .pe-side { grid-column: 1 / -1; position: static; max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-side > div + div { border-top: 0; padding-top: 0; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero > div + div { border-left: 0; border-top: 1px solid var(--rule-2); }
}
@media (max-width: 900px) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-art { padding: 28px 24px; }
  .gate-art .drawing, .gate-art p, .gate-art .sides { display: none; }
  .gate-art h1 { margin: 18px 0 0; font-size: 1.5rem; }
}
@media (max-width: 820px) {
  html { font-size: 15.5px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: auto 0 0 0; height: auto; z-index: 30; flex-direction: row; overflow: visible; border-top: 1px solid #ffffff14; padding-bottom: env(safe-area-inset-bottom); }
  .side .brand, .side .modes, .side .modetext, .side .who, .side nav p, .side nav .common { display: none; }
  .side nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; padding: 4px 4px 6px; width: 100%; }
  .side nav a { flex-direction: column; gap: 3px; padding: 7px 2px 5px; font-size: 0.66rem; text-align: center; line-height: 1.2; border-radius: 8px; }
  .side nav a .ic { width: 21px; height: 21px; }
  .side nav a.on::before { left: 22%; right: 22%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 25; background: var(--side); color: #fff; padding: 8px 12px; }
  .mtop .brand { padding: 0; margin-right: auto; }
  .mtop .brand svg, .mtop .brand .mark-img { width: 26px; height: 26px; }
  .mtop .brand small { display: none; }
  .mtop .modes { margin: 0; }
  .mtop .modes a { padding: 5px 12px; grid-auto-flow: column; gap: 6px; }
  .mtop .modes a small, .mtop .modes a .ic { display: none; }
  .mtop details { position: relative; margin: 0; }
  .mtop summary { list-style: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--side-2); border: 1px solid #ffffff1c; color: #fff; }
  .mtop summary::-webkit-details-marker { display: none; }
  .mtop .menu { position: absolute; right: 0; top: 44px; width: 230px; background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 8px; display: grid; gap: 2px; z-index: 40; }
  .mtop .menu p { padding: 6px 10px; font-size: 0.8rem; color: var(--sub); border-bottom: 1px solid var(--rule-2); margin-bottom: 4px; }
  .mtop .menu a, .mtop .menu button { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--r); color: var(--ink); font: inherit; font-weight: 700; font-size: 0.9rem; background: none; border: 0; text-align: left; width: 100%; cursor: pointer; }
  .mtop .menu a:hover, .mtop .menu button:hover { background: var(--hover); text-decoration: none; }
  .main { padding: 18px 14px 96px; }
  .head h1 { font-size: 1.35rem; }
  .head .acts { margin-left: 0; width: 100%; }
  .edit label.wide { grid-column: auto; }
  .edit .grid { padding: 16px; }
  .pe { grid-template-columns: minmax(0, 1fr); }
  .pe-pal { height: 320px; min-height: 0; position: static; }
  .pe-side { grid-template-columns: minmax(0, 1fr); }
  .pcard { grid-template-columns: 110px minmax(0, 1fr); }
  .pcard .pic { height: 140px; }
  .pcard .pic svg { height: 128px; }
  .pcards, .pcards.wide, .vcards { grid-template-columns: minmax(0, 1fr); }
  .vcard { grid-template-columns: minmax(0, 1fr); }
  .vcard .last { text-align: left; display: flex; gap: 8px; align-items: baseline; margin: 0; }
  .vcard .last b { display: inline; }
  .vcard .btn { width: 100%; height: 42px; }
  .hero dl, .hero .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters input[type="search"] { flex-basis: 100%; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary b { font-size: 1.35rem; }
  form.inline input { width: 100%; }
}

/* 訪店記録の入力（現場で、指で押しやすく） */
.qtybox { display: inline-flex; align-items: stretch; border: 1px solid #d6d2c8; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.qtybox input.qty { border: 0; border-radius: 0; width: 64px; text-align: center; box-shadow: none; }
.qtybox button { width: 36px; border: 0; background: var(--sunken); font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.qtybox button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.qtybox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.radios { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.radios label { display: inline-flex; align-items: center; gap: 0; cursor: pointer; }
.radios input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radios span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 99px; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); background: var(--surface); }
.radios input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.radios input:checked + span.ok { background: var(--ok); border-color: var(--ok); }
.radios input:checked + span.bad { background: var(--bad); border-color: var(--bad); }
.radios input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 820px) {
  .list.fieldform thead { display: none; }
  .list.fieldform tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--rule-2); }
  .list.fieldform td { border: 0; padding: 0; }
  .list.fieldform td.opt { display: none; }
  .list.fieldform td.name { grid-column: 1; font-weight: 700; }
  .list.fieldform td.ctl { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .list.fieldform td.meta { grid-column: 1; font-size: 0.78rem; color: var(--sub); font-family: var(--font); text-align: left; }
}

/* ───────── 印刷 ───────── */
@media print {
  html { font-size: 10px; }
  body { background: #fff; }
  .app { display: block; }
  .side, .mtop, .acts, .filters, .pager, .flash, .danger, .bar, .tabs, .noprint, .lead, .bulk, .modes, .modetext { display: none !important; }
  .main { padding: 0; }
  .tablewrap, .summary li, .card, .hero, .vcard { border: 0; box-shadow: none; }
  .tablewrap { overflow: visible; }
  .list th { position: static; background: #fff; border-bottom: 1.5px solid #000; }
  .list td { border-bottom: 1px solid #999; }
  a { color: #000; }
  .sheet, .blueprint { border: 0; padding: 0; background: none; }
  .sheet svg { max-height: 150mm; }
  .two { display: block; }
  .diff2 { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  .diff2 .sheet svg { max-height: 110mm; }
  .kind { color: #000; background: none !important; border: 1px solid #000; }
  .stage3d { height: 150mm; }
  * { animation: none !important; }
}

/* 取り込み・空の画面・小さな色見本 */
.import.card { margin-top: 0; }
.import-two { align-items: start; }
.import-two > .block { margin-top: 0; }
.drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 1.5px dashed var(--accent-line); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; text-align: center; transition: background 0.15s; }
.drop:hover { background: #fff; }
.drop .ic { width: 28px; height: 28px; }
.drop span { font-weight: 700; }
.drop small { color: var(--sub); font-size: 0.78rem; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.import [data-result] { margin-top: 14px; }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 80px 20px; }
.empty > .ic { width: 40px; height: 40px; color: var(--faint); }
.empty h1 { font-size: 1.3rem; }
.empty p { color: var(--sub); }
.swatch.mini { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: -4px; }
.edit.narrow .grid { max-width: 560px; }

/* 入口の画面の細部 */
.rows a .ic { width: 15px; height: 15px; color: var(--faint); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
@media (min-width: 1500px) { .split { grid-template-columns: minmax(0, 2.4fr) minmax(300px, 1fr); } }
.split .list td:first-child { min-width: 13em; }
.review { display: inline-flex; gap: 4px; }
.review span { font-family: var(--mono); font-size: 0.78rem; font-weight: 600; padding: 1px 7px; border-radius: 4px; }
.review .up { background: var(--ok-soft); color: var(--ok); }
.review .down { background: var(--bad-soft); color: var(--bad); }
.review:hover { text-decoration: none; filter: brightness(0.96); }
a.tag:hover { text-decoration: none; filter: brightness(0.96); }
.list td small { font-family: var(--font); }
.news { gap: 10px; }
.bars { display: grid; gap: 2px; }
.bars a { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--rule-2); color: var(--ink); }
.bars a:hover { background: var(--hover); text-decoration: none; }
.bars a > span:first-child { display: grid; line-height: 1.35; font-size: 0.88rem; }
.bars small.mono { font-size: 0.72rem; color: var(--sub); }
.bars b { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.bars b small { color: var(--sub); font-weight: 400; font-size: 0.74rem; }
.bars a > span:first-child b { font-family: var(--font); font-weight: 700; white-space: normal; } /* 商品名は、ほかの画面と同じ字（数だけ等幅） */
.meter { height: 6px; border-radius: 3px; background: var(--rule-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--bad); border-radius: 3px; }
.summary li.hot { background: var(--accent); border-color: var(--accent); color: #fff; }
.summary li.hot span { color: #ffffffcc; }
.block > h2 small { font-family: var(--mono); font-weight: 400; letter-spacing: 0; order: 2; }
.block > h2 small + ::after { order: 3; }
.list tr.me td { background: var(--accent-soft); }
.vcard .who-line .ic { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 1180px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* 店舗のページ・データの取り込み・写真 */
.hero dl > div.wide { grid-column: 1 / -1; }
.hero .stats b small { font-size: 0.8rem; color: var(--sub); font-weight: 400; }
.hero .stats b.warn { color: var(--bad); }
.tabs.jump { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: 18px 0 0; }
.tabs .ic { width: 15px; height: 15px; vertical-align: -2px; }
html { scroll-padding-top: 56px; scroll-behavior: smooth; }
.pc-acts { margin-top: 2px; }
.pc-state { margin: 2px 0 0; }
.pc-state summary { font-size: 0.8rem; color: var(--sub); font-weight: 700; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.pc-state summary::before { content: "▸"; font-size: 0.7rem; }
.pc-state[open] summary::before { content: "▾"; }
.pc-state summary::-webkit-details-marker { display: none; }
.pc-state form { margin-top: 6px; }
form.inline.add > .ic { color: var(--accent); }
.foot-note { margin-top: 26px; display: flex; align-items: center; gap: 6px; }
.datacard { position: relative; padding-left: 70px; }
.dc-ic { position: absolute; left: 18px; top: 18px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.datacard .bar { margin-top: 6px; }
.drop.small { padding: 12px 16px; grid-auto-flow: column; justify-content: start; gap: 8px; }
.drop.small .ic { width: 20px; height: 20px; }
.list td .ic { width: 14px; height: 14px; vertical-align: -2px; }
.list td a.mono { font-weight: 600; color: var(--ink); }

/* ───────── 棚割の編集: 画面いっぱいの作業場 ───────── */
body.ws-page .main { padding: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body.ws-page .main > .flash { margin: 10px 16px 0; }
.ws { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wsbar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--surface); border-bottom: 1px solid var(--rule-2); flex-wrap: wrap; }
.wsbar .back { width: 34px; padding: 0; }
.wstitle { flex: 1 1 320px; min-width: 200px; font-size: 1.18rem; font-weight: 700; letter-spacing: 0.02em; border-color: transparent; background: transparent; box-shadow: none; height: 40px; }
.wstitle:hover { border-color: var(--rule); background: var(--surface); }
.statebox { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.statebox label { cursor: pointer; }
.statebox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.statebox span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; font-size: 0.82rem; font-weight: 700; color: var(--sub); background: var(--surface); }
.statebox label + label span { border-left: 1px solid var(--rule); }
.statebox input:checked + span { background: var(--ink); color: #fff; }
.statebox input[value="確定"]:checked + span { background: var(--ok); }
.statebox input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.wsmeta { font-size: 0.82rem; color: var(--sub); white-space: nowrap; }
.wsmeta b { font-family: var(--mono); color: var(--ink); }
.wsbar .state { flex: 0 1 auto; max-width: 260px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.84rem; color: var(--sub); }
.wsbar .state.warn { color: var(--bad); font-weight: 700; }
.ptabs { margin-bottom: 0; }
.ws > .ptabs { background: var(--surface); padding: 0 12px; }
.wsflash { margin: 10px 16px 0; }
.ws .pe { flex: 1; min-height: 0; padding: 12px; align-items: stretch; grid-template-columns: 268px minmax(0, 1fr) 296px; }
.ws .pe-pal { height: auto; min-height: 0; position: static; }
.ws .pe-main { display: flex; flex-direction: column; min-height: 0; }
.ws .pe-canvas, .ws .pe .stage3d, .ws .stage3d { flex: 1; height: auto; min-height: 0; }
.ws .pe-side { position: static; max-height: none; min-height: 0; overflow-y: auto; align-content: start; }
.ws .pe-side > div + div { border-top: 0; padding-top: 0; }
.ws .pe-side [data-ipane] { display: grid; gap: 14px; }
.ws .pe-side [data-ipane][hidden] { display: none; }
.ws .pe-side [data-panel], .ws .pe-side [data-sum] { display: grid; gap: 9px; }
.iblock { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--rule-2); }
.iblock h3 { font-size: 0.84rem; color: var(--sub); }
.itabs button { font-size: 0.82rem; }
.pe-tools .pe-mode { margin: 0; }
.pe-tools .pe-mode button { padding: 6px 16px; font-size: 0.88rem; }
.pe-tools .pe-mode .ic { width: 16px; height: 16px; }
.tsep { width: 1px; height: 22px; background: var(--rule); margin: 0 4px; }
.pe-tools .btn.ghost.small { padding: 0 8px; }
.pe-tools .seg.zoom .btn { width: 32px; padding: 0; }
.tools3d { padding: 6px 8px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--r-lg); }
.pe-pal .pal-tabs .ic, .itabs .ic { width: 15px; height: 15px; vertical-align: -2px; }
.printhead { display: none; }
@media (max-width: 1180px) {
  .ws .pe { grid-template-columns: 240px minmax(0, 1fr); }
  .ws .pe-side { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr); max-height: 360px; }
}
@media (max-width: 820px) {
  body.ws-page .main { height: auto; overflow: visible; padding-bottom: 90px; }
  .ws .pe { grid-template-columns: minmax(0, 1fr); }
  .ws .pe-pal { height: 300px; }
  .ws .pe-canvas, .ws .stage3d { height: 60vh; flex: none; }
  .wsmeta { display: none; }
}
@media print { .printhead { display: block; margin-bottom: 8px; } .ptabs, .wsbar { display: none !important; } }

/* 編集画面では、サイドメニューをアイコンだけに細くする */
@media (min-width: 821px) {
  body.ws-page .app { grid-template-columns: 62px minmax(0, 1fr); }
  body.ws-page .side .brand span, body.ws-page .side .modetext, body.ws-page .side nav p, body.ws-page .side nav a span,
  body.ws-page .who b, body.ws-page .who i, body.ws-page .who .links, body.ws-page .side .modes a b, body.ws-page .side .modes a small { display: none; }
  body.ws-page .side .brand { justify-content: center; padding: 14px 0 12px; }
  body.ws-page .side .modes { grid-template-columns: 1fr; margin: 0 8px; gap: 2px; }
  body.ws-page .side .modes a { padding: 9px 0; }
  body.ws-page .side .modes a .ic { width: 19px; height: 19px; }
  body.ws-page .side nav { padding: 12px 8px; gap: 3px; }
  body.ws-page .side nav a { justify-content: center; padding: 10px 0; }
  body.ws-page .side nav a.on::before { left: -8px; }
  body.ws-page .side nav a.common:first-of-type { margin-top: 14px; }
  body.ws-page .who { grid-template-columns: 1fr; justify-items: center; padding: 12px 0 14px; }
}
.ws .pe-tools { flex-wrap: wrap; }
.ws .pe-tools > * { flex-shrink: 0; }
.ws .pe-tools .check { white-space: nowrap; }

/* 図の右上に重ねる表示の切り替え（地図の道具のように） */
.pe-stagewrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pe-stagewrap > .pe-canvas, .pe-stagewrap > .stage3d { flex: 1; min-height: 0; height: auto; }
.canvas-ctl { position: absolute; top: 10px; right: 14px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 8px; background: #ffffffeb; border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow-lg); backdrop-filter: blur(6px); }
.canvas-ctl select { height: 30px; min-height: 0; padding-top: 2px; padding-bottom: 2px; font-size: 0.82rem; font-weight: 700; }
.canvas-ctl .seg.zoom .btn { width: 32px; padding: 0; }
.pe-stagewrap > .legend { position: absolute; left: 12px; bottom: 12px; z-index: 3; max-width: min(520px, 70%); margin: 0; padding: 7px 10px; background: #ffffffeb; border: 1px solid var(--rule); border-radius: var(--r); font-size: 0.76rem; color: var(--ink-2); box-shadow: var(--shadow); }
.pe-stagewrap > .legend[hidden] { display: none; }
@media (max-width: 820px) { .canvas-ctl { position: static; margin-bottom: 8px; flex-wrap: wrap; box-shadow: none; } .pe-stagewrap > .legend { position: static; max-width: none; margin-bottom: 8px; } }

/* 訪店記録の入力 */
.visitform { display: grid; gap: 18px; }
.vstep { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.vstep > h2 { display: flex; align-items: center; gap: 10px; font-size: 1rem; padding: 14px 18px; border-bottom: 1px solid var(--rule-2); background: var(--sunken); }
.vstep > h2 i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 0.82rem; }
.vstep > h2 small { font-size: 0.78rem; font-weight: 400; color: var(--sub); }
.vstep .grid { border: 0; border-radius: 0; box-shadow: none; }
.vstep .tablewrap { border: 0; border-radius: 0; box-shadow: none; }
.vstep > .none { padding: 18px !important; }
.edit .field { display: grid; gap: 7px; }
.edit .field > span { font-size: 0.8rem; color: var(--ink-2); font-weight: 700; }
.edit .full, .edit .field.full { grid-column: 1 / -1; }
.list.fieldform td { padding: 10px 16px; }
.list.fieldform td.name { font-weight: 700; }
.list.fieldform td.name small { font-weight: 400; color: var(--sub); margin-left: 6px; }
.list.fieldform td.meta { color: var(--sub); font-size: 0.82rem; white-space: nowrap; }
.list.fieldform td.ctl { text-align: right; white-space: nowrap; }
.list.fieldform tr.is-out td.meta { color: var(--bad); }
.bar.sticky { position: sticky; bottom: 0; z-index: 4; margin: 0 -32px -72px; padding: 14px 32px; background: #f3f2eef2; border-top: 1px solid var(--rule); backdrop-filter: blur(6px); }
@media (max-width: 820px) {
  .bar.sticky { bottom: 64px; margin: 0 -14px; padding: 12px 14px; }
  .bar.sticky .btn { flex: 1; }
  .bar.sticky .sub { display: none; }
  .list.fieldform td.ctl { justify-self: end; }
}

/* 細部の手直し */
.summary { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.summary b { font-size: clamp(1.25rem, 1.6vw, 1.65rem); overflow-wrap: anywhere; }
.range { flex-wrap: wrap; }
.range input[type="date"] { min-width: 0; width: 150px; }
.range .ic { width: 16px; height: 16px; color: var(--faint); }
@media (max-width: 820px) {
  .range { width: 100%; }
  .range input[type="date"] { flex: 1; width: auto; }
  .head .acts .btn.ghost { padding: 0 8px; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pcards.wide { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

/* 段を置く場所を選んでいるあいだ */
.pe-tools .btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
body.placing .pe-canvas, body.placing .pe-canvas * { cursor: crosshair !important; }
body.placing .pe-canvas, body.placing .stage3d { outline: 2px dashed var(--accent); outline-offset: -2px; }
body.placing .wsbar .state { color: var(--accent-ink); font-weight: 700; max-width: 520px; }

/* 編集画面の使い方 */
.howto { display: grid; gap: 2px 0; font-size: 0.8rem; }
.howto dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
.howto dd { margin: 0; color: var(--sub); line-height: 1.55; }

/* 商品の横の位置（右の欄） */
.posbox { display: grid; gap: 6px; border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 10px; }
.posbox .btns { margin: 0; }
.posbox .sub { margin: 0; }

/* ───────── 売れ方（置き方ごとの差・入れ替えの前後・商品ごとの比較） ───────── */
.factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px 24px; align-items: start; }
.factor h3, .swcard h3 { font-size: 0.95rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.factor table, .swcard table { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.list td small { display: block; color: var(--sub); font-size: 0.74rem; }
.fbar { width: 34%; min-width: 90px; }
.fbar i { display: block; height: 10px; border-radius: 2px; background: var(--accent); min-width: 2px; }
.swcard { margin-bottom: 26px; }
.swcard .summary { margin-bottom: 10px; }
/* 入れ替えの結果: 数字の 4 つの箱は、横いっぱいに 4 つ並べる。説明は節の頭に 1 回だけ */
@media (min-width: 821px) { .swcard .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } details.more > .factors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.swnote { margin: -4px 0 12px; }
.summary b.small { font-size: 1.05rem; }
.summary b small { font-size: 0.8rem; font-weight: 400; color: var(--sub); }
.ipics { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ipic figcaption { display: grid; gap: 2px; margin-bottom: 6px; font-weight: 700; }
.ipic figcaption span { font-weight: 400; font-size: 0.84rem; color: var(--sub); }
.ipic .sheet svg { max-height: 46vh; }

/* 編集画面の、売れ行きの予想 */
.factor td, .factor th { white-space: nowrap; }
.pe-fc { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; padding: 7px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); font-size: 0.86rem; }
.pe-fc[hidden] { display: none; }
.pe-fc .ttl { font-size: 0.78rem; letter-spacing: 0.04em; color: var(--sub); }
.pe-fc label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--sub); margin: 0; }
.pe-fc select { height: 26px; min-height: 0; padding: 0 22px 0 8px; font-size: 0.84rem; font-weight: 700; width: auto; }
.pe-fc .big b { font-family: var(--mono); font-size: 1.12rem; }
.pe-fc .sub { margin: 0; font-size: 0.78rem; }
.pe-fc .delta.up b, .whatif b.up { color: #1f7a48; }
.pe-fc .delta.down b, .whatif b.down { color: var(--bad); }
.fcitem { margin: 12px 0; padding: 10px 12px; background: var(--sunken); border-radius: var(--r); }
.fcitem h4 { font-size: 0.78rem; color: var(--sub); letter-spacing: 0.04em; margin-bottom: 4px; }
.fcnum b { font-family: var(--mono); font-size: 1.3rem; }
.whatif { margin: 8px 0 4px; display: grid; gap: 2px; }
.whatif li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; padding: 3px 0; border-top: 1px solid var(--rule); }
.whatif b { font-family: var(--mono); }
.ilist td, .ilist th, .swcard td, .swcard th { white-space: nowrap; }
.ilist .fbar { width: 22%; }

/* ───────── 相談役（たなべ君）: 右下のつまみと窓 ───────── */
.tn { position: fixed; right: 0; bottom: 0; z-index: 60; font-size: 0.9rem; }
.tn-face { width: 40px; height: 40px; flex: none; }
.tn-face.think, .tn-face.work { animation: tn-bob 0.9s ease-in-out infinite; }
@keyframes tn-bob { 50% { transform: translateY(-3px) rotate(-3deg); } }
/* つまみは、顔だけの丸いボタン。名前は、初めてのとき・マウスを乗せたときだけ左へ伸びる（画面の右端で切れない） */
.tn-tab { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: flex; align-items: center; max-width: calc(100vw - 32px); padding: 6px; background: #1d2a44; color: #fff; border: 0; border-radius: 30px; box-shadow: 0 6px 20px #0003; cursor: pointer; font-weight: 700; }
.tn-tab span { max-width: 0; overflow: hidden; transition: max-width 0.2s, margin 0.2s; }
.tn-tab.new span, .tn-tab:hover span, .tn-tab:focus-visible span { max-width: 12em; margin: 0 10px 0 8px; }
.tn-tab[hidden], .tn-win[hidden], .tn-toast[hidden], .tn-status[hidden] { display: none; }
.tn-tab span { white-space: nowrap; font-size: 0.86rem; }
.tn-toast { position: fixed; right: 64px; bottom: 16px; max-width: min(380px, calc(100vw - 90px)); display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px 14px 2px 14px; box-shadow: 0 10px 30px #0003; animation: rise 0.25s both; }
.tn-toast p { margin: 0 0 6px; line-height: 1.6; }
.tn-win { position: fixed; right: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 18px 50px #0004; overflow: hidden; }
.tn-win header { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; background: #1d2a44; color: #fff; }
.tn-win header div { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.tn-win header small { font-size: 0.72rem; opacity: 0.75; word-break: auto-phrase; }
.tn-win header button { background: #ffffff1a; color: #fff; border: 0; border-radius: 6px; padding: 5px 9px; font-size: 0.76rem; font-weight: 700; cursor: pointer; }
.tn-win header button:hover { background: #ffffff33; }
.tn-log { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; background: var(--sunken); }
.tn-msg { display: flex; }
.tn-msg.u { justify-content: flex-end; }
.tn-body { max-width: 92%; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--rule); line-height: 1.65; overflow-wrap: anywhere; }
.tn-msg.u .tn-body { background: #1d2a44; color: #fff; border-color: #1d2a44; }
.tn-msg.err .tn-body { border-color: var(--bad); }
.tn-body > :first-child { margin-top: 0; }
.tn-body p, .tn-body ul, .tn-body ol { margin: 6px 0 0; }
.tn-body ul, .tn-body ol { padding-left: 1.3em; list-style: revert; }
.tn-body h4 { margin: 10px 0 0; font-size: 0.92rem; }
.tn-body code { font-family: var(--mono); font-size: 0.88em; background: var(--sunken); padding: 0 4px; border-radius: 3px; }
.tn-body .btn { margin: 8px 6px 0 0; }
.tn-table { overflow-x: auto; margin-top: 8px; }
.tn-table table { border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.tn-table th, .tn-table td { border: 1px solid var(--rule); padding: 3px 8px; white-space: nowrap; text-align: left; }
.tn-table th { background: var(--sunken); }
.tn-status { margin: 0; padding: 6px 14px; font-size: 0.8rem; color: var(--sub); background: var(--sunken); border-top: 1px solid var(--rule); }
.tn-status::after { content: "…"; animation: tn-dots 1.2s steps(4) infinite; display: inline-block; overflow: hidden; vertical-align: bottom; width: 0; }
@keyframes tn-dots { to { width: 1.2em; } }
.tn-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.tn-chips button { background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 11px; font-size: 0.78rem; cursor: pointer; color: var(--ink-2); }
.tn-chips button:hover { border-color: #1d2a44; color: var(--ink); }
.tn-win form { display: flex; gap: 8px; padding: 10px 12px 12px; align-items: flex-end; }
.tn-win textarea { flex: 1; resize: none; min-height: 0; font-size: 0.9rem; line-height: 1.5; padding: 8px 10px; }
@media print { .tn { display: none; } }
.tn-win.big { width: min(860px, calc(100vw - 32px)); height: calc(100vh - 32px); }
.tn-win.big .tn-body { max-width: 96%; }
.tn-win.big .tn-table table { font-size: 0.86rem; }

/* 並べる手順（売場でスマホを見ながら、または印刷して） */
.wk-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); font-size: 1.05rem; }
.wk-bar progress { flex: 1; min-width: 60px; height: 10px; accent-color: #1f7a4d; }
.wk-map { margin-bottom: 18px; }
.wk-opt { margin: -6px 0 12px; }
.wk-map summary { cursor: pointer; padding: 6px 0; color: var(--sub); }
.wk-map .sheet svg { max-height: 60vh; }
.wk-bay { margin-bottom: 28px; }
.wk-bay > h2 { font-size: 1.35rem; padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 12px; }
.wk-row { margin-bottom: 18px; }
.wk-row > h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: .95rem; font-weight: 400; margin-bottom: 8px; }
.wk-row > h3 b { font-size: 1.2rem; }
.wk-strip { position: relative; height: 40px; margin-bottom: 8px; background: var(--sunken); border: 1px solid var(--rule); border-bottom: 3px solid #97a0b3; }
/* 段の帯の箱は 1 色（色の違いに意味は無いので、分けない） */
.wk-strip i { background: #e3b75e; position: absolute; top: 3px; bottom: 0; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .9rem; color: #15181c; border: 1px solid #0006; box-sizing: border-box; overflow: hidden; }
@media screen { .wk-strip i.done { background: #d5d8dc !important; color: #6a7079; } }
.wk-kind { padding: 1px 8px; border: 1px solid var(--ink-2); border-radius: 4px; font-size: .8rem; }
.wk-items { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.wk-items li + li { border-top: 1px solid var(--rule-2); }
.wk-items label { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; }
.wk-items input { flex: none; width: 28px; height: 28px; accent-color: #1f7a4d; }
.wk-n { flex: none; min-width: 34px; height: 34px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; }
.wk-n.pop { border-radius: 6px; background: #b3321f; }
.wk-pic { flex: none; width: 52px; height: 52px; object-fit: contain; background: #fff; border: 1px solid var(--rule); }
.wk-main { flex: 1; min-width: 0; font-size: 1.05rem; line-height: 1.45; }
.wk-main > b { font-size: 1.15rem; }
.wk-main small { display: block; color: var(--sub); font-size: .82rem; }
.wk-main small.wk-extra { color: var(--ink); font-weight: 700; }
@media screen { body:not(.wk-showmm) .wk-mm { display: none; } }
.wk-main > span { display: block; word-break: auto-phrase; text-wrap: pretty; }
.wk-q { flex: none; display: grid; justify-items: center; line-height: 1.15; }
.wk-q b { font-size: 1.7rem; }
.wk-q small { font-size: .72rem; color: var(--sub); }
.wk-q em { font-style: normal; font-size: .78rem; color: var(--sub); }
.wk-items li:has(input:checked) { background: var(--sunken); }
.wk-items li:has(input:checked) .wk-main, .wk-items li:has(input:checked) .wk-q { opacity: .45; }
.wk-items li:has(input:checked) .wk-n { background: #1f7a4d; }
@media (max-width: 820px) { .wk-items label { gap: 10px; padding: 12px 10px; } .wk-pic { width: 44px; height: 44px; } }
@media print {
  .wk-map summary { display: none; }
  .wk-bay { break-before: page; margin: 0; }
  .wk-bay > h2 { font-size: 16pt; }
  .wk-row { break-inside: avoid; margin-bottom: 5mm; }
  .wk-strip { height: 9mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .wk-items { border: 0; border-radius: 0; }
  .wk-items li { break-inside: avoid; border-top: 1px solid #999 !important; background: none !important; }
  .wk-items label { padding: 2.2mm 0; gap: 3mm; }
  .wk-items input { appearance: none; -webkit-appearance: none; width: 5mm; height: 5mm; border: 1.5px solid #000; border-radius: 0; }
  .wk-items li .wk-main, .wk-items li .wk-q { opacity: 1 !important; }
  .wk-n, .wk-n.pop { background: none !important; color: #000; border: 1.5px solid #000; min-width: 7mm; height: 7mm; }
  .wk-main { font-size: 11pt; } .wk-main > b { font-size: 12pt; } .wk-main small { font-size: 8.5pt; color: #000; }
  .wk-q b { font-size: 15pt; } .wk-pic { width: 11mm; height: 11mm; }
}

/* ───────── 一覧を軽くする: 列を絞る・条件をしまう・操作をしまう ───────── */
table.cols:not(.all) .x { display: none; }
.colsbtn { margin-left: auto; }
.colsbtn[aria-pressed="true"] { background: #15181c0d; }
.tbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.filters .deep { flex-basis: 100%; margin: 0; }
.filters .deep > summary { display: inline-flex; align-items: center; gap: 5px; font-size: 0.84rem; font-weight: 400; color: var(--accent-ink); list-style: none; padding: 2px 4px; }
.filters .deep > summary::-webkit-details-marker { display: none; }
.filters .deep > summary::before { content: "▸"; font-size: 0.7rem; }
.filters .deep[open] > summary::before { content: "▾"; }
.filters .deep > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.dropdown { position: relative; margin: 0; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { background: #15181c0d; }
.dropdown .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 1px; }
.dropdown .menu a, .dropdown .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: var(--r); background: none; color: var(--ink); font: inherit; font-size: 0.9rem; font-weight: 700; text-align: left; cursor: pointer; white-space: nowrap; }
.dropdown .menu a:hover, .dropdown .menu button:hover { background: var(--hover); text-decoration: none; }
.dropdown .menu .ic { width: 16px; height: 16px; color: var(--sub); }
.dropdown .menu form { display: contents; }
.dropdown .menu .ng { color: var(--bad); }
.dropdown .menu hr { border: 0; border-top: 1px solid var(--rule-2); margin: 4px 0; }
.empty.first { padding: 56px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.empty h2 { font-size: 1.2rem; }
.empty p { max-width: 46em; }
.bar.center { justify-content: center; }
.planlist td.r small { display: inline; }
@media (max-width: 820px) {
  .head .acts { position: relative; }
  .head .acts .dropdown { order: 2; position: static; }
  .dropdown .menu { right: auto; left: 0; max-width: calc(100vw - 28px); }
  .list.cols td, .list.cols th { white-space: nowrap; }
  .tn-tab { right: 10px; bottom: 78px; }
  .tn-tab.new span, .tn-tab:hover span, .tn-tab:focus-visible span { max-width: 0; margin: 0; }
  .colsbtn { margin-left: 0; }
  .list .name { min-width: 9.5em; }
  /* やることの棚割の表は、スマホでは 1 本ずつの札にする */
  .planlist thead { display: none; }
  .planlist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule-2); }
  .planlist td { border: 0; padding: 0; }
  .planlist td:nth-child(1) { grid-column: 1 / -1; }
  .planlist td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .planlist td:nth-child(4) { grid-column: 1 / -1; }
  .planlist td:nth-child(4):empty { display: none; }
}

/* ───────── 棚割の編集: 言葉と並びを軽くする ───────── */
.tlabel { font-size: 0.76rem; font-weight: 700; color: var(--sub); margin: 0 2px 0 4px; }
.ptabs { overflow: visible; flex-wrap: wrap; }
.tabmore { align-self: center; }
.tabmore > summary { display: inline-flex; align-items: center; gap: 5px; position: relative; padding: 9px 14px 11px; color: var(--sub); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.tabmore > summary:hover { color: var(--ink); }
.tabmore > summary.on { color: var(--ink); }
.tabmore > summary.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tabmore > summary .ic { width: 14px; height: 14px; }
.tabmore .menu { right: auto; left: 0; top: 100%; }
.pe-fc { align-items: center; }
.pe-fc .fcmore { margin-left: auto; color: var(--accent-ink); font-size: 0.82rem; text-decoration: underline; text-underline-offset: 3px; }
.pe-fc .fcdetail { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding-top: 7px; margin-top: 3px; border-top: 1px solid var(--rule-2); font-size: 0.8rem; color: var(--sub); }
.pe-fc .fcdetail b { font-family: var(--mono); color: var(--ink); }
.how3 { display: grid; gap: 8px; counter-reset: h; }
.how3 li { counter-increment: h; display: grid; grid-template-columns: 24px 1fr; gap: 0 9px; font-size: 0.86rem; color: var(--ink-2); line-height: 1.5; }
.how3 li::before { content: counter(h); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: 0.74rem; font-weight: 600; margin-top: 1px; }
.how3 b { display: block; color: var(--ink); }
.pe-side details.more { margin: 0; display: grid; gap: 9px; }
.pe-side details.more[open] > summary { margin-bottom: 8px; }
.pe-side details.more > * + * { margin-top: 8px; }
.fcitem h4 + .whatif { margin-top: 2px; }
.fcitem .fcnum + h4, .fcitem .sub + h4 { margin-top: 8px; }
.fcitem { margin: 0; }
/* たなべ君: 頼めることの例、初めてのときのつまみ、編集画面では左下（右の欄に重ならない） */
.tn-ex { display: grid; gap: 6px; margin: 8px 0; }
.tn-ex button { display: grid; gap: 1px; text-align: left; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--sunken); font: inherit; cursor: pointer; color: var(--ink); }
.tn-ex button:hover { border-color: #1d2a44; background: var(--surface); }
.tn-ex button span { font-size: 0.8rem; color: var(--sub); }
@media (min-width: 821px) {
  body.ws-page .tn-tab { right: auto; left: 7px; bottom: 62px; padding: 4px; border-radius: 26px; }
  body.ws-page .tn-tab span { display: none; }
  body.ws-page .tn-tab .tn-face { width: 40px; height: 40px; }
  body.ws-page .tn-win { right: auto; left: 72px; bottom: 12px; width: min(326px, calc(100vw - 90px)); height: min(600px, calc(100vh - 130px)); }
  body.ws-page .tn-win.big { width: min(860px, calc(100vw - 390px)); height: calc(100vh - 24px); }
  body.ws-page .tn-toast { right: auto; left: 72px; bottom: 12px; border-radius: 14px 14px 14px 2px; }
}
body.ws-page .tn-win:not(.big) header button[data-tn="reset"] { display: none; }

/* ───────── 先に結論を文で言う（売れ行き・売れる置き方） ───────── */
.says { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 24px; display: grid; gap: 12px; }
.says h2 { font-size: 1rem; letter-spacing: 0.04em; }
.says-lead { font-size: 1rem; }
.says ul, .says ol { display: grid; gap: 0; counter-reset: s; }
.says li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--rule-2); }
.says li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: 0.86rem; font-weight: 600; }
.says li p { font-size: 1.02rem; line-height: 1.55; }
.says li p small { display: block; color: var(--sub); font-size: 0.84rem; }
.says.big li p { font-size: 1.14rem; }
.says .bar { margin-top: 2px; }
b.up { color: var(--ok); }
.filters.slim { background: none; border: 0; box-shadow: none; padding: 0; }
.tabs.pills { border: 0; margin: 0; gap: 4px; }
.tabs.pills a { padding: 6px 13px; border: 1px solid var(--rule); border-radius: 99px; background: var(--surface); font-size: 0.84rem; }
.tabs.pills a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs.pills a.on::after { display: none; }
.swsay { font-size: 1rem; margin-bottom: 4px; }
.swcard { margin-bottom: 14px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.swcard details.more .summary { margin-top: 8px; }
details.more.block > .factors { margin-top: 12px; }
details.more.block > .summary { margin-top: 18px; }
.list td small.inline { display: inline; margin-left: 6px; }
@media (max-width: 820px) {
  .says { padding: 16px; }
  .says.big li p { font-size: 1.04rem; }
}

/* ───────── 店舗・営業の画面と、取り込みの画面の手直し ───────── */
.main > .ptabs { margin-bottom: 16px; }
.lead.big { font-size: 1.12rem; color: var(--ink); margin: -6px 0 20px; max-width: none; }
.lead.big b { font-family: var(--mono); font-size: 1.3rem; }
.lead.big span { display: block; font-size: 0.86rem; color: var(--sub); }
.tbar .sub { margin: 0; flex: 1; }
.tbar .colsbtn { margin-left: auto; }
.hero .now { display: grid; gap: 8px; align-content: start; }
.hero .now h2 { font-size: 0.78rem; color: var(--sub); letter-spacing: 0.04em; }
.hero .now ul { display: grid; gap: 5px; }
.hero .now li { display: flex; gap: 8px; align-items: baseline; font-size: 0.95rem; }
.hero .now li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transform: translateY(-1px); }
.hero .now li.bad::before { background: var(--bad); }
.hero .now li.ok::before { background: var(--ok); }
.hero .now li a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.bulk .range { margin-left: auto; }
.vbody { padding: 16px 18px; display: grid; gap: 10px; }
.vbody .radios span { height: 40px; padding: 0 18px; font-size: 0.92rem; }
.vmore > .grid { margin-top: 8px; }
.sizebox { margin: 14px 0 0; }
.sizebox > .grid { margin-top: 8px; }
.samplefile { display: flex; align-items: center; gap: 14px; grid-template-columns: none; margin-bottom: 14px; }
.samplefile > div { flex: 1; min-width: 0; }
details.rules > summary + * { margin-top: 10px; }
.setlist.rows li { display: flex; align-items: center; gap: 14px; padding: 13px 16px; }
.setlist.rows li > span:nth-child(2) { flex: 1; min-width: 0; display: grid; line-height: 1.45; }
.set-acts { display: flex; gap: 6px; flex: none; }
.vcards details.more, .block > details.more { margin-top: 10px; }
@media (max-width: 820px) {
  .setlist.rows li { flex-wrap: wrap; }
  .set-acts { width: 100%; padding-left: 50px; }
  .samplefile { flex-wrap: wrap; }
  .bulk .range { margin-left: 0; }
  .bulk { position: static; }
}
.linklist { display: grid; gap: 2px; }
.linklist a { display: flex; align-items: center; gap: 8px; padding: 7px 4px; }
.vbody details.more { margin: 0; }
@media (max-width: 820px) {
  .list.fieldform tr.wide td.ctl { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .list.fieldform tr.wide td.name, .list.fieldform tr.wide td.meta { grid-column: 1 / -1; }
  body:has(.bar.sticky) .tn-tab { bottom: 156px; }
}
.formmore { margin: 14px 0 0; }
.formmore > .grid { margin-top: 8px; }

/* ───────── 2 回り目の手直し ───────── */
/* たなべ君の窓を開いているあいだは、本文を左へ寄せて、窓の下に隠れないようにする（編集画面は左下に出るので別） */
@media (min-width: 1180px) {
  body.tn-docked:not(.ws-page) .main { padding-right: 488px; }
}
.tn-win { z-index: 40; }
/* 表のすぐ下の注は、少し離す */
.tablewrap + .sub, .tablewrap + p.count { margin-top: 10px; }
/* 知らせの画面（見つからない・権限がない）は、左に寄せて置く */
.empty.left { justify-items: start; text-align: left; padding: 32px 0; }
@media (max-width: 820px) {
  /* 表は、1 文字ずつ折れるより、横に送って読む */
  .tablewrap .list td, .tablewrap .list th { white-space: nowrap; }
  .tablewrap .list td.memo { white-space: normal; min-width: 16em; }
  /* ログイン: 上の飾りを低くして、欄を上に */
  .gate { align-content: start; grid-template-rows: auto 1fr; }
  .gate-art { padding: 22px 24px 20px; }
  .gate-form { place-items: start center; padding: 28px 24px 40px; }
}
/* 棚割の編集は、スマホでは見るだけ（引っぱって並べる操作は、狭い画面では崩れるので出さない） */
.pe-narrow { display: none; }
@media (max-width: 820px) {
  .pe-narrow { display: flex; margin: 10px 12px 0; }
  .wsbar .statebox, .wsbar [data-act="save"], .wsbar .state, .pe-pal, .pe-side, .pe-hold, .pe-main > .pe-tools:not(.tools3d) > :not(.pe-mode) { display: none !important; }
  .wsbar .wstitle { pointer-events: none; border-color: transparent; background: none; box-shadow: none; padding-left: 0; }
  .pe-canvas > * { pointer-events: none; }
}
[data-result] .sub + p { margin-top: 12px; }

/* ───────── 入れ替えの案内・提案書（紙に刷る 1 枚。画面でも、そのまま読める） ───────── */
.nextline { display: flex; align-items: center; gap: 6px; margin: -8px 0 16px; }
.nextline .ic { width: 15px; height: 15px; flex: none; }
.paper { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px 32px; color: #15181c; display: grid; gap: 16px; }
.paper + .paper { margin-top: 20px; }
.pp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 12px; border-bottom: 2px solid #15181c; }
.pp-head h2 { font-size: 1.5rem; line-height: 1.35; }
.pp-head.small h2 { font-size: 1.15rem; }
.pp-head p { color: var(--ink-2); font-size: 0.9rem; }
.pp-kind { font-weight: 700; letter-spacing: 0.08em; color: #15181c !important; }
.pp-meta { display: grid; justify-items: end; gap: 1px; text-align: right; white-space: nowrap; }
.pp-meta b { font-size: 1rem; color: #15181c; }
.pp-fill { font-size: 0.92rem; color: var(--ink-2); letter-spacing: 0.02em; display: flex; flex-wrap: wrap; gap: 6px 18px; }
/* 記入欄は、項目の途中で折らない（狭い画面では 1 項目ずつ次の行へ） */
.pp-fill > span { white-space: nowrap; }
.pp-sum { font-size: 1.1rem; }
.pp-sum b { font-family: var(--mono); font-size: 1.4rem; }
.pp-sum small { display: block; font-size: 0.84rem; color: var(--sub); }
.pp-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pp-figs figure { margin: 0; min-width: 0; }
.pp-figs figcaption { font-weight: 700; margin-bottom: 6px; }
.pp-fig { border: 1px solid var(--rule); border-radius: var(--r); padding: 8px; background: #fbfaf6; }
.pp-fig svg { display: block; width: 100%; height: auto; max-height: 62vh; }
.pp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.82rem; color: var(--ink-2); }
.pp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pp-legend i { width: 16px; height: 12px; border: 2.5px solid; border-radius: 3px; }
.pp-sec { display: grid; gap: 8px; }
.pp-sec h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 1.12rem; }
.pp-sec h3 i { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 6px; color: #fff; font-style: normal; font-family: var(--mono); font-size: 0.92rem; }
.pp-sec h3 i:empty { min-width: 12px; width: 12px; height: 20px; border-radius: 3px; }
.pp-sec h3 small { font-size: 0.84rem; font-weight: 400; color: var(--sub); }
.pp-steps, .pp-pops { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r); }
.pp-steps li + li, .pp-pops li + li { border-top: 1px solid var(--rule-2); }
.pp-steps li, .pp-pops li { break-inside: avoid; }
.pp-steps label, .pp-pops label { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; cursor: pointer; }
.pp-steps input, .pp-pops input { flex: none; width: 22px; height: 22px; margin: 3px 0 0; accent-color: #1f7a4d; }
.pp-n { flex: none; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 5px; border-radius: 7px; color: #fff; font-family: var(--mono); font-weight: 700; }
.pp-main { display: grid; gap: 1px; min-width: 0; line-height: 1.5; }
.pp-main > b { font-size: 1.02rem; }
.pp-main > span { font-size: 0.94rem; }
.pp-main em { font-style: normal; font-weight: 700; color: #3f66a8; font-size: 0.9rem; margin: 0; }
.pp-main small { font-size: 0.78rem; color: var(--sub); }
.pp-note { font-size: 0.88rem; color: var(--ink-2); }
.pp-end { font-size: 0.9rem; color: var(--ink-2); padding-top: 10px; border-top: 1px solid var(--rule); }
.pp-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
.pp-side { display: grid; gap: 16px; }
.pp-fc { border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 6px; background: #fbfaf6; }
.pp-fc-l { font-weight: 700; font-size: 0.9rem; }
.pp-fc-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 0.95rem; }
.pp-fc-n b { font-family: var(--mono); font-size: 1.45rem; }
.pp-fc-n .ic { width: 16px; height: 16px; align-self: center; color: var(--sub); }
.pp-fc-n em { font-style: normal; font-family: var(--mono); font-weight: 700; font-size: 1.1rem; }
.pp-fc-n em.up { color: var(--ok); }
.pp-fc-n em.down { color: var(--bad); }
.pp-fc-s { font-size: 0.8rem; color: var(--sub); line-height: 1.6; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pp-table th { text-align: left; font-size: 0.76rem; color: var(--sub); border-bottom: 1.5px solid #15181c; padding: 5px 8px; white-space: nowrap; }
.pp-table td { border-bottom: 1px solid var(--rule); padding: 6px 8px; vertical-align: middle; }
.pp-table tr { break-inside: avoid; }
.pp-table .r { text-align: right; font-family: var(--mono); }
.pp-why { width: 34%; }
.pp-why input { width: 100%; height: 34px; font-size: 0.9rem; }
@media screen and (max-width: 820px) {
  .paper { padding: 16px 14px; }
  .pp-head { flex-direction: column; align-items: flex-start; }
  .pp-meta { justify-items: start; text-align: left; }
  .pp-cols { grid-template-columns: minmax(0, 1fr); }
  .pp-figs { grid-template-columns: minmax(0, 1fr); }
  .pp-next .pp-sec { overflow-x: auto; }
  .pp-table td, .pp-table th { white-space: nowrap; }
  .pp-why input { min-width: 15em; }
}
@media print {
  /* 紙では、字を少し大きく（店の人が売場で読む）。刷るときの幅で、スマホ向けの並びにならないようにする */
  html:has(.paper) { font-size: 12px; }
  .paper { display: block; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .paper > * + * { margin-top: 4mm; }
  .paper + .paper { margin-top: 0; break-before: page; }
  .pp-head { flex-direction: row; align-items: flex-end; }
  .pp-meta { justify-items: end; text-align: right; }
  .pp-sec { display: block; }
  .pp-sec > * + * { margin-top: 2mm; }
  .pp-sec h3 { break-after: avoid; }
  .pp-figs { grid-template-columns: 1fr 1fr; break-inside: avoid; }
  .pp-fig { border: 0; padding: 0; background: none; }
  .pp-fig svg { max-height: 92mm; }
  .paper.landscape .pp-fig svg { max-height: 125mm; }
  .pp-cols { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
  .pp-steps label, .pp-pops label { padding: 2mm 2.5mm; }
  .pp-table { min-width: 0; }
  .pp-next { overflow: visible; }
  .pp-why input { border: 0; padding: 0; height: 1.7em; min-height: 0; background: none; box-shadow: none; }
  .pp-table td { padding: 1.6mm 2mm; }
  .pp-end { padding-top: 2mm; }
  .pp-why input::placeholder { color: transparent; }
  .pp-legend i, .pp-n, .pp-sec h3 i, .pp-fig svg, .pp-fc { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* 初めての人に言う、次の一歩（1 行） */
.nextstep { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; padding: 10px 14px; background: var(--accent-soft); border: 1px solid var(--rule); border-radius: var(--r-lg); color: var(--ink); }
.nextstep > .ic { width: 16px; height: 16px; flex: none; color: var(--accent-ink); }
.nextstep > span { flex: 1; min-width: 12em; }
.wsbar .state a.next { font-weight: 700; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
@media print { .nextstep { display: none; } }
.pe-mode .narrow { display: none; }
@media (max-width: 820px) { .pe-mode .wide { display: none; } .pe-mode .narrow { display: inline; } }

/* 棚割の編集: 保存できなかったときの帯（編集中の中身は残っている、と、次に押す所を言う） */
.pe-trouble { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 10px 12px 0; padding: 10px 14px; background: #fdecea; border: 1px solid #f0b8b0; border-radius: 10px; color: var(--ink); font-size: 0.9rem; line-height: 1.6; }
.pe-trouble b { color: var(--bad); }
.pe-trouble span { flex: 1 1 420px; }
.pe-trouble a { font-weight: 700; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
/* 図の上の小さな操作（見方・POP・拡大）は、図に重ねない。台が 2 つ以上あると、右の台の見出し（押して台を選ぶ所）に重なって押せなかった */
@media (min-width: 821px) { .canvas-ctl { position: static; align-self: flex-end; margin: 0 0 8px; box-shadow: none; } }
/* スマホの欠品・品薄と POP の確認: 状態・店・商品（POP）の 3 つが、横に送らなくても見えるように、名前は折り返す */
@media (max-width: 820px) {
  .list.cols.wrapnames:not(.all) td.name { white-space: normal; min-width: 6.5em; }
  .list.cols.wrapnames:not(.all) td, .list.cols.wrapnames:not(.all) th { padding-left: 10px; padding-right: 6px; }
}
.list td.name.chain { font-weight: inherit; }
@media (max-width: 820px) { .list.cols.wrapnames:not(.all) td.name.chain { min-width: 5.5em; } }
/* 保存のあとの「次の一歩」が、途中で切れないように（幅に余裕のある画面だけ） */
@media (min-width: 1280px) { .wsbar .state { max-width: 400px; } }
/* 編集画面の知らせ（置けなかった理由など）。保存の失敗（赤）より弱い色 */
.pe-trouble.pe-notice { background: #fff6e0; border-color: #ecd193; margin: 0 0 8px; }
.pe-trouble.pe-notice b { color: #8a5a00; }
.pe-trouble.pe-notice .btn { flex: none; }
.pe-trouble.pe-notice span { flex: 1 1 300px; }

/* ───────── たなべ君の窓: 幅 1180 未満では、下から出る引き出し ─────────
   右下に浮かべると、開いたままのときに、その下のボタンや欄が押せなくなる。
   引き出しにして、開いているあいだは本文の下に同じ高さの余白を足す（どの物も、送れば引き出しの上に出てくる）。 */
@media (max-width: 1179.98px) {
  body { --tn-h: min(46dvh, 420px); --tn-left: 236px; --tn-bottom: 0px; }
  body.ws-page { --tn-left: 62px; }
  body.tn-big { --tn-h: min(72dvh, calc(100dvh - 160px)); }
  .tn-win, .tn-win.big, body.ws-page .tn-win, body.ws-page .tn-win.big { left: var(--tn-left); right: 0; bottom: var(--tn-bottom); width: auto; height: var(--tn-h); border-radius: 14px 14px 0 0; border-width: 1px 0 0 1px; box-shadow: 0 -8px 30px #0002; }
  .tn-win .tn-body, .tn-win.big .tn-body { max-width: min(92%, 46em); }
  body.tn-open .main { padding-bottom: calc(var(--tn-h) + 40px); }
  body.tn-open.ws-page .main { height: calc(100vh - var(--tn-h)); padding-bottom: 0; }
  body.tn-open .bar.sticky { bottom: var(--tn-h); margin-bottom: 0; }
}
@media (max-width: 820px) {
  body, body.ws-page { --tn-h: min(44dvh, 380px); --tn-left: 0px; --tn-bottom: calc(58px + env(safe-area-inset-bottom)); }
  body.tn-big { --tn-h: min(66dvh, calc(100dvh - 190px)); }
  .tn-win, .tn-win.big, body.ws-page .tn-win, body.ws-page .tn-win.big { border-left-width: 0; }
  body.tn-open .main, body.tn-open.ws-page .main { height: auto; padding-bottom: calc(var(--tn-h) + var(--tn-bottom) + 40px); }
  body.tn-open .bar.sticky { bottom: calc(var(--tn-h) + var(--tn-bottom)); }
}
/* 編集画面: 幅 1000〜1179 は 3 列のまま、列を細くする（右の欄を下に落とすと、図が低くなりすぎて並べられない） */
@media (min-width: 1000px) and (max-width: 1179.98px) {
  .ws .pe { grid-template-columns: 220px minmax(0, 1fr) 264px; }
  .ws .pe-side { grid-column: auto; max-height: none; }
  body.ws-page { --tn-h: min(38dvh, 320px); }
  /* 窓を開いているあいだは、画面全体を送る形にする（図を低くしない。窓の上に送って使う） */
  body.tn-open.ws-page .main { height: auto; min-height: 100vh; overflow: visible; padding-bottom: calc(var(--tn-h) + 40px); }
  body.tn-open.ws-page .pe-canvas, body.tn-open.ws-page .stage3d { height: 58vh; flex: none; }
  body.tn-open.ws-page .pe-pal, body.tn-open.ws-page .pe-side { max-height: calc(58vh + 170px); }
}
/* 幅 821〜999 は、画面全体を送る形にする（図の高さを決めて、右の欄は下） */
@media (min-width: 821px) and (max-width: 999.98px) {
  body.ws-page .main, body.tn-open.ws-page .main { height: auto; min-height: 100vh; overflow: visible; }
  body.tn-open.ws-page .main { padding-bottom: calc(var(--tn-h) + 40px); }
  .ws .pe-canvas, .ws .stage3d { height: 62vh; flex: none; }
  .ws .pe-pal { max-height: calc(62vh + 160px); }
  .ws .pe-side { max-height: none; }
}
/* 編集画面（広い幅）の窓の置き場は、下の「全画面を見て直す」で決めている（右に開く） */
@media (min-width: 1180px) {
  body.ws-page { --tn-h: min(46vh, 420px); }
}

/* ───────── 提案の記録（提案書の上の欄・提案の一覧） ───────── */
.propform { margin: 0 0 20px; padding: 16px 18px 14px; }
.propform h2 { font-size: 1rem; margin-bottom: 12px; }
.propform h2 small { font-weight: 400; margin-left: 8px; }
.propgrid { display: grid; grid-template-columns: auto minmax(150px, 190px) minmax(240px, 1fr); gap: 12px 18px; align-items: end; }
.propgrid label, .propgrid .field { display: grid; gap: 5px; font-size: 0.8rem; font-weight: 700; color: var(--sub); }
.propgrid label.wide { grid-column: 1 / -1; }
.propgrid input:not([type="radio"]) { width: 100%; }
.propform .bar { margin-top: 14px; }
.propform .bar .ng { margin-left: auto; }
.propline { margin: -4px 0 14px; font-size: 0.92rem; }
.pp-to { font-size: 1.05rem; font-weight: 700; color: #15181c !important; margin-bottom: 8px; }
.proplist td.name small { display: block; }
.proplist td.memo { min-width: 12em; }
@media (max-width: 820px) {
  .propgrid { grid-template-columns: minmax(0, 1fr); }
  .propform { padding: 14px; }
}
@media print { .pp-to { font-size: 12pt; } }
.propform { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); }

/* 取り込みの結果の数字は、スマホでは 2 列（1 列に積むと、画面 1 枚が数字だけになる） */
@media (max-width: 820px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary li { padding: 9px 12px 10px; }
}

.pe-trouble.pe-notice.ok { background: #e9f5ee; border-color: #b9dcc7; }
.pe-trouble.pe-notice.ok b { color: #1f6b43; }

/* キーボードで選んでいる商品（図の中）と、開け閉めする見出しに、カーソルの枠を出す */
.pe-canvas .it:focus { outline: none; }
.pe-canvas .it:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* キーボードで使う人のための近道（Tab を押したときだけ、左上に出る） */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 700; font-size: 0.9rem; }
.skip:focus { left: 8px; }
main:focus { outline: none; }
/* 置き方ごとの数字の表: スマホ幅で横にはみ出さない */
.factors { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.factor { min-width: 0; }
@media (max-width: 820px) { .factor { overflow-x: auto; } .fbar { min-width: 48px; } }
/* 棚割のタブの「ほか」: スマホ幅では、メニューをタブの列の幅いっぱいに出す（右にはみ出して、画面の外で押せなくなるのを防ぐ） */
@media (max-width: 820px) {
  .ptabs { position: relative; }
  .ptabs .tabmore { position: static; }
  .ptabs .tabmore .menu { left: 0; right: 0; top: 100%; min-width: 0; max-width: none; }
}

/* 店舗のページ「この店舗のいま」: 1 行の中の太字で、行が 3 つに割れないようにする */
.hero .now li { display: block; position: relative; padding-left: 15px; }
.hero .now li::before { position: absolute; left: 0; top: 0.62em; transform: none; }
/* つくる画面: 色分けの説明は、図に重ねずに、図の上に置く */
.pe-stagewrap > .legend { position: static; flex: none; max-width: none; margin: 0 0 8px; }
/* この店舗の棚の表: 番号の列を細く */
.empty.left .btn { margin-top: 4px; }

/* 表の右が切れているときの知らせ（app.js が出す） */
.scrollhint { margin: 0 0 6px; }
.scrollhint[hidden] { display: none; }
/* 指で押したあとに、行の色が残らないようにする（マウスのある機械だけ、行に色を付ける） */
@media (hover: none) { .list tbody tr:hover td { background: transparent; } }
/* 見本のデータの知らせ: 文の途中のリンクで、列が割れないようにする */
.foot-note { align-items: flex-start; }
.foot-note > span { flex: 1; min-width: 0; }
.foot-note > svg { flex: none; margin-top: 3px; }
/* 番号の列は、数字の幅だけにする */
.list th.numcol, .list td.numcol { width: 1%; white-space: nowrap; text-align: right; padding-right: 6px; }
.split .list td.numcol:first-child { min-width: 0; }
/* 印刷: 余白は 10 mm（ブラウザの設定で「余白なし」になっていても、紙の端に付かない。入れ替えの案内・提案書は、自分の決まりで上書きする） */
@page { margin: 10mm; }
@media print {
  /* 紙では押せないもの（表の中のボタン・閉じたままの「くわしく」）は出さない */
  .list td .btn, details.more:not([open]), .scrollhint { display: none !important; }
  /* 見出しだけがページの下に残らないようにする */
  h2, h3, .block > h2 { break-after: avoid; }
  .list tr { break-inside: avoid; }
  /* 図の下に見出しだけが残る所は、表ごと次の紙へ */
  .newpage { break-before: page; }
  /* 紙では、行を詰める（1 枚に入る行を増やす） */
  .list td { padding-top: 5px; padding-bottom: 5px; }
}

/* ── おためしが切れて「見るだけ」のあいだ: 押せない物は薄くする（src/views.js の lockWrites が disabled・data-ro を付ける） */
button:disabled { cursor: not-allowed; }
input:disabled:not([type=checkbox]):not([type=radio]), select:disabled, textarea:disabled { background: var(--rule-2); color: var(--sub); cursor: not-allowed; }
input[type=checkbox]:disabled, input[type=radio]:disabled { cursor: not-allowed; opacity: .5; }
.side button:disabled, .menu button:disabled, .link:disabled { opacity: 0.45; }
a[data-ro] { opacity: 0.45; pointer-events: none; cursor: not-allowed; }
body.ro .drop, body.ro label.btn:has(input[type="file"]) { opacity: 0.45; pointer-events: none; }
.flash.robar { align-items: center; flex-wrap: wrap; }
.flash.robar > span { flex: 1 1 280px; }
.flash.robar > .btn { flex: none; }
@media print { .robar { display: none !important; } }

/* ── スマホ幅では、よく使う表（商品・POP・店舗の一覧、訪店記録、欠品・品薄、POP の確認）を、1 件ずつの行の形に並べ直す。
   名前（.name）を上に、状態の札（.tagcell）を右上に、残りは見出しつき（data-l）で下に流す。横に動かさなくても、全部が見える */
@media screen and (max-width: 820px) {
  .list.asrows, .list.asrows tbody { display: block; width: 100%; }
  .list.asrows thead { display: none; }
  .list.asrows tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 12px 14px; border-bottom: 1px solid var(--rule-2); }
  .list.asrows tbody tr:last-child { border-bottom: 0; }
  .list.asrows tbody td { display: block; border: 0 !important; padding: 0 !important; text-align: left; white-space: normal !important; min-width: 0 !important; background: none !important; font-size: 0.84rem; color: var(--ink-2); }
  .list.asrows tbody td.name { order: -3; flex: 1 1 100%; font-size: 1rem; font-weight: 700; color: var(--ink); }
  .list.asrows tbody tr:has(> td.tagcell:not(:empty)) > td.name:not(.sub2) { flex-basis: 58%; }
  .list.asrows tbody td[data-l], .list.asrows tbody td[data-l] b { font-size: 0.84rem !important; }
  .list.asrows tbody td.tagcell { order: -2; margin-left: auto; }
  .list.asrows tbody td.name.sub2 { order: -1; font-size: 0.86rem; font-weight: 400; color: var(--ink-2); }
  .list.asrows tbody td.name.sub2::before { content: none; }
  .list.asrows tbody td.name.sub2 small { display: inline; margin-right: 6px; font-size: inherit; }
  .list.asrows tbody td.wide, .list.asrows tbody td.none, .list.asrows tbody td.act { flex: 1 1 100%; }
  .list.asrows tbody td.act .btn { width: 100%; height: 40px; margin-top: 4px; }
  .list.asrows tbody td[data-l]::before { content: attr(data-l); margin-right: 6px; color: var(--sub); font-family: var(--font); font-size: 0.76rem; font-weight: 400; }
  .list.asrows tbody td:empty, .list.asrows tbody td:has(> .dim:only-child:not(.keep)) { display: none; }
  .list.asrows.cols:not(.all) tbody td.x { display: none; }
}
/* 請求・メールなどの札の形の表も、押したあとに色が残らない */
@media (max-width: 820px) { .list.invs tbody tr:hover td, .list.lates tbody tr:hover td, .list.reqs tbody tr:hover td, .list.mails tbody tr:hover td, .list.notices tbody tr:hover td, .list.logins tbody tr:hover td, .list.operators tbody tr:hover td, .list.ops-list tbody tr:hover td, .list.users tbody tr:hover td, .planlist tbody tr:hover td { background: transparent; } }
.minenote { margin: -4px 0 10px; }
/* 空の画面の大きいボタン: スマホ幅で、文が長くても画面からはみ出さない */
@media (max-width: 820px) { .empty .btn.big { white-space: normal; height: auto; min-height: 48px; padding-top: 10px; padding-bottom: 10px; max-width: 100%; text-align: left; line-height: 1.45; } .empty.left > * { min-width: 0; max-width: 100%; } .empty.left form { max-width: 100%; } }

/* ═════════ 全画面を見て直す（形と動き） ═════════ */
/* ── たなべ君の丸いボタン: どの画面でも、中身に重ならない席を決める。
   パソコン幅: 本文の右に、丸いボタンの幅ぶんの余白をいつも取る（表の右端の数字・行のボタンが下に入らない）。
   スマホ幅: 浮かせるのをやめて、上の帯（会社の印とメニューのあいだ）に入れる。「記録する」の帯・下のメニューと重ならない。 */
.tn-tab.new span { max-width: 0; margin: 0; }
.tn-tab.new:hover span, .tn-tab.new:focus-visible span { max-width: 12em; margin: 0 10px 0 8px; }
.tn-tab.new::after { content: ""; position: absolute; right: 2px; top: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
@media (min-width: 821px) {
  body:not(.ws-page) .main { padding-right: 88px; }
  body:not(.ws-page) .bar.sticky { margin-right: -88px; padding-right: 88px; }
}
@media (max-width: 820px) {
  .tn-tab, body:has(.bar.sticky) .tn-tab { top: 8px; right: 56px; bottom: auto; left: auto; width: 36px; height: 36px; padding: 2px; justify-content: center; z-index: 26; background: var(--side-2); border: 1px solid #ffffff1c; box-shadow: none; }
  .tn-tab .tn-face { width: 28px; height: 28px; }
  .tn-tab span { display: none; }
  .tn-tab.new::after { right: -2px; top: -2px; }
  .mtop details { margin-left: 44px; }
  .mtop .modes a { padding: 5px 9px; }
  .tn-toast { right: 10px; left: 10px; top: 58px; bottom: auto; max-width: none; }
}
@media (max-width: 400px) { .mtop .brand span { display: none; } }
/* 編集画面（広い幅）: 窓は右に開く。左の商品の一覧は隠さない。
   幅 1400 以上は、本文を窓の分だけ縮める（何も隠れない）。1180〜1399 は、右の列（選んだもの）の上に重ねる */
@media (min-width: 1180px) {
  body.ws-page { --tn-h: min(46vh, 420px); }
  body.ws-page .tn-win:not(.big) { left: auto; right: 12px; top: 12px; bottom: 12px; width: 320px; height: auto; }
}
@media (min-width: 1400px) {
  body.ws-page .tn-win:not(.big) { width: 348px; }
  body.tn-docked.ws-page .main { padding-right: 372px; }
}

/* ── スマホ幅の行の形（.asrows）を、ほかの表にも広げる。1 行目は名前（.name）と、その表の主役（.tagcell = 状態の札・数字・入力欄） */
@media screen and (max-width: 820px) {
  body:has(.list.asrows.cols) .colsbtn { display: none; } /* 行の形では、列は増やせない（くわしい列は、パソコン幅か、1 件の画面で見る） */
  .list.asrows tbody td.tagcell.num { font-family: var(--mono); font-weight: 700; color: var(--ink); font-size: 0.95rem !important; white-space: nowrap !important; }
  .list.asrows tbody td.tagcell.num b { font-size: inherit !important; }
  .list.asrows tbody td.numcol { order: -4; flex: none; min-width: 1.6em !important; font-weight: 700; color: var(--sub); }
  .list.asrows tbody tr:has(> td.numcol) > td.name:not(.sub2) { flex: 1 1 0; }
  .list.asrows tbody td.wide2 { flex: 1 1 100%; }
  .list.asrows tbody td.wide2 input, .list.asrows tbody td.wide2 textarea, .list.asrows tbody td.wide2 select { width: 100%; }
  .list.asrows tbody td.mhide { display: none; }
  .tablewrap:has(> .asrows) { overflow-x: visible; }
}
/* 店舗の画面: 棚割を足す欄（見出しつき）、札の「状態を変える」は指で押せる大きさに、残りの商品は「全部見る」の中 */
form.inline.add.titled { display: flex; align-items: flex-end; gap: 10px 12px; padding: 14px 16px; }
form.inline.add.titled h3 { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; font-size: 0.95rem; margin: 0; }
form.inline.add.titled h3 .ic { color: var(--accent); }
.pc-state summary { height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); color: var(--ink-2); cursor: pointer; }
details.restrows { margin-top: 10px; }
@media (max-width: 820px) { form.inline.add.titled > select, form.inline.add.titled > label, form.inline.add.titled > .btn { flex: 1 1 100%; max-width: 100%; min-width: 0; width: 100%; } form.inline.add.titled > .btn { height: 44px; } .pc-state summary { height: 40px; } }

/* POP の確認: 同じ店舗の POP を 1 つにまとめる（tbody.grp が 1 店舗）。ボタンは店舗に 1 つ */
.list td.monly { display: none; }
.list.grouped tbody.grp + tbody.grp tr:first-child td { border-top: 1px solid var(--rule); }
.list.grouped td.grphead, .list.grouped td.act.donly { vertical-align: top; }
@media screen and (max-width: 820px) {
  .list.asrows td.donly { display: none !important; }
  .list.asrows td.monly { display: block; }
  .list.asrows.grouped tbody.grp { border-bottom: 1px solid var(--rule); padding: 6px 0 10px; }
  .list.asrows.grouped tbody.grp:last-child { border-bottom: 0; }
  .list.asrows.grouped tbody.grp tr { border-bottom: 0; padding: 5px 14px; }
  .list.asrows.grouped tbody td.grphead { order: -5; flex: 1 1 100%; font-size: 1rem; font-weight: 700; color: var(--ink); padding-bottom: 2px !important; }
  .list.asrows.grouped tbody td.name:not(.sub2) { font-size: 0.92rem; font-weight: 400; }
}

/* 行の形の部品（スマホ幅）: .pre = 名前の上の小さい 1 行（チェーンなど）、.mnum = 名前の左の番号 */
@media screen and (max-width: 820px) {
  .list.asrows tbody td.pre { order: -5; flex: 1 1 100%; font-size: 0.76rem; color: var(--sub); }
  .list.asrows tbody td.mnum { order: -4; flex: none; min-width: 1.6em !important; font-family: var(--mono); font-weight: 700; color: var(--sub); }
  .list.asrows tbody tr:has(> td.mnum) > td.name:not(.sub2) { flex: 1 1 0; }
  .list.asrows.hist tbody td.name { order: 0; flex: 1 1 58%; }
  .list.asrows.hist tbody td.tagcell { order: 0; }
  .list.asrows.hist tbody td.wide2 { color: var(--ink-2); }
  .list.asrows.trashlist td.wide2 form, .list.asrows.trashlist td.wide2 details { margin-top: 6px; }
  .list.asrows.trashlist td.wide2 .btn { min-height: 40px; }
  /* 提案書の「変える商品と理由」: 1 品ずつの札にして、「理由」の欄を幅いっぱいに出す */
  .pp-next .pp-sec { overflow-x: visible; }
  .pp-table, .pp-table tbody { display: block; width: 100%; }
  .pp-table thead { display: none; }
  .pp-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .pp-table tbody td { display: block; border: 0; padding: 0; white-space: normal; font-size: 0.84rem; text-align: left; }
  .pp-table tbody td:first-child { order: -3; font-family: var(--mono); font-weight: 700; color: var(--sub); }
  .pp-table tbody td.pp-name { order: -2; flex: 1 1 60%; font-size: 1rem; font-weight: 700; }
  .pp-table tbody td[data-l]::before { content: attr(data-l); margin-right: 6px; color: var(--sub); font-family: var(--font); font-size: 0.76rem; font-weight: 400; }
  .pp-table tbody td:first-child::before { content: none; }
  .pp-table tbody td:has(input, textarea) { flex: 1 1 100%; }
  .pp-table tbody td:has(input, textarea)::before { display: block; margin-bottom: 3px; }
  .pp-table tbody td input, .pp-table tbody td textarea { width: 100%; min-height: 42px; }
}
/* 画面の下の案内（文と道が 2 列に割れていた）: スマホ幅では 1 つの文として流す */
@media (max-width: 820px) { .foot-note { display: block; } .foot-note > svg { vertical-align: -3px; margin-right: 4px; } }

/* ── 訪店記録を書く: 在庫は、手を打つ商品が先・残りは「ほかの商品を数える」の中（分類ごと）。行を押しても、ますごとに色が付かない */
.list.fieldform tbody tr:hover td { background: transparent; }
.list.fieldform tr.cat th { text-align: left; padding: 8px 16px; font-size: 0.78rem; color: var(--sub); background: var(--sunken); border-bottom: 1px solid var(--rule-2); }
.vstep > details.vrest { margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--rule-2); }
.vstep > details.vrest[open] { padding-left: 0; padding-right: 0; padding-bottom: 0; }
.vstep > details.vrest[open] > summary { margin-left: 18px; }
.vstep > details.vrest > summary { min-height: 36px; font-weight: 700; }
@media (max-width: 820px) {
  .list.fieldform tr.cat { display: block; padding: 0; }
  .list.fieldform tr.cat th { display: block; padding: 7px 12px; }
  .list.fieldform td.name small { display: block; margin-left: 0; }
  .vstep > details.vrest > summary { min-height: 44px; }
}

/* ── タブ: スマホ幅では 1 段のまま横に送る（2 段に割らない）。右に続きがあるときは、右端を薄くして知らせる（app.js が .more-r を付ける） */
.tabs a.tabrest { display: none; }
.tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
@media (max-width: 820px) {
  .ptabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .ptabs .tabmore { display: none; }
  .tabs a.tabrest { display: block; }
  /* 仕事の順の帯: 折れて線だけ残らないように、2 つずつ並べる */
  .trail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .trail li + li::before { content: none; }
}

/* ── 店舗に入れる: 行のどこを押しても印が付く。スマホ幅は行の形（四角は左に大きく、撤去の日付は折って全部見せる） */
.list.pickrows tbody tr[data-pick] { cursor: pointer; }
.list.pickrows tbody tr[hidden] { display: none !important; }
.list.pickrows tbody tr:has(input[name="store"]:checked) td { background: var(--accent-soft); }
@media screen and (max-width: 820px) {
  .list.asrows.pickrows tbody tr:has(input[name="store"]:checked) { background: var(--accent-soft); }
  .list.asrows.pickrows td.pickcell { align-self: center; min-width: 30px !important; }
  .list.asrows.pickrows td.pickcell input { width: 22px; height: 22px; }
  .filters input[data-rowq] { flex: 1 1 100%; }
}

/* ── 棚の図: スマホ幅では、押すと大きく開く（.figzoom）。並べる手順の「全体の図」は、縦に長い棚でも小さくなりすぎない */
.wk-map .sheet svg { max-height: 120vh; max-width: 680px; margin: 0 auto; }
.figzoom { position: fixed; inset: 0; z-index: 80; background: #fcfdff; overflow: auto; padding: 52px 10px 20px; }
.figzoom > button { position: fixed; top: 8px; right: 10px; z-index: 1; height: 38px; }
.figzoom svg { display: block; width: 240vw; max-width: none; height: auto; max-height: none; }
@media (max-width: 820px) {
  .sheet.zoomable { position: relative; cursor: zoom-in; }
  .sheet.zoomable::after { content: "押すと拡大"; position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 99px; background: #15181cc7; color: #fff; font-size: 0.7rem; pointer-events: none; }
  .wk-map .sheet svg { max-height: 78vh; }
}
@media print { .sheet.zoomable::after { content: none; } .wk-map .sheet svg { max-height: 150mm; } }

/* ── 上の知らせ: 保守の知らせは × で閉じられる。おためし終了の知らせは、スマホ幅では 1 行に縮める */
.flash.sysnote[hidden] { display: none; }
.flash.sysnote > span { flex: 1; min-width: 0; }
.flash.sysnote > .x { flex: none; align-self: flex-start; width: 32px; height: 32px; margin: -5px -8px -5px 0; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; opacity: 0.65; }
.flash.sysnote > .x:hover { opacity: 1; background: #0000000d; }
@media (max-width: 820px) {
  .flash.robar { flex-wrap: nowrap; align-items: center; padding-top: 8px; padding-bottom: 8px; }
  .flash.robar > span { flex: 1 1 auto; }
  .flash.robar .rest { display: none; }
  .flash.sysnote > .x { width: 40px; height: 40px; margin: -9px -10px -9px 0; }
}
/* ── 見るだけの会社（おためし切れ）: つくる画面の、並べ直すための道具も薄くする（並べ替えたあとで「保存できない」と分かる、を無くす）。知らせは重ねない */
body.ro .pe-tools [data-act^="add-"], body.ro .pe-tools [data-act="undo"], body.ro .pe-tools [data-act="redo"], body.ro .pe-tools .tlabel, body.ro .pe-pal li button, body.ro .wsbar .statebox, body.ro .pe-hold, body.ro [data-panel] button, body.ro [data-panel] input, body.ro [data-panel] select { opacity: 0.4; pointer-events: none; }
body.ro .wsbar .wstitle { pointer-events: none; color: var(--sub); }
body.ro .pe-canvas .it, body.ro .pe-canvas .pop, body.ro .pe-canvas .row { cursor: default; }
body.ro .wsflash.pe-narrow { display: none; }
select[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── そのほかの形 ── */
/* 開く・閉じるの印は、色つきの小さい三角（▸ ▾）にそろえる（黒い大きな ▶ をやめる） */
main details:not([class]) > summary, details.wk-map > summary { list-style: none; cursor: pointer; }
main details:not([class]) > summary::-webkit-details-marker, details.wk-map > summary::-webkit-details-marker { display: none; }
main details:not([class]) > summary::before, details.wk-map > summary::before { content: "▸"; display: inline-block; width: 1.1em; font-size: 0.74rem; color: var(--accent-ink); }
main details:not([class])[open] > summary::before, details.wk-map[open] > summary::before { content: "▾"; }
/* 棚割の札の題・商品名が、1 文字だけ次の行に落ちない（言葉の切れ目で折る） */
.pcard h3, .wk-items b, .vcard h3, .list.asrows td.name, .pp-name, .pp-table td { word-break: auto-phrase; text-wrap: pretty; }
.pcard h3 { text-wrap: balance; }
/* これまでの値から選べる欄（チェーンなど）の矢印を、ほかの選ぶ欄と同じ形に */
input[list]::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
input[list] { padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }
[data-2d][hidden] { display: none !important; }

/* ── ログインの画面: 下の道は 1 行に 1 つ、指で押せる高さに（同じ意味の案内は 1 つに） */
.gate-links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.gate-links li { border-bottom: 1px solid var(--rule); }
.gate-links a { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 4px 2px; font-weight: 700; font-size: 0.92rem; }
.gate-links a::after { content: "›"; color: var(--sub); font-weight: 400; }
.login .foot.legal { margin-top: 14px; }
.login .foot.legal a { display: inline-block; padding: 8px 0; }

/* 利用者の一覧（スマホ幅）: 「変える」は右端にそろえる。選ぶ欄には、何の欄かの見出しを付ける（見出しの言葉は thead から） */
@media (max-width: 820px) {
  .list.users td:nth-child(5) { justify-self: end; align-self: center; }
  .list.users td:nth-child(3)[data-l]::before { content: attr(data-l); display: block; margin-bottom: 3px; font-size: 0.76rem; color: var(--sub); }
}
/* 取り込みの下見: 数の箱は 1 段に並べる（2＋1 に折れない） */
ul.summary.imp { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
/* 棚割表の「入っている店舗」: チェーンごとに 1 行。店舗名は途中で折らない */
.chaingroups { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.chaingroups li { display: grid; grid-template-columns: 13em minmax(0, 1fr); gap: 2px 14px; font-size: 0.9rem; }
.chaingroups b small { margin-left: 8px; font-weight: 400; color: var(--sub); font-size: 0.8rem; }
.chaingroups i { font-style: normal; color: var(--sub); }
@media screen and (max-width: 820px) {
  .chaingroups li { grid-template-columns: minmax(0, 1fr); }
  /* 行の形の表: 番号の付いた行は、名前を番号の右に 1 行で。残りの項目は次の行へ（名前が細く縦に折れない） */
  .list.asrows tbody tr:has(> td.mnum) > td.name:not(.sub2), .list.asrows tbody tr:has(> td.numcol) > td.name:not(.sub2) { flex: 1 1 calc(100% - 3.4em); }
  .list.asrows tbody tr:has(> td.mnum):has(> td.tagcell:not(:empty)) > td.name:not(.sub2), .list.asrows tbody tr:has(> td.numcol):has(> td.tagcell:not(:empty)) > td.name:not(.sub2) { flex-basis: 0; min-width: 0 !important; }
}
/* 印刷: 表の商品名は、1〜2 文字だけ次の行に落ちないよう幅を取る（棚割表など） */
@media print { .list td.name { white-space: nowrap !important; } }
/* 商品ごとの比べ: 見出し（大きさ A の店舗 など）は折り返して、表が横にはみ出さない */
.ilist thead th { vertical-align: bottom; }
.ilist thead th.wrap { white-space: normal; min-width: 5em; }
.ilist td.fbar { width: 14%; }

/* ── r5: パソコン幅だけ・スマホ幅だけの物。立体の道具の「表示を変える」 */
.narrowonly { display: none; }
@media (max-width: 820px) { .wideonly { display: none !important; } .narrowonly { display: inline-flex; } span.narrowonly { display: inline; } }
details.t3more { display: contents; }
details.t3more > summary { display: none; }
details.t3more > div { display: contents; }
@media (max-width: 820px) {
  details.t3more { display: block; flex-basis: 100%; }
  details.t3more > summary { display: inline-flex; align-items: center; min-height: 34px; cursor: pointer; color: var(--accent-ink); font-size: 0.9rem; }
  details.t3more[open] > div { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 4px 0 8px; }
  .canvas-ctl .seg.zoom .btn, .pe-tools .seg.zoom .btn { width: 44px; height: 44px; }
}

/* ── r5: 入力の誤り。まちがえた欄の枠を赤くして、すぐ下に一言 */
.edit label.bad input, .edit label.bad select, .edit label.bad textarea, [aria-invalid="true"] { border-color: var(--bad) !important; box-shadow: 0 0 0 2px var(--bad-soft); }
.edit label.bad > span { color: var(--bad); }
.ferr, .edit label small.ferr, label small.ferr { display: block; color: var(--bad); font-size: 0.82rem; font-weight: 700; line-height: 1.5; margin-top: 2px; word-break: auto-phrase; }
.flash.ng li a[data-jump] { white-space: nowrap; font-weight: 700; }

/* ── r5: POP の対象の商品（選んで足す・× で外す） */
.codepick { display: grid; gap: 8px; }
.codes-ui { display: grid; gap: 8px; }
.codes-ui[hidden] { display: none; }
.chips.edit { margin: 0; }
.chips.edit li { display: inline-flex; align-items: center; gap: 6px; }
.chips.edit li button { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 4px; color: var(--sub); min-width: 28px; min-height: 28px; }
.chips.edit li button:hover { color: var(--bad); }
.codes-add { display: flex; gap: 8px; flex-wrap: wrap; }
.codes-add input { flex: 1 1 220px; }

.ib { display: inline-block; }
details.sizebox > summary { flex-wrap: wrap; column-gap: 4px; }
details.sizebox > summary > span:first-of-type { white-space: nowrap; }

/* ── r5: 長い一覧を畳む・印を付けたら下に貼り付く「この状態にする」 */
tr.clipped { display: none !important; }
.bulkbar { position: sticky; bottom: 10px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.bulkbar[hidden] { display: none; }
@media (max-width: 820px) { .bulkbar { bottom: calc(66px + env(safe-area-inset-bottom)); } }
@media print { .bulkbar { display: none !important; } }
.list.pickrows td.pickcell { width: 36px; padding-right: 0; }

/* 行の形（スマホ幅）で、ここから 2 行目にする印。パソコン幅では出さない */
.list th.brk, .list td.brk { display: none; }
@media (max-width: 820px) { .list.asrows tbody td.brk, .list.asrows tbody td.brk:empty { display: block; flex: 1 1 100%; height: 0; } }
.trail li.then i { background: none; color: var(--sub); }
.trail li.then small { font-weight: 400; color: var(--sub); margin-right: 2px; }

/* ── r5: POP の確認（店舗ごとのまとまり）。線は店舗の間にだけ引き、指を置いたときの色はまとまり全体に付ける */
.list.grouped tbody.grp td { border-bottom: 0; }
.list.grouped tbody.grp:hover td { background: var(--hover); }
.list.grouped tbody.grp tr:hover td { background: inherit; }
.list.grouped tbody.grp:hover tr td { background: var(--hover); }
@media (hover: none) { .list.grouped tbody.grp:hover tr td { background: transparent; } }
@media screen and (max-width: 820px) {
  .list.asrows.grouped tbody tr > td.name:not(.sub2) { flex: 1 1 0; min-width: 0 !important; }
  .list.asrows tbody td.brk { order: -1; }
}
.flash.nextok { align-items: center; flex-wrap: wrap; }
.flash.nextok > span { flex: 1 1 260px; }
/* 欠品・品薄のどちらかに絞っているときは、状態の列を出さない（全部同じになるため） */
.list.onekind thead th:first-child, .list.onekind tbody td.tagcell:first-child { display: none !important; }

/* 設定の画面（会社・利用者・自分のこと）は、どちらの側から開いても同じ色（青）にする */
body.setpage main { --accent: #2b47c3; --accent-ink: #1e3594; --accent-soft: #e9edfb; --accent-line: #b9c6f2; }
.tn-win header button.tn-close { min-width: 44px; min-height: 36px; }
.fhint { display: block; color: var(--sub); font-size: 0.78rem; font-weight: 400; margin-top: 2px; }
@media screen and (max-width: 820px) { .list.opslog tbody td[data-l="対象の会社"] { flex: 1 1 100%; } }

/* 言葉の途中で 1〜2 字だけ次の行に落ちないように（日本語は文節で折る） */
main, .tn-win, .gate-form, .inv-tools { word-break: auto-phrase; }
/* 長い文のボタン（スマホ）: 折り返して、横にはみ出さない */
@media (max-width: 820px) { .btn.wrapbtn { white-space: normal; height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; text-align: left; } }
/* 売れた商品（スマホ）: 1 行目は順位・名前・売上。名前が長くても売上を次の行に落とさない */
@media screen and (max-width: 820px) { .list.asrows tbody tr:has(> td.mnum) > td.name:not(.sub2) { flex: 1 1 0; min-width: 0 !important; } .list.asrows tbody td.mnum { order: -4; } }

/* ───── カテゴリーの分析（src/catman-views.js） ───── */
.cm-nav { margin: 6px 0 4px; flex-wrap: wrap; }
.cm-idx { display: inline-block; min-width: 3.2em; padding: 1px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.cm-up { background: var(--ok-soft); color: var(--ok); }
.cm-down { background: var(--bad-soft); color: var(--bad); }
.cm-barcell { min-width: 140px; }
.cm-bars { display: grid; gap: 2px; width: 140px; }
.cm-bars i { display: block; height: 7px; border-radius: 2px; min-width: 1px; }
.cm-bars i.s { background: var(--accent); }
.cm-bars i.w { background: #9aa3ad; }
.cm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .cm-two { grid-template-columns: minmax(0, 1fr); } }
.cm-matrix th, .cm-matrix td { text-align: center; }
.cm-cross small { display: block; font-size: 0.75em; }
.cm-list { margin: 4px 0 12px; padding-left: 1.2em; }
.cm-list li small { display: block; color: var(--ink-2); }
.cm-heatwrap { overflow-x: auto; }
.cm-heattable { border-collapse: collapse; font-size: 12px; }
.cm-heattable th, .cm-heattable td { border: 1px solid #e3e5e8; padding: 2px 4px; }
.cm-heattable thead th { background: #f6f7f8; }
.cm-vert { height: 70px; vertical-align: bottom; }
.cm-vert span { writing-mode: vertical-rl; font-weight: 500; font-size: 11px; }
.cm-heat { min-width: 28px; text-align: right; background: rgba(43, 71, 195, var(--a)); color: var(--ink); }
.cm-heat[style*="--a:0.6"], .cm-heat[style*="--a:0.7"], .cm-heat[style*="--a:0.8"], .cm-heat[style*="--a:0.9"], .cm-heat[style*="--a:1"] { color: #fff; }
.cm-heat.cm-out { outline: 2px solid #c4321f; outline-offset: -2px; }
.cm-scatter { width: 100%; max-width: 480px; height: auto; font-size: 11px; }
.cm-scatter .ax { stroke: #9aa3ad; }
.cm-scatter circle { fill: var(--accent); fill-opacity: 0.6; }
.cm-scatter circle.good { fill: var(--ok); }
.cm-scatter circle.bad { fill: #c4321f; }
.cm-scatter text { fill: var(--ink-2); }
.cm-kpis { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 14px; }
.cm-kpis div { border: 1px solid #e3e5e8; border-radius: 8px; padding: 8px 14px; min-width: 130px; }
.cm-kpis small { display: block; color: var(--ink-2); }
.cm-kpis b { font-size: 1.4em; font-variant-numeric: tabular-nums; }
.cm-stacks { display: grid; gap: 6px; max-width: 720px; }
.cm-stack { display: grid; grid-template-columns: 11em minmax(0, 1fr) 4.5em; gap: 8px; align-items: center; }
.cm-track { display: flex; height: 14px; background: #f1f2f4; border-radius: 3px; overflow: hidden; }
.cm-track i { display: block; height: 100%; }
.cm-track i.own, .cm-key.own { background: var(--accent); }
.cm-track i.other, .cm-key.other { background: #b9b4a6; }
.cm-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.cm-warnrow td:first-child b { color: var(--warn); }
.cm-stockgrid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cm-stockgrid { grid-template-columns: minmax(0, 1fr); } }
/* ヒートマップの凡例 */
.heat-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.heat-legend b { margin-right: 4px; }
.heat-stop { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.heat-stop i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid #00000033; }
.heat-stop small { color: #6b7280; }
.heat-hint { display: block; margin-top: 4px; color: #5f6a63; }

/* 提案書の 3 枚目: カテゴリーの分析（src/change-views.js catPaper） */
.pp-catsw { align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.pp-cat-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 12px; }
.pp-cat-list { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; font-size: 0.92rem; }
.pp-cat-list li small { display: block; color: var(--sub); font-size: 0.8rem; }
.pp-cat-list li b { margin-left: 8px; font-family: var(--mono); }
.pp-cat-table td, .pp-cat-table th { font-size: 0.86rem; padding: 3px 6px; }
.pp-cat-bars { width: 34%; }
.pp-cat-bars span { display: block; height: 6px; margin: 1px 0; background: #f1f2f4; border-radius: 2px; overflow: hidden; }
.pp-cat-bars i { display: block; height: 100%; }
.pp-cat-bars i.s, .pp-key.s { background: #2f8f5b; }
.pp-cat-bars i.b, .pp-key.b { background: #b9b4a6; }
.pp-cat-bars i.a, .pp-key.a { background: #3f66a8; }
.pp-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin: 0 2px 0 6px; }
.pp-cat-self { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; font-size: 0.9rem; }
.pp-cat-self span { color: var(--sub); margin-right: 8px; }
.pp-cat-self b { font-family: var(--mono); }
.pp-cat-fc { margin-top: 6px; font-size: 0.9rem; }
.pp-cat-fc b { font-family: var(--mono); }
@media print { .pp-cat .pp-cat-table td, .pp-cat .pp-cat-table th { font-size: 9pt; padding: 2px 5px; } .pp-cat .pp-cat-list { font-size: 9.5pt; } }
/* ───── 売場チェック（src/views.js shelfCheckPage・public/shelfcheck.js） ───── */
.sc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .sc-grid { grid-template-columns: minmax(0, 1fr); } }
.sc-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sc-view { max-height: 72vh; overflow: auto; border: 1px solid #e3e5e8; border-radius: var(--r); background: #f6f7f8; }
.sc-canvas { display: block; max-width: none; height: auto; }
.sc-thumbs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; }
.sc-thumb { border: 2px solid transparent; border-radius: 6px; padding: 0; background: none; cursor: pointer; }
.sc-thumb.on { border-color: var(--accent); }
.sc-thumb img { display: block; width: 72px; height: 54px; object-fit: cover; border-radius: 4px; }
.sc-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.sc-rate { font-size: 1.15rem; padding: 2px 10px; border-radius: 6px; }
.sc-rate.ok { background: var(--ok-soft); color: var(--ok); }
.sc-rate.warn { background: var(--warn-soft); color: var(--warn); }
.sc-rate.ng { background: var(--bad-soft); color: var(--bad); }
.sc-sheet svg g.it { cursor: pointer; }
.sc-key { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font-weight: 700; border: 2px solid #9aa3ad; }
.sc-key.sc-short { border-color: #c98a1a; color: #c98a1a; }
.sc-key.sc-out { border-color: #c4321f; color: #c4321f; background: #f3c9c1; }
.sc-key.sc-moved { border-color: #2b47c3; color: #2b47c3; }
.sc-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.sc-item { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #e3e5e8; border-radius: 6px; background: #fff; text-align: left; cursor: pointer; font: inherit; }
.sc-item[data-state="short"] { border-color: #c98a1a; background: var(--warn-soft); }
.sc-item[data-state="out"] { border-color: #c4321f; background: var(--bad-soft); }
.sc-item[data-state="moved"] { border-color: #2b47c3; background: var(--accent-soft); }
.sc-mark { font-weight: 700; white-space: nowrap; }
.sc-done { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.sc-done li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sc-stock { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 10px 0 0; }
.edit .sc-stock label.check { display: inline-flex; }
.edit .sc-stock label.check input { width: auto; flex: none; margin: 0; }
