/* =====================================================================
   Amazon在庫・発注管理 — style.css（ロイズ向けシステムと共通の骨組み）に足す部品
   使う人は 50代中心・PC 主体。次にやることを 1 つだけ大きく見せ、
   いま何番目の手順にいるかを常に表示する。
   状態の色：発注が必要 = danger / 再発注の候補 = caution / 発注済み = info（紺の薄い色） / 足りている = ok
   カードの端に色の線は付けない（ロイズ向けシステムと同じ決まり）
   ===================================================================== */

.block { display: block; }
.right { text-align: right; }
ul.plain { margin: var(--s1) 0 0; padding-left: 1.2em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty {
  background: var(--surface); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line);
  padding: var(--s6); text-align: center; color: var(--ink-2); font-size: var(--t-sub);
}
.crumbs { font-size: var(--t-foot); color: var(--ink-2); margin-bottom: var(--s2); }
h1 .muted { font-size: var(--t-sub); font-weight: 500; margin-left: var(--s2); }
h2 .muted, .panel-title .muted { font-weight: 500; font-size: var(--t-sub); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.lead { font-size: var(--t-body); line-height: 1.8; margin: 0 0 var(--s5); max-width: 62em; }
.opt { font-weight: 500; color: var(--ink-3); margin-left: var(--s2); }
code.pass { font-size: 1.15em; letter-spacing: 0.06em; padding: 2px 10px; }

/* ---- サイドバー（ロイズと同じ明るい面。紺はロゴと選択中の印だけ） ---- */
.brand-mark { background: var(--brand); color: var(--star); width: 40px; height: 40px; border-radius: 10px; }
.brand-mark svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; }
.brand-name { font-size: 17px; letter-spacing: 0.02em; }
.sidebar .nav-group { letter-spacing: 0.08em; }
.sidebar .nav-item { font-size: 16px; }
.sidebar-foot .me { font-size: var(--t-foot); color: var(--ink-2); padding: 0 var(--s3) var(--s2); }
button.nav-item.linklike {
  width: 100%; background: transparent; color: var(--ink); justify-content: flex-start; font-weight: 500; padding: 0 var(--s3);
}
button.nav-item.linklike:hover { background: var(--fill); }

/* ---- 大きいボタン（その画面でいちばん押してほしいもの） ---- */
button.xl, .btn.xl {
  min-height: 60px; padding: 0 var(--s8); border-radius: 12px;
  font-size: 19px; font-weight: 700; letter-spacing: 0.02em; gap: var(--s3);
  box-shadow: 0 2px 5px rgba(26, 26, 26, 0.22);
}
button.xl svg, .btn.xl svg { width: 22px; height: 22px; }
button.send { min-width: 300px; }
.btn svg, button svg { flex: none; }

/* ---- 手順の表示（1〜4） ---- */
.steps {
  list-style: none; margin: var(--s5) 0 var(--s6); padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2);
}
.steps li {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-radius: var(--r);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  color: var(--ink-2); font-size: var(--t-sub); font-weight: 600; line-height: 1.35;
}
.steps .n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; font-weight: 700;
  background: var(--fill); color: var(--ink-2);
}
.steps .n svg { width: 20px; height: 20px; stroke-width: 2.6; }
.steps li.now { background: var(--brand); color: var(--on-brand); }
.steps li.now .n { background: var(--on-brand); color: var(--brand); }
.steps li.done .n { background: var(--ok-tint); color: var(--ok); }
.steps li.done { color: var(--ink); }
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- ホーム：在庫を確認する ---- */
.check-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); flex-wrap: wrap; }
.check-head .panel-sub { margin-bottom: var(--s2); font-size: var(--t-callout); }
.check-form button { min-width: 260px; }
.season-line { margin: 0; font-size: var(--t-sub); color: var(--ink-2); }
.season-line a { margin-left: var(--s2); font-weight: 600; }
.season-pill {
  display: inline-block; padding: 2px 12px; border-radius: 999px; font-weight: 700; color: var(--ink);
  background: var(--fill);
}
.season-pill.busy { background: var(--brand); color: var(--on-brand); }

.next-panel .panel-title { font-size: var(--t-title3); }
.big-num { font-size: 1.5em; color: var(--danger); font-variant-numeric: tabular-nums; margin: 0 2px; }
.need-list { margin: var(--s3) 0 var(--s5); padding-left: 0; list-style: none; font-size: var(--t-callout); }
.need-list li { padding: var(--s2) 0; border-bottom: 1px solid var(--separator); }
.need-list li:last-child { border-bottom: 0; }
.resume .actions { margin-top: var(--s3); }

.sup-title { font-size: var(--t-headline); margin: var(--s6) 0 var(--s2); }
.sup-title .muted { font-weight: 500; }
table.stock td { padding-top: 14px; padding-bottom: 14px; }
.stock-num { font-size: 19px; font-weight: 700; }
.pick td { background: var(--danger-tint); }
.pick:hover td { background: color-mix(in srgb, var(--danger-tint) 80%, var(--danger) 6%); }
tr.off td { color: var(--ink-3); }

/* 状態のバッジは少し大きく */
.status { font-size: var(--t-sub); padding: 4px 12px 4px 10px; }
.status .sym { font-size: 12px; }

/* ---- ② 商品を選ぶ ---- */
.pick-panel .panel-title { margin-bottom: var(--s3); }
.pick-row {
  display: flex; align-items: center; gap: var(--s4);
  min-height: 64px; margin: 0; padding: var(--s3) var(--s4);
  border-top: 1px solid var(--separator); cursor: pointer;
  font-size: var(--t-callout); font-weight: 400; color: var(--ink);
}
.pick-row:hover { background: var(--fill); }
.pick-row:has(input:checked) { background: var(--brand-tint); }
.pick-row input[type=checkbox] { width: 26px; height: 26px; flex: none; }
.pick-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.pick-main .muted { flex-basis: 100%; }
.pick-qty { text-align: right; font-weight: 700; font-size: var(--t-headline); white-space: nowrap; }
.pick-qty .muted { display: block; font-weight: 500; }
details.panel > summary { font-size: var(--t-headline); }

/* 画面下の「戻る／次へ」 */
.step-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s3);
  margin-top: var(--s6);
}
.step-actions > :first-child:not(:only-child) { margin-right: auto; }
.step-actions form { margin: 0; }

/* ---- ③ 数量と納品先 ---- */
.order-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.order-no {
  display: inline-block; margin-right: var(--s3); padding: 2px 10px; border-radius: 6px;
  background: var(--brand); color: var(--on-brand); font-size: var(--t-foot); vertical-align: 2px;
}
.tbl-wrap.flat { box-shadow: 0 0 0 1px var(--separator); margin-bottom: var(--s4); }
input.qty { width: 7.5em; text-align: right; font-size: 18px; font-weight: 600; min-height: var(--hit); }
.check.tight { margin: 0; min-height: var(--hit); }
.row.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }
.panel-foot .muted { margin: 0; }

/* ---- ④ メール ---- */
.mail-fields label { margin-top: var(--s3); }
textarea.mail-body, pre.mail-preview {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: var(--t-body); line-height: 1.8;
}
pre.mail-preview {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
  background: var(--surface-2); border: 1px solid var(--separator); border-radius: var(--r); padding: var(--s4) var(--s5);
}
.mail-subject { margin: 0 0 var(--s2); font-size: var(--t-callout); }
.send-box {
  position: sticky; bottom: 0; z-index: 10;
  margin-top: var(--s6); padding: var(--s4) var(--s6);
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -2px 14px rgba(26, 26, 26, 0.10), 0 0 0 1px var(--separator);
  font-size: var(--t-callout);
}
.send-box .step-actions { margin-top: var(--s3); }

/* ---- 商品と閾値 ---- */
.season-form { display: flex; gap: var(--s3); flex-wrap: wrap; }
.season-btn {
  min-width: 220px; min-height: 64px; justify-content: flex-start; gap: var(--s3);
  background: var(--surface); color: var(--ink); font-size: var(--t-headline); font-weight: 600;
  box-shadow: inset 0 0 0 2px var(--border);
}
.season-btn:hover { background: var(--fill); }
.season-btn .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--border); flex: none; }
.season-btn.on { background: var(--brand-tint); box-shadow: inset 0 0 0 3px var(--brand); }
.season-btn.on .radio { box-shadow: inset 0 0 0 7px var(--brand); }
.season-btn .now { margin-left: auto; font-size: var(--t-caption); font-weight: 600; color: var(--brand-ink); }
th.col-now, td.col-now { background: var(--brand-tint) !important; }
th.col-now::after { content: "（いま）"; font-weight: 700; color: var(--ink); }
.help {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px;
  border-radius: 50%; background: var(--fill-strong); color: var(--ink); font-size: 12px; cursor: help;
}
.sticky-save {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: flex-end; gap: var(--s4); flex-wrap: wrap;
  margin-top: var(--s4); padding: var(--s3) var(--s5);
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -2px 14px rgba(26, 26, 26, 0.10), 0 0 0 1px var(--separator);
}
form.box.narrow { max-width: 860px; }
form.box h3 { margin-top: var(--s6); }

/* ---- 仕入れ先 ---- */
.sup-panel > summary { font-size: var(--t-callout); width: 100%; margin-left: 0; padding: var(--s2) var(--s2); }
.sup-sum { display: flex; flex-direction: column; }
.sup-sum .muted { font-weight: 400; }
.sup-form { margin-top: var(--s3); }

/* ---- メールのひな形 ---- */
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.tpl-grid form.box { margin-top: var(--s4); }
@media (max-width: 1100px) { .tpl-grid { grid-template-columns: 1fr; } }
table.plain-tbl { font-size: var(--t-sub); }
table.plain-tbl th { background: transparent; padding: var(--s2) var(--s3) var(--s2) 0; }
table.plain-tbl td { padding: var(--s2) 0; white-space: normal; }

/* ---- システムからのお知らせ（細い 1 行） ---- */
.sysbar { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.sysbar-item {
  display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap;
  padding: var(--s2) var(--s4); border-radius: 10px;
  background: var(--surface); border: 1px solid var(--separator);
  font-size: var(--t-foot); color: var(--ink-2); line-height: 1.6;
}
.sysbar-item b { color: var(--ink); font-weight: 600; }
.sysbar-item .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); align-self: center; }
.sysbar-item.alert .dot { background: var(--danger); }
.sysbar-item.alert b { color: var(--danger); }
.sysbar-item.sample .dot { background: var(--caution); }

/* ---- 先頭へ戻る ---- */
.to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 15;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  font-size: var(--t-caption); font-weight: 700; letter-spacing: 0.04em;
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease;
}
.to-top svg { width: 20px; height: 20px; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { text-decoration: none; background: var(--surface-2); }

/* ---- ログイン画面 ---- */
.login .brand-mark { width: 52px; height: 52px; }
.login form.box button { min-height: 56px; font-size: 18px; }

@media print { .to-top, .send-box, .sticky-save, .steps { display: none !important; } }
.warn-inline { color: var(--caution); font-weight: 600; }
/* ページの入れ物 .wrap と、表の折り返し列 td.wrap の名前が同じなので、表の側の余白を戻す */
td.wrap { padding: var(--s3) var(--s4); margin: 0; }
table.stock td.wrap { padding-top: 14px; padding-bottom: 14px; }
/* 商品と閾値の表は列が多いので、入力欄を詰めて横スクロールなしで収める */
.edit-tbl th, .edit-tbl td { padding-left: var(--s2); padding-right: var(--s2); }
.edit-tbl th:first-child, .edit-tbl td:first-child { padding-left: var(--s4); }
.edit-tbl input.qty { width: 5em; }
.edit-tbl td.wrap { min-width: 10em; }
.edit-tbl th { white-space: normal; vertical-align: bottom; line-height: 1.4; }

/* 納品プラン（Amazon） */
.inbound-box { margin-top: var(--s3); padding: var(--s3); border: 1px dashed var(--border); border-radius: 10px; }
.inbound-box .note { margin-top: 0; }
.inbound-box .muted { margin: var(--s2) 0 0; }
details.manual { margin-top: var(--s3); }
details.manual > summary { cursor: pointer; color: var(--ink-2); }
.ship-to { font-size: 1.15em; line-height: 1.6; margin: 0; }
.ship-no { font-size: 1.3em; font-weight: 700; letter-spacing: .04em; margin: 0 0 var(--s2); }
p.label { font-weight: 700; margin: 0 0 var(--s1, 4px); }
.confirm-box { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  margin: calc(var(--s2) * -1) 0 var(--s4); padding: var(--s4) var(--s6); background: var(--caution-tint); border-radius: var(--r-lg); }
.confirm-box .step-actions { margin: 0; }
/* 添付：「添付」の見出しと、押せるファイル札（48px）を横一列に。本文の枠とは間をあける */
p.attach { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); margin: var(--s4) 0 0; font-size: var(--t-callout); font-weight: 600; color: var(--ink-2); }
.main p.attach a { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--hit);
  padding: 0 var(--s4); border-radius: var(--r); background: var(--surface); color: var(--brand-ink);
  box-shadow: inset 0 0 0 1px var(--border); font-weight: 600; overflow-wrap: anywhere; text-decoration: none; }
.main p.attach a:hover { background: var(--brand-tint); }
p.attach a svg { flex: none; width: 20px; height: 20px; }

/* ---- 使い方の案内（ロイズ向けシステムの使い方ツアーと同じ作り。文字は一段大きく） ---- */
button.nav-item {
  width: 100%; justify-content: flex-start; background: transparent; color: var(--ink);
  padding: 0 var(--s3); font-weight: 500;
}
button.nav-item:hover { background: var(--fill); }
button.nav-item:active { transform: none; }
.sidebar .help-button { font-weight: 600; color: var(--brand-ink); }
.sidebar .help-button svg { color: var(--brand-ink); }
.topbar-help { margin-left: auto; color: var(--brand-ink); }

dialog.modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  border: 0; border-radius: var(--r-lg); padding: var(--s6);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
dialog.modal::backdrop { background: rgba(20, 20, 20, 0.5); }
dialog.modal h2 { margin: 0 0 var(--s2); font-size: var(--t-title3); }
dialog.modal > .muted { font-size: var(--t-sub); line-height: 1.7; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s6); }

.tour-group-title { font-size: var(--t-sub); font-weight: 700; color: var(--brand-ink); margin: var(--s5) 0 var(--s2); }
.tour-options { display: grid; gap: var(--s2); }
button.tour-option {
  display: block; width: 100%; height: auto; padding: var(--s3) var(--s4); text-align: left; white-space: normal;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--border); font-weight: 500;
}
button.tour-option:hover { background: var(--brand-tint); box-shadow: inset 0 0 0 2px var(--brand-ink); }
.tour-option-title { display: block; font-size: var(--t-headline); font-weight: 700; color: var(--brand-ink); }
.tour-option-desc { display: block; margin-top: 2px; font-size: var(--t-foot); font-weight: 400; color: var(--ink-2); }
.tour-spot {
  position: fixed; z-index: 1000; border-radius: var(--r-sm); pointer-events: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 9999px rgba(20, 20, 20, 0.6);
  transition: left 0.2s, top 0.2s, width 0.2s, height 0.2s;
}
.tour-card {
  position: fixed; z-index: 1001; width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: var(--s5) var(--s6); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
}
.tour-count { margin-bottom: var(--s1); font-size: var(--t-foot); color: var(--ink-2); }
.tour-title { font-size: var(--t-title3); font-weight: 700; line-height: 1.45; color: var(--brand-ink); margin-bottom: var(--s2); }
.tour-body { margin: 0 0 var(--s5); font-size: var(--t-body); line-height: 1.8; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.tour-move { display: flex; gap: var(--s2); margin-left: auto; }
.tour-move button { min-width: 96px; }
button.tour-end { background: none; color: var(--ink-2); padding: 0 var(--s2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button.tour-end:hover { background: var(--fill); }
@media print { .tour-spot, .tour-card, dialog { display: none !important; } }
/* 案内の一覧：上の帯（閉じる＋題名）はスクロールしても残す */
dialog.modal#tour-menu { padding-top: 0; }
.tour-menu-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: var(--s4);
  margin: 0 calc(-1 * var(--s6)) var(--s3); padding: var(--s4) var(--s6);
  background: var(--surface); border-bottom: 1px solid var(--separator);
}
.tour-menu-head h2 { margin: 0; }
button.tour-menu-close { flex: none; }
/* 案内中は「TOP」ボタンを隠す（案内先のボタンと重なるため） */
body:has(.tour-card:not([hidden])) .to-top { display: none; }

/* =====================================================================
   折り返しと位置のそろえ方
   日本語は文節（「いちばん」「発注メール」など）の途中で折り返さない。
   最後の行に 1〜2 文字だけ残る折り返しも避ける（対応ブラウザ：Chrome・Edge）。
   ===================================================================== */
h1, h2, h3, p, li, label, summary, td, th, dt, dd,
.note, .sub, .lead, .muted, .panel-sub, .sysbar-item, .steps li, .empty,
.tour-body, .tour-title, .tour-option, .brand-name, .send-box, .pick-main {
  /* text-wrap ではなく text-wrap-style を使う（text-wrap だと white-space: nowrap が効かなくなる） */
  word-break: auto-phrase; text-wrap-style: pretty;
}
h1, h2, h3, .panel-title, .tour-title, .steps .l, th { text-wrap-style: balance; }
.nw { display: inline-block; white-space: nowrap; }
td .nw { white-space: normal; word-break: keep-all; }   /* 長い商品名だけは中で折り返せるようにする */
/* 見出しの横の補足（「あて（ヤマト）」など）はひとかたまりで折り返す */
.panel-title .muted, h1 .muted, h2 .muted { display: inline-block; }
.help { vertical-align: 1px; }

/* 見出しと右の操作ボタン：ボタンは見出しの右上にそろえ、狭いときだけ下に回す */
.page-head { flex-wrap: nowrap; align-items: flex-start; }
.page-head > div { flex: 1 1 auto; min-width: 0; }
.page-head > .btn { flex: none; margin-top: 4px; }
@media (max-width: 640px) { .page-head { flex-wrap: wrap; } }

/* 手順の表示：4 つ並べると文字が 3 行になる幅では 2×2 にする */
.steps li { min-height: 64px; }
.steps .l { flex: 1; min-width: 0; }
@media (max-width: 1240px) and (min-width: 961px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* スマホの幅では、いまの手順だけ文字を出し、ほかは番号だけにする */
@media (max-width: 520px) {
  .steps { display: flex; gap: var(--s2); }
  .steps li { flex: none; min-height: 56px; padding: var(--s2); gap: var(--s2); }
  .steps .n { width: 30px; height: 30px; font-size: 15px; }
  .steps li:not(.now) .l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .steps li.now { flex: 1 1 auto; }
}

/* 表の見出しは中身と同じ側にそろえ、下の線にそろえる */
th { vertical-align: bottom; }
th.num { text-align: right; }

/* スマホの幅では、大きいボタンを横いっぱいにして、はみ出さないようにする */
@media (max-width: 520px) {
  button.xl, .btn.xl { width: 100%; max-width: 100%; padding: var(--s2) var(--s4); white-space: normal; text-align: center; min-height: 60px; }
  button.send { min-width: 0; }
  .check-form button, .check-form { width: 100%; min-width: 0; }
}
/* ボタンの文字も文節で折り返す（「確 / 認する」のような切れ方をさせない） */
button, .btn { word-break: auto-phrase; text-wrap-style: balance; }
/* 2 列の入力欄は、狭い画面では 1 列にして枠からはみ出さないようにする */
.row.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.row { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
/* 開閉の見出しが 2 行以上になるときは、印「›」を 1 行目にそろえる */
summary { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; line-height: 1.6; }
summary::before { margin-top: calc((1.6em - 20px) / 2); }
/* 仕入れ先の開閉は 2 行あるので、下線は名前だけに付ける */
.sup-panel > summary { text-decoration: none; }
.sup-panel > summary b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.sup-panel > summary .muted { color: var(--ink-2); }
.sup-panel[data-tour="sup-add"] > summary { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }

/* 配送業者：「その他」を選んだときだけ入力欄を出す */
.carrier-other { margin-top: var(--s2); }

/* ---- レイアウトの整え（余白・高さ・揃え） ---- */
.btn.sm svg, button.sm svg { width: 18px; height: 18px; }
/* 1 通のメール（履歴の詳細）：宛先・本文・添付を 1 枚にまとめる */
.mail-sheet .tbl-wrap { margin-bottom: 0; }
.mail-sheet .panel-title { margin: var(--s6) 0 var(--s3); }
table.kv th { vertical-align: top; width: 9em; background: var(--surface-2); border-right: 1px solid var(--separator); }
table.kv tr:last-child th { border-bottom: none; }
table.kv td { white-space: normal; overflow-wrap: anywhere; }
/* 入力欄の下の小さな補足 */
.field-hint { margin: 6px 0 0; }
/* 2 列の入力欄：補足は次の行に出して、左右の入力欄の高さをそろえる */
.row.two label .opt { display: block; margin: 2px 0 0; }
/* 注意書きの中のボタンは本文から離す */
.note .actions { margin-top: var(--s3); }
/* 送る枠があるページでは、先頭へ戻るボタンを枠の上に逃がす */
/* 下に固定の帯（送る枠・保存の帯）がある画面では、その上に逃がす */
body:has(.send-box) .to-top { bottom: 190px; }
body:has(.sticky-save) .to-top { bottom: 120px; }
/* 仕入れ先を選ぶ行は、パネルの端から端まで（選択色が左右に切れない） */
.panel .pick-row { margin: 0 calc(-1 * var(--s6)); padding: var(--s3) var(--s6); }
.order-head .status { white-space: normal; text-align: left; }
/* 手順表示：901〜960px で 4 列のまま残らないように 960px 以下は 2 列 */
@media (max-width: 960px) and (min-width: 521px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .panel .pick-row { margin: 0 calc(-1 * var(--s4)); padding: var(--s3) var(--s4); }
}
@media (max-width: 520px) {
  .send-box { position: static; border-radius: var(--r-lg); }
  .step-actions > * { flex: 1 1 100%; }
  .step-actions > :first-child { margin-right: 0; }
  .step-actions .btn, .step-actions button { width: 100%; }
  .order-panel td.wrap { min-width: 9em; }
  .order-panel input.qty { width: 5.5em; }
  .steps li:not(.now) { min-width: 56px; justify-content: center; }
}

/* ---- 管理画面の整え ---- */
.crumbs a { display: inline-flex; align-items: center; min-height: var(--hit); }
.crumbs { margin-bottom: 0; }
/* 仕入れ先の開閉見出し：名前と（使っていない）を 1 行に、長い宛先ははみ出さず折り返す */
.sup-sum { min-width: 0; flex: 1; }
.sup-sum .muted { overflow-wrap: anywhere; }
/* 2 列の入力欄：ラベルの行数が違っても入力欄の上端をそろえる */
.row > div { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.row > div > label { align-self: end; }
.row p.muted { margin: 6px 0 0; }
/* 保存とやめる等、同じ列のボタンは高さをそろえる */
.form-actions:has(.xl) > .btn.sec, .form-actions:has(.xl) > button.sec { min-height: 60px; padding: 0 var(--s6); }
.form-actions .push-right { margin-left: auto; }
@media (max-width: 520px) {
  .form-actions > * { flex: 1 1 100%; width: 100%; }
  .form-actions .push-right { margin-left: 0; }
}
/* 表の中の「印＋ボタン」は中央でそろえ、間隔 8px */
.cell-actions { display: flex; align-items: center; gap: var(--s2); }
.cell-actions form { margin: 0; }
/* 商品と閾値の表：右端の余白も左端と同じに */
.edit-tbl th:last-child, .edit-tbl td:last-child { padding-right: var(--s4); }
/* 数字欄の増減矢印を消し、マウスを乗せても数字が動かないようにする */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* 自動で入るところの表：上でそろえる・行の色を半分だけ付けない */
table.plain-tbl th, table.plain-tbl td { vertical-align: top; }
table.plain-tbl tr:hover td { background: transparent; }
/* パネル見出しの直後の中身は少し離す */
.panel-title + table, .panel-title + .mail-subject, .panel-title + .season-form, .panel-title + .tbl-wrap { margin-top: var(--s3); }
/* 枠の最初の見出しは上の余白を持たない */
form.box > h3:first-child, form.box > input[type=hidden] + h3 { margin-top: 0; }
h3 .opt { font-size: var(--t-foot); display: inline-block; }
/* 左右に並んだフォームは、ボタンの位置を下端にそろえる */
.row.two > form.box { display: flex; flex-direction: column; }
.row.two > form.box > button:last-child { margin-top: auto; align-self: flex-start; }
.row.two > form.box > :nth-last-child(2) { margin-bottom: var(--s5); }
/* 時期の切り替え：選び直しても幅が変わらない */
.season-btn { flex: 0 0 300px; }
@media (max-width: 520px) { .season-btn { flex: 1 1 100%; } }
/* 見出しの「？」：押せる大きさと読める文字に */
.help { width: 24px; height: 24px; font-size: var(--t-caption); margin-left: var(--s1); }
/* 使い方の案内の吹き出し：内側の余白を四辺同じに、狭い画面でも左右対称に */
.tour-card { padding: var(--s6); width: min(440px, calc(100% - 32px)); }
button.tour-end { margin-left: calc(-1 * var(--s2)); }
/* 配送業者の「その他」欄は、選択欄から少し離す */
.carrier-other { margin-top: var(--s3); }
/* 添付のファイル札は下線なし（本文リンクの共通指定より強くする） */
.main p.attach a:not(.btn):not(.nav-item):not(.to-top) { text-decoration: none; }
/* 商品と閾値の表は列が多いので、表の中のボタンは高さ 48px のまま横幅だけ詰める */
.edit-tbl .btn.sm, .edit-tbl button.sm { padding: 0 var(--s3); font-size: var(--t-foot); }
.edit-tbl .status { padding: 4px 10px 4px 8px; }

/* ---- 箱詰め（まとめる／分ける）2026-11-10 ---------------------------- */
.packing { margin: 0 0 var(--s4); }
.packing p.label { margin-bottom: var(--s2); }
.packing > .muted { margin: var(--s3) 0 0; }
.seg.lg label.seg-item span { min-height: var(--hit); padding: 0 var(--s5); font-size: var(--t-callout); }
th.center, td.center { text-align: center; }
.check.center { justify-content: center; margin: 0; }
fieldset.mixed-box { margin: var(--s4) 0 0; padding: var(--s4); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
fieldset.mixed-box legend { padding: 0 var(--s2); font-weight: 700; color: var(--ink); }
fieldset.mixed-box > .muted { margin: var(--s3) 0 0; }
/* 前回と同じ商品のまとめ箱：見本の値をうすい字で出す（mixbox.js） */
fieldset.mixed-box .past-box { margin: var(--s2) 0 var(--s3); padding: var(--s3) var(--s4); background: var(--brand-tint); border-radius: var(--r); line-height: 1.7; }
fieldset.mixed-box .past-box .past-items { display: block; margin-top: var(--s1); color: var(--ink-2); }
fieldset.mixed-box input::placeholder { color: #8b879c; opacity: 1; }

.box-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3) var(--s4); }
.box-grid label { margin-top: 0; }
.unit-in { display: flex; align-items: center; gap: var(--s2); }
.unit-in input { flex: 1 1 auto; min-width: 0; text-align: right; }
.unit-in > span { flex: none; color: var(--ink-2, var(--muted)); font-size: var(--t-callout); min-width: 1.6em; }
tr.sum td { font-weight: 600; background: var(--fill); }
@media (max-width: 960px) { .box-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .box-grid { grid-template-columns: 1fr; } }
input.qty[readonly] { background: var(--fill); color: var(--muted, #8a8794); }

/* ---- リッチテキストの編集欄（メールの本文）2026-11-10 ------------------ */
.rte { border: 1px solid var(--border); border-radius: 10px; background: var(--field); overflow: hidden; }
.rte:focus-within { border-color: var(--brand-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 35%, transparent); background: var(--surface); }
.rte-bar {
  display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s2);
  border-bottom: 1px solid var(--separator); background: var(--surface-2);
}
button.rte-btn {
  min-height: var(--hit); padding: 0 var(--s3); gap: var(--s2);
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border);
  font-size: var(--t-callout); font-weight: 500;
}
button.rte-btn:hover { background: var(--fill); }
button.rte-btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); box-shadow: none; }
button.rte-btn[aria-pressed="true"] .rte-sample { color: inherit; }
.rte-sample {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  font-size: 18px; font-weight: 700; line-height: 1; color: var(--ink);
}
.rte-area {
  padding: var(--s3) var(--s4); outline: none; color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: var(--t-body); line-height: 1.8; overflow-wrap: anywhere;
  max-height: 70vh; overflow-y: auto;
}
.rte-area p, .rte-area div { margin: 0; }
.mail-html {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: var(--t-body); line-height: 1.8; overflow-wrap: anywhere; margin: 0;
  background: var(--surface-2); border: 1px solid var(--separator); border-radius: var(--r); padding: var(--s4) var(--s5);
}
.mail-html p, .mail-html div { margin: 0; }
@media (max-width: 640px) { button.rte-btn > span:last-child { display: none; } button.rte-btn { padding: 0 var(--s2); min-width: var(--hit); } }

/* 見出しの「？」：押すと説明が開く（もう一度押すと閉じる）。マウスを載せるだけの title は、押しても何も出ないので使わない */
.help-tip { display: inline-block; position: relative; margin-left: var(--s1); vertical-align: middle; text-align: left; }
.help-tip > summary {
  list-style: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--fill-strong); color: var(--ink); font-size: var(--t-caption); font-weight: 700; cursor: pointer;
}
.help-tip > summary::-webkit-details-marker { display: none; }
.help-tip[open] > summary { background: var(--brand); color: #fff; }
.help-tip > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.help-pop {
  position: absolute; top: calc(100% + 6px); right: -8px; z-index: 30; width: 280px;
  padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font-size: var(--t-body, 18px); font-weight: 400; line-height: 1.7; white-space: normal; word-break: normal;
  box-shadow: 0 6px 24px rgba(26, 26, 26, 0.18), 0 0 0 1px var(--separator);
}
.help-tip > summary { padding: 0; margin: 0; gap: 0; min-height: 0; text-decoration: none; line-height: 1; align-items: center; }
.help-tip > summary::before, .help-tip > summary::after { content: none; display: none; }
.help-tip > summary:hover { background: var(--fill-strong); }
.help-tip[open] > summary:hover { background: var(--brand); }
