/* v21 design (Paper「v21 再設計（A-3）」): a black frame, white panels, orange for 選択中・オン and the main actions.
   PC (981px and up): header; conditions on the left (積荷・置き場所・積み方) or 積荷 as a table under the 3D; on the right the
   summary band, the result line, the 3D view with its bar. Phones: header, one-line summary and the 3D stay put; the inputs
   scroll between them and the tab bar. Light only. */
:root{
  --ink:#1C1C1A;          /* frame: bands, lines that matter */
  --or:#FF5F1F;           /* 選択中・オン, main actions */
  --wh:#FFFFFF;
  --con:#E6E5E1;          /* concrete */
  --pap:#F2F1ED;          /* thin ground */
  --line:#D6D5D0;
  --m1:#6E6D68;           /* secondary text */
  --m2:#4A4945;
  --m3:#8A8983;
  --warn:#C3243B;
  --pal:#FFE7DB;          /* pallet settings */
  --pal-line:#F5C9B3;
  --sel:#FFF4EE;          /* a highlighted row */
  --best:#C2410C;         /* 本数が最も少ない */
  --scene:#DDE3DA;        /* 3D background (read by the script) */
  --dk-line:#3A3934;      /* separators on black */
  --dk-mut:#A3A299;       /* muted text on black */
  --faint:#B9B8B2;
  --off:#C9C8C2;
  --b-fill:#F6F5F2;       /* v24 B: fields, the preset's line, panels */
  --b-line:#E3E2DD;       /* v24 B: tiles and cards */
  --b-chip:#DAD9D3;       /* v24 B: chips, field borders */
  --b-dash:#B9B8B1;       /* v24 B: dashed (入るだけ, 寸法を入力, the add button), radios */
  --b-sep:#ECEBE7;        /* v24 B: between the steps */
  --b-x:#B3B2AC;          /* v24 B: quiet controls (×, ↑ / ↓) */
  --b-qty:#CFCEC8;        /* v24 B: the 数量 field */
  /* v24 B: a field being typed in (Paper 「③ 追加した直後」's 数量): a 2px orange border and a soft orange ring, drawn
     inside the field's own 1px border (inset) so nothing moves */
  --fo:inset 0 0 0 1px var(--or),0 0 0 3px rgba(255,95,31,.18);
  --txt:#000000;
  /* v30 案B: IBM Plex Sans JP for the text and the numbers (it stops at 700); IBM Plex Mono for sizes */
  --f-body:"IBM Plex Sans JP","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif;
  --f-mono:"IBM Plex Mono","IBM Plex Sans JP",ui-monospace,Menlo,monospace;
  --f-num:"IBM Plex Sans JP","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif;
  --sh:6px 6px 0 rgba(28,28,26,.18);
  color-scheme:light;
}
/* Thai (i18n/lang.ts): the Thai letters from IBM Plex Sans Thai (ui/fonts.ts loads it only then), the rest as in Japanese */
:root:lang(th){
  --f-body:"IBM Plex Sans JP","IBM Plex Sans Thai","Thonburi","Leelawadee UI","Noto Sans Thai","Hiragino Sans",system-ui,sans-serif;
  --f-num:"IBM Plex Sans JP","IBM Plex Sans Thai","Thonburi","Leelawadee UI","Noto Sans Thai","Hiragino Sans",system-ui,sans-serif;
}
/* 「กล่อง」 is wider than 「箱」: a 数量 of 4 characters or more (rows.ts .long) shows without it, as a long one does on phones */
:root:lang(th) .qtw.long .qtu{display:none}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%;margin:0}
body{background:var(--wh);color:var(--txt);font-family:var(--f-body);font-size:13px;line-height:16px;overflow:hidden;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}
button,input,select,textarea{font:inherit;color:inherit;margin:0}
button{background:none;border:0;border-radius:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default}
h1,h2,h3,p{margin:0}
:focus-visible{outline:2px solid var(--or);outline-offset:-2px}
input[type="number"]{-moz-appearance:textfield;appearance:textfield}
input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}
.grow{flex:1 1 0;min-width:0}
/* ▼ / ▲ of the buttons that open something */
.tri{display:inline-block;flex:0 0 auto;width:0;height:0;margin-left:6px;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid currentColor;vertical-align:1px}
.tri.up{border-top:0;border-bottom:5px solid currentColor}

/* checkbox (every one: 天地無用, 向き, 別サイズの上に積まない; 寸法 uses .ckv): off = a white square with a 2px black border,
   on = solid orange (選択中・オン) with a white check. input.ck.ck outranks the table's input rules */
input.ck.ck{-webkit-appearance:none;appearance:none;flex:0 0 auto;display:inline-block;width:16px;height:16px;margin:0;padding:0;border:2px solid var(--ink);border-radius:0;background:var(--wh);box-shadow:none;cursor:pointer;vertical-align:middle}
input.ck.ck:checked{border-color:var(--or);background:var(--or) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.7 5.3 4.1 7.6 8.4 2.7' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") center/12px 12px no-repeat}
input.ck.ck:focus{outline:none}
input.ck.ck:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.tb input.ck.ck:focus-visible{outline-color:var(--or)}

.app{height:100%;display:flex;flex-direction:column}

/* ---------- header ---------- */
.top{flex:0 0 auto;height:48px;display:flex;align-items:center;background:var(--ink);padding-left:20px;color:#F2F1ED}
.logo{flex:0 0 auto;width:24px;height:24px;display:block}
.top h1{display:flex;align-items:baseline;gap:10px;padding-left:10px;font-size:15px;font-weight:700;line-height:18px;color:#F2F1ED;white-space:nowrap}
/* the name, sekisai, then what it is, 積載シミュレーター, smaller and muted on the same baseline */
.b-name{flex:0 0 auto;font-size:18px;line-height:22px;letter-spacing:.02em}
.b-sub{font-size:12px;font-weight:500;line-height:16px;color:var(--dk-mut)}
/* the narrowest phones (under 340px): the name only, so 共有 and ⋯ keep their room */
@media (max-width:339px){.b-sub{display:none}}
.top-actions{display:flex;align-items:stretch;height:100%}
.lay{display:flex;align-items:center;gap:10px;height:48px;padding-inline:16px;border-left:1px solid var(--dk-line)}
.lay-l{font-size:12px;color:var(--dk-mut)}
.lay-seg{display:flex;border:1px solid var(--m1)}
.lay-seg button{display:flex;align-items:center;gap:6px;height:26px;padding-inline:10px;font-size:12px;line-height:16px;color:#F2F1ED}
.lay-seg button svg{flex:0 0 auto;display:block}
.lay-seg button[aria-pressed="true"]{background:var(--or);color:var(--ink);font-weight:700}
.tbtn{display:flex;align-items:center;height:48px;padding-inline:18px;border-left:1px solid var(--dk-line);font-size:13px;line-height:16px;color:#F2F1ED;white-space:nowrap}
.tbtn:hover{background:#2B2B29}
.tbtn.primary{background:var(--or);color:var(--ink);font-weight:700;padding-inline:20px;border-left:0}
.tbtn.primary:hover{background:#FF7440}
/* ⋯ (PC): the last one in the row; its dropdown opens under it (#moreMenu: このツールについて / AI から使う / 計算のしくみ / お問い合わせ; 使い方 stays in the row) */
.tbtn.more{justify-content:center;width:48px;padding:0;font-size:18px;line-height:22px}
@media (min-width:981px){
  .tbtn.more[aria-expanded="true"]{background:#2B2B29}
  #moreMenu{position:fixed;z-index:20;width:220px;display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:6px 6px 0 rgba(28,28,26,.2)}
  #moreMenu[hidden],#moreMenu .grab,#moreMenu #copyBtnM,#moreMenu #helpBtnM,#moreMenu #liteBtnM,#moreMenu .mm-note{display:none}
  #moreMenu .mm{display:flex;align-items:center;height:40px;padding-inline:14px;border-bottom:1px solid var(--con);font-size:13px;line-height:16px;color:var(--txt);text-align:left;white-space:nowrap}
  #moreMenu .mm:hover{background:var(--b-fill)}
  #moreMenu #contactM{border-bottom:0}
}
@media (min-width:981px) and (pointer:coarse){#moreMenu .mm{height:48px}}
a.mm{text-decoration:none}
.mm-ext{flex:0 0 auto;display:block;margin-left:6px;color:var(--m1)}
/* 日本語 / ไทย in ⋯: the page's language in ink, the other one quiet */
.mm-gl{flex:0 0 auto;display:block;margin-right:8px;color:var(--m1)}
.mm-lg{color:var(--m1)}
.mm-lg-s{margin-inline:6px;color:var(--m3)}
html[lang="ja"] .mm-lg[data-lang="ja"],html[lang="th"] .mm-lg[data-lang="th"]{font-weight:700;color:var(--ink)}

/* ---------- body ---------- */
.body{flex:1 1 0;min-height:0;display:flex}
.cond{flex:0 0 400px;width:400px;min-height:0;display:flex;flex-direction:column;background:var(--wh);border-right:2px solid var(--ink);overflow-y:auto;overscroll-behavior:contain}
.app[data-layout="bottom"] .cond{flex-basis:330px;width:330px}
.work{flex:1 1 0;min-width:0;display:flex;flex-direction:column;position:relative}
.grow-v{flex:1 0 auto}

/* ---------- the conditions as three steps (v24 B 案内つき, Paper「v24 B案（全パターン）」) ----------
   Spacing as the boards, but 12px (not 14–16) at the end of each step, so the boards' standard cases fit a 1440 × 900
   window whole (the truck's board is 10px taller than its column).
   1 何を積む？ 2 どこに積む？ 3 どう積む？: a black number, the title, and at the right the step's ⓘ (open) or its
   summary (folded, ui/steps.ts). Light: white, a pale fill for fields and panels, ink for what is chosen, orange for
   the 置き場所 and 積み方 picked. The row's widths are variables, so the column labels line up with the fields */
.cond{--rg:8px;--rpr:14px;--kgw:64px;--qtw:96px;--xw:14px}
.sec{flex:0 0 auto;display:flex;flex-direction:column;border-bottom:1px solid var(--b-sep)}
.sec-head{position:relative;flex:0 0 auto;display:flex;align-items:center}
.sec-t{flex:1 1 0;min-width:0;display:flex}
.sec-tog{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:10px;padding:16px var(--rpr) 10px 16px;text-align:left;color:var(--ink)}
#secCargo .sec-tog{padding-bottom:8px}
.st-n{flex:0 0 22px;width:22px;height:22px;display:flex;align-items:center;justify-content:center;border-radius:999px;background:var(--ink);font-family:var(--f-num);font-size:12px;font-weight:700;line-height:14px;color:var(--wh)}
.st-tt{flex:0 0 auto;font-size:16px;font-weight:700;line-height:20px;letter-spacing:-.01em;white-space:nowrap}
.sec-sum{flex:1 1 0;min-width:0;font-size:12px;line-height:16px;color:var(--m3);text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sec-sum .ss-n{display:none}
.st-cv{flex:0 0 auto;color:var(--b-x);transform:rotate(180deg)}
.sec-tog:hover .st-cv{color:var(--m1)}
/* open: 2 and 3 show their ⓘ at the right (over the empty summary), 1 its total; folded: the summary, bold */
.sec-info{flex:0 0 auto;display:flex;align-items:center;font-size:12px;line-height:16px;color:var(--m3);white-space:nowrap}
.sec-info:hover,.sec-info[aria-expanded="true"]{color:var(--ink)}
.sec-head > .sec-info{position:absolute;right:calc(var(--rpr) + 20px);top:16px;height:20px}
#secSpace[data-open="true"] .sec-sum,#secLoad[data-open="true"] .sec-sum{visibility:hidden}
.sec[data-open="false"] .sec-body,.sec[data-open="false"] .sec-head > .sec-info{display:none}
.sec[data-open="false"] .sec-tog{min-height:52px;padding-block:15px}
.sec[data-open="false"] .sec-sum{font-size:12.5px;font-weight:700;color:var(--ink)}
.sec[data-open="false"] .sec-sum .ss-n{display:inline}
.sec[data-open="false"] .st-cv{transform:none;color:var(--m1)}
/* a row move turned 積む順番 to リストの順: said for a moment at the right of 3's head */
.st-say{position:absolute;right:var(--rpr);top:12px;display:flex;align-items:center;gap:6px;height:28px;padding-left:10px;background:var(--wh);font-size:12px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap;animation:ordBack .3s ease-out}
@keyframes ordBack{from{opacity:0}to{opacity:1}}
.st-say::before{content:"";flex:0 0 auto;width:8px;height:8px;border-radius:999px;background:var(--or)}
.sec-body{display:flex;flex-direction:column}
/* layout 下: 積荷 is the table under the 3D view; 2 and 3 stay here */
.app[data-layout="bottom"] #secCargo{display:none}

.hint{background:var(--pap);border-bottom:1px solid var(--line);padding:9px 16px 10px;font-size:12px;line-height:18px;color:var(--m2)}
.hint p + p{margin-top:4px}
.cond .hint{margin:2px var(--rpr) 10px 16px;padding:9px 12px 10px;border:0;border-radius:10px;background:var(--b-fill)}

/* 1 何を積む？: the column labels, one row per box size (↑ / ↓ small at the left with 2 rows or more, the box drawn in
   its colour, name and sizes, 1箱の重さ, a wide 数量 — empty is 入るだけ, dashed — and ×) */
.rows-h{display:flex;align-items:center;gap:var(--rg);min-height:18px;padding:0 calc(var(--rpr) + var(--xw) + var(--rg)) 4px 16px}
.rows-h .sec-info{font-size:11px;line-height:14px}
.rh-k,.rh-q{flex:0 0 auto;font-size:11px;line-height:14px;color:var(--m3);text-align:right;white-space:nowrap}
.rh-k{width:var(--kgw)}
.rh-q{width:var(--qtw)}
.rows-h.empty .rh-k,.rows-h.empty .rh-q{visibility:hidden}
.rows{list-style:none;margin:0;padding:0}
.box-row{display:flex;align-items:center;gap:var(--rg);min-height:50px;padding:6px var(--rpr) 6px 16px}
.box-ic{flex:0 0 auto;display:block;width:24px;height:24px}
.box-info{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding-left:4px;text-align:left}
.box-name{max-width:100%;font-size:14px;font-weight:700;line-height:18px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 450×320×280 · 印字, then the bookmark: the 印字 gives way first, the sizes after it */
/* 450×320×280, the bookmark, then · 印字 — which gives way with … and, where not even three of its characters would fit,
   goes to a second line that is not shown (its basis is that much; the line is one line tall) */
.box-line{display:flex;flex-wrap:wrap;align-items:center;align-content:flex-start;gap:0 4px;max-width:100%;min-width:0;height:16px;overflow:hidden}
.box-line .bm{order:1}
.box-meta{flex:0 0 auto;min-width:0;font-family:var(--f-mono);font-size:11.5px;line-height:15px;color:var(--m1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.box-pr{order:2;flex:1 1 5ch;max-width:max-content;min-width:0;font-family:var(--f-mono);font-size:11.5px;line-height:15px;color:var(--m1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.box-pr:empty{display:none}
/* 案Z: a value written on a row changes where it is (ui/row-edit.ts). Text until pressed: a faint ground under it on
   hover and a text cursor; pressed, a field with the orange border, the same size (on a PC the row never grows). The
   field reaches out by its padding (into the gap before it, which its parent leaves unclipped), so the text keeps its
   place and never sits on the border */
.ev{display:inline;margin:0 -2px;padding:0 2px;border-radius:3px;text-align:inherit;cursor:text}
@media (hover:hover){.ev:hover{background:#EDECE8}}
.ev:focus-visible{outline:2px solid var(--or);outline-offset:0}
.ev.none{color:var(--m3);font-weight:400}
.ev.box-name{display:block;margin:0 0 0 -3px;padding:0 3px}
.ev-in{min-width:0;border:0;border-radius:3px;background:var(--wh);box-shadow:inset 0 0 0 1.5px var(--or);padding:0 3px;font:inherit;color:var(--ink);outline:none}
.ev-in[aria-invalid="true"]{box-shadow:inset 0 0 0 1.5px var(--warn);color:var(--warn)}
.ev-in::placeholder{font-family:var(--f-body);font-size:11px;font-weight:400;color:var(--m3)}
/* the name: 6px inside, out into the gap after the box drawn; 20px tall over the 1px gap above and below (the row as tall) */
.box-info .ev-in.name{width:calc(100% + 6px);height:20px;margin:-1px 0 -1px -6px;padding:0 6px;font-size:14px;font-weight:700;line-height:20px}
/* the three sizes: each as wide as its figures (var(--n), row-edit.ts) and 3.5px inside, so 長さ stays where it was
   written and 幅・高さ move by the padding only; the line reaches 5px out on both sides while they are open (phones and
   touch screens: below) */
.box-meta .ev-in.sz{width:calc(var(--n, 4) * 1ch + 7px);height:15px;margin:0;padding:0 3.5px;font-family:var(--f-mono);font-size:11.5px;line-height:15px;text-align:right;vertical-align:top}
.box-line:has(.ev-in){max-width:calc(100% + 11px);margin:0 -6px 0 -5px;padding:0 1px 0 5px}
.box-meta:has(.ev-in){margin-left:-3.5px}
.box-row.editing .box-pr,.box-row.editing .box-line .bm{display:none}
/* the bookmark (the box saved for next time): an outline button on a row not saved, a quiet filled mark on a saved one */
.bm{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:3px;color:var(--m3)}
.bm svg{display:block}
button.bm:hover{background:var(--b-fill);color:var(--ink)}
.bm.on{color:var(--b-dash);cursor:default}
.bm.on:focus{outline:none}
/* a row made from a saved box and changed on the row: the saved values, small, and 「登録を更新」 */
.box-reg{display:flex;max-width:100%;min-width:0;font-size:10px;line-height:13px;color:var(--m1);white-space:nowrap}
.box-reg:empty{display:none}
.rg-t{min-width:0;overflow:hidden;text-overflow:ellipsis}
.reg-up{flex:0 0 auto;font-size:10px;font-weight:700;line-height:13px;color:var(--best);text-decoration:underline;text-underline-offset:2px;white-space:nowrap}
.reg-up:hover{color:var(--ink)}
/* phones: sizes are never cut. A line too narrow for them goes on to a second one (after a ×), the bookmark and · 印字
   after them, so the row grows instead (4-digit sizes under 375px, a long 印字). The saved values under a changed row
   wrap too (no 「登録 高…」), 「登録を更新」 kept whole */
@media (max-width:980px){
  .box-meta{flex-shrink:1;white-space:normal}
  .box-line{height:auto}
  .box-reg{display:block;white-space:normal}
}
/* phones and touch screens (an iPad on its side too): the three sizes open on a line of their own under the row, 16px and
   34px tall (iOS zooms in on a field under 16px, and three of them do not fit beside the weight); the row grows by that
   line, nothing else on it moves (the name, 重さ, 数量 and × where they were; the empty size line keeps its place).
   Under 「登録 18kg」 when the row has it */
@media (max-width:980px),(pointer:coarse),(hover:none){
  .box-row:has(.box-meta .ev-in){position:relative;padding-bottom:50px}
  .box-row.kgdiff:has(.box-meta .ev-in){padding-bottom:64px}
  .box-line:has(.ev-in){max-width:100%;min-height:16px;margin:0;padding:0}
  .box-meta:has(.ev-in){position:absolute;bottom:10px;display:flex;align-items:center;gap:6px;margin:0;font-size:14px;line-height:34px;color:var(--m1)}
  .box-meta .ev-in.sz{width:calc(var(--n, 4) * 1ch + 20px);min-width:56px;height:34px;padding:0 10px;border-radius:8px;font-size:16px;line-height:34px}
  /* a long weight or 数量 (rows.ts .long; --kc / --qc: its width in digits) whose 16px figures do not fit even without
     kg / 箱 (「12.345」 from 54–64px, 「120,000」 at 70px): the field grows to the left until they show whole */
  .box-row .kgw.long{flex:0 0 auto;width:auto;min-width:var(--kgw)}
  .box-row .kgw.long input{flex:1 0 auto;box-sizing:content-box;width:calc(var(--kc, 0) * 1ch + 1px)}
  .qtw.long{flex:0 0 auto;width:auto;min-width:var(--qtw)}
  .qtw.long .qty{flex:1 0 auto;box-sizing:content-box;width:calc(var(--qc, 0) * 1ch + 1px)}
}
/* 数量: typed in hundreds and thousands, so wide and big (1,200 with its comma when not typing); empty = 入るだけ */
.qtw{position:relative;flex:0 0 var(--qtw);width:var(--qtw);height:38px;display:flex;align-items:center;border:1px solid var(--b-qty);border-radius:9px;background:var(--wh);cursor:text}
.qtw .qty{flex:1 1 0;min-width:0;width:0;height:100%;border:0;border-radius:9px;background:transparent;padding:0 0 0 8px;text-align:right;font-family:var(--f-num);font-size:17px;font-weight:700;line-height:20px;color:var(--ink)}
.qtw .qty::placeholder{font-family:var(--f-body);font-size:13px;font-weight:700;color:var(--best);opacity:1}
.qtw .qty:focus{outline:none}
.qtu{flex:0 0 auto;padding:0 10px 0 4px;font-size:11px;line-height:14px;color:var(--m3)}
.qtw.blank{border-style:dashed;border-color:var(--b-dash)}
.qtw.blank .qty{padding-right:10px}
.qtw.blank .qtu{display:none}
/* six characters or more (12,000): a smaller figure, so it shows whole */
.qtw.long .qty{font-size:14px}
.qtw:focus-within{border:1px solid var(--or);box-shadow:var(--fo)}
.box-x{flex:0 0 var(--xw);width:var(--xw);align-self:stretch;display:flex;align-items:center;justify-content:center;color:var(--b-x)}
.box-x svg{display:block}
.box-x:hover{color:var(--warn)}
.box-x.ghost{visibility:hidden}
/* a row's weight (1箱 kg), typed per row like the quantity; 「登録 18kg」 under it when it is not the registered box's */
.kgw{position:relative;flex:0 0 62px;width:62px;display:flex}
.box-row .kgw{flex-basis:var(--kgw);width:var(--kgw)}
.box-row .kgw input{width:100%;height:38px;border:0;border-radius:9px;background:var(--b-fill);padding:0 22px 0 4px;text-align:right;font-family:var(--f-num);font-size:14px;font-weight:600;line-height:18px;color:var(--m2)}
.box-row .kgw input::placeholder{font-family:var(--f-body);font-size:12px;font-weight:400;color:var(--m3)}
.box-row .kgw input:focus{outline:none;background:var(--wh);box-shadow:inset 0 0 0 2px var(--or),0 0 0 3px rgba(255,95,31,.18)}
.box-row .kgw input[aria-invalid="true"]{color:var(--warn);box-shadow:inset 0 0 0 1.5px var(--warn)}
.kgu{position:absolute;right:7px;top:0;height:38px;display:flex;align-items:center;font-size:11px;line-height:14px;color:var(--m3);pointer-events:none}
.kg-reg{position:absolute;right:0;top:100%;margin-top:2px;font-size:10px;line-height:12px;color:var(--m1);white-space:nowrap;pointer-events:none}
.kg-reg:empty{display:none}
.box-row.kgdiff{padding-bottom:16px}
/* ↑ / ↓ (2 rows or more): small and quiet at the left, over each other, the row's full height (the row's left padding
   goes to them); dimmed at the top / bottom. The moved row lights up for a moment */
.box-ord{flex:0 0 20px;align-self:stretch;display:flex;flex-direction:column;margin:-6px 0 -6px -12px}
.box-row.kgdiff .box-ord{margin-bottom:-16px}
.rows.one .box-ord{display:none}
.ord-b{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center;color:var(--m1);touch-action:manipulation}
.ord-b svg{display:block}
.ord-b:hover{background:var(--pap);color:var(--ink)}
.ord-b[aria-disabled="true"]{background:none;color:var(--off);cursor:default}
.box-ord .ord-b{border-radius:6px;color:var(--b-x)}
.box-ord .ord-b svg{width:10px;height:7px}
.box-ord .ord-b:hover{color:var(--ink)}
.box-ord .ord-b[aria-disabled="true"]{color:#E3E2DD}
.box-row.moved,.ct-row.moved{animation:rowMoved 1.2s ease-out}
/* the ↑ / ↓ area is the drag handle too (rows-drag.ts): the row lifts and follows the pointer, an orange line shows where it
   lands; nothing else moves until it is let go */
.box-ord,[data-row] > .c-o,.box-ord .ord-b,.c-o .ord-b,.box-ord .ord-b[aria-disabled="true"],.c-o .ord-b[aria-disabled="true"]{cursor:grab;touch-action:none}
body.row-drag,body.row-drag *{cursor:grabbing!important;user-select:none;-webkit-user-select:none}
.box-row.lifted,.ct-row.lifted{position:relative;z-index:6;background:var(--wh);box-shadow:0 8px 18px rgba(28,28,26,.2),0 0 0 1px var(--line);animation:none}
.drop-line{position:fixed;z-index:35;height:3px;margin-top:-1.5px;background:var(--or);pointer-events:none}
.drop-line::before{content:"";position:absolute;left:0;top:-3px;width:9px;height:9px;border-radius:50%;background:var(--or)}
@keyframes rowMoved{0%,35%{background:var(--sel)}100%{background:rgba(255,244,238,0)}}
/* ---------- 積荷: 「＋ 段ボールを追加」 turns into the add row (案Z「その場で打つ」, ui/box-add.ts) ---------- */
.rows-empty{padding:10px 16px 4px;font-size:14px;font-weight:700;line-height:20px;color:var(--txt)}
/* 上に重い箱を載せない, box by box (Paper v32 案E; ui/heavy-line.ts): under the rows, a quiet field with its label, the
   boxes marked as pills (colour, name, ×) and 「＋ 選ぶ」 at the right, which lead the first line when the pills wrap;
   with none marked only 「＋ 上に重い箱を載せない箱を選ぶ」, one small line (the column grows as little as it can) */
.nh-line{display:flex;align-items:flex-start;gap:8px;margin:4px var(--rpr) 4px 16px;padding:10px 12px;border-radius:10px;background:var(--b-fill);font-size:12px;line-height:26px}
.nh-k{flex:0 0 auto;color:var(--m2);white-space:nowrap}
.nh-pills{flex:1 1 auto;min-width:0;display:flex;flex-wrap:wrap;gap:6px}
.nh-pill{max-width:100%;display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 6px 0 8px;border:1px solid var(--b-chip);border-radius:999px;background:var(--wh)}
.nh-sw{flex:0 0 auto;display:block;width:10px;height:10px;border-radius:2px}
.nh-n{min-width:0;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nh-x{position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;color:var(--m3)}
.nh-x svg{display:block}
.nh-x::after{content:"";position:absolute;inset:-5px}
.nh-x:hover{background:var(--b-fill);color:var(--ink)}
.nh-pick{position:relative;flex:0 0 auto;margin-left:auto;font-weight:700;color:var(--best);white-space:nowrap}
.nh-pick::after{content:"";position:absolute;inset:-4px -10px}
.nh-pick:hover{text-decoration:underline;text-underline-offset:3px}
.nh-x:focus-visible,.nh-pick:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.nh-line.none{margin-top:6px;padding-block:0;background:none;line-height:16px}
.nh-line.none .nh-k,.nh-line.none .nh-pills{display:none}
.nh-line.none .nh-pick{margin-left:-12px;font-weight:400;color:var(--m1)}
.nh-line.none .nh-pick:hover{color:var(--ink)}
/* its checklist: each box's colour, name and weight with a check */
.ld.nhd{width:300px}
.nh-o{cursor:pointer}
.nh-o input{flex:0 0 auto;width:16px;height:16px;margin:0;accent-color:var(--ink);cursor:pointer}
.nh-o:hover,.nh-o:focus-within{background:var(--sel);box-shadow:inset 4px 0 0 var(--or)}
.nh-o:has(input:checked) .ld-n{font-weight:700}
.add-area{display:flex;flex-direction:column}
.add-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:6px var(--rpr) 12px 16px}
.add-b{flex:1 1 auto;display:flex;align-items:center;justify-content:center;gap:8px;height:40px;padding-inline:16px;background:var(--or);font-size:14px;font-weight:700;line-height:18px;color:var(--ink);white-space:nowrap}
.add-b:hover:not(:disabled){background:#FF7440}
.add-b[aria-expanded="true"]{background:var(--ink);color:var(--wh)}
.add-b:disabled{background:var(--con);color:var(--m3);cursor:default}
/* the column's: secondary, a dashed full-width button */
.cond .add-b{border:1.5px dashed var(--b-dash);border-radius:10px;background:var(--wh)}
.cond .add-b svg{flex:0 0 auto;display:block}
.cond .add-b:hover:not(:disabled){background:var(--b-fill)}
.cond .add-b[aria-expanded="true"]{border-style:solid;border-color:var(--ink);background:var(--ink);color:var(--wh)}
.cond .add-b:disabled{border-color:var(--b-chip);background:var(--wh);color:var(--m3)}
.full-note{flex:1 1 100%;font-size:12px;font-weight:700;line-height:16px;color:var(--m2)}
/* the add row (案Z ①): 名前（なくてもOK） and 長さ × 幅 × 高さ mm, each with its label inside; under it, over the page,
   the saved boxes */
.nb{display:flex;flex-direction:column;gap:6px;margin:6px var(--rpr) 12px 16px;padding:7px;border:1.5px solid var(--ink);border-radius:12px;background:var(--wh)}
.nb-n,.nb-f{display:flex;align-items:center;gap:6px;height:30px;padding:0 9px;border-radius:8px;cursor:text}
.nb-n{background:var(--b-fill)}
/* 名前 is the search of the saved boxes too: a magnifier at its left (the sizes stay plain fields) */
.nb-q{flex:0 0 auto;display:block;color:var(--m1)}
.nb input,.nb-t input{text-overflow:ellipsis}
.nb-k{flex:0 0 auto;font-size:11px;line-height:14px;color:var(--m1);white-space:nowrap}
.nb input{flex:1 1 0;min-width:0;width:0;height:100%;border:0;background:transparent;padding:0;font-size:13px;line-height:16px;color:var(--ink)}
.nb input:focus{outline:none}
.nb input::placeholder{color:var(--m3)}
.nb-n:focus-within{box-shadow:inset 0 0 0 1.5px var(--or)}
.nb-s{display:flex;align-items:center;gap:4px}
.nb-f{flex:1 1 0;min-width:0;border:1px solid var(--b-chip);background:var(--wh);padding:0 8px}
.nb-f input{text-align:right;font-family:var(--f-num);font-size:15px;font-weight:700;line-height:18px}
.nb-f:focus-within{border-color:var(--or);box-shadow:var(--fo)}
.nb-f:has([aria-invalid="true"]){border-color:var(--warn);box-shadow:inset 0 0 0 1px var(--warn)}
.nb-f [aria-invalid="true"]{color:var(--warn)}
.nb-x,.nb-u{flex:0 0 auto;font-size:11px;line-height:14px;color:var(--m3)}
/* 数量あり → … ／ 空欄 → …: PC, in ⓘ 数量の入れ方 (over the column labels), the first lines of its hint (#rowsHowtoIn);
   phones, two lines under the add button (#rowsHowto; ⓘ 説明 in the title opens the rest) */
.howto{display:none;padding:0 16px 14px;font-size:12px;line-height:18px;color:var(--m2)}
.howto > span,.hint-q{display:flex;flex-direction:column}
.howto .hx{white-space:nowrap}
.howto .sep,.hint-q .sep{display:none}
.howto b,.ct-hint b,.hint-q b{font-weight:700;color:var(--txt)}
.ord-n{font-size:12px;line-height:17px;color:var(--m2)}
.cond .ord-n{margin:-4px var(--rpr) 14px 16px}
.tchip.flash{animation:ordFlash 1.6s ease-out}
@keyframes ordFlash{0%,45%{box-shadow:0 0 0 3px var(--or)}100%{box-shadow:0 0 0 3px rgba(255,95,31,0)}}

/* 2 どこに積む？: three tiles (パレット・コンテナ・トラック; the chosen one orange with a check), the models as chips
   (the chosen one ink), the preset's figures in one line with 直す, and 余白・本数, always shown */
.tiles{display:flex;gap:8px;padding:0 var(--rpr) 0 16px}
.tile{position:relative;flex:1 1 0;min-width:0;height:70px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1.5px solid var(--b-line);border-radius:12px;background:var(--wh);font-size:13px;font-weight:700;line-height:16px;color:var(--m2)}
.tile > svg{display:block;color:var(--m1)}
.tile:hover{border-color:var(--b-dash)}
.tile[aria-checked="true"]{border:2px solid var(--or);background:var(--sel);font-weight:700;color:var(--ink)}
.tile[aria-checked="true"] > svg{color:var(--ink)}
.tl-ck{position:absolute;right:6px;top:6px;display:none;width:16px;height:16px;align-items:center;justify-content:center;border-radius:999px;background:var(--or);color:var(--wh)}
.tile[aria-checked="true"] .tl-ck{display:flex}
.chips{display:flex;flex-wrap:wrap;gap:6px;padding:12px var(--rpr) 0 16px}
.chip{flex:0 0 auto;display:flex;align-items:center;gap:6px;height:30px;padding-inline:12px;border:1px solid var(--b-chip);border-radius:999px;background:var(--wh);font-size:13px;line-height:16px;color:var(--ink);white-space:nowrap}
.chip:hover{border-color:var(--b-dash)}
.chip .ch-d{font-family:var(--f-mono);font-size:11px;line-height:14px;color:var(--m3)}
.chip[aria-checked="true"]{border-color:var(--ink);background:var(--ink);font-weight:700;color:var(--wh)}
.chip[aria-checked="true"] .ch-d{color:var(--off)}
.chip.add{border-style:dashed;border-color:var(--b-dash);color:var(--m2)}
.chip.add[aria-checked="true"]{border-style:solid;border-color:var(--ink);color:var(--wh)}
/* trucks: one row per size, its label at the left; 寸法を入力 at the end of the last row */
.chips.rows-t{flex-direction:column;flex-wrap:nowrap}
.ch-row{display:flex;align-items:center;gap:6px;min-width:0}
.ch-l{flex:0 0 30px;width:30px;font-family:var(--f-num);font-size:12px;font-weight:700;line-height:14px;color:var(--m3)}
.rows-t .chip{height:28px;padding-inline:11px;font-size:12.5px}
.rows-t .chip.add{margin-left:auto}
/* the preset in one line (read-only) and 直す; the fields it opens; a disclosure (運賃も出す) with its summary */
.sp-box,.pl-box{display:flex;flex-direction:column;gap:6px;padding:10px var(--rpr) 12px 16px}
.pl-box{gap:10px}
.spec{display:flex;align-items:center;gap:10px;min-height:33px;padding:8px 12px;border-radius:10px;background:var(--b-fill)}
.spec-t{flex:1 1 0;min-width:0;font-family:var(--f-mono);font-size:12px;line-height:17px;color:var(--ink);overflow-wrap:anywhere}
.spec-b{position:relative;flex:0 0 auto;font-size:12.5px;font-weight:700;line-height:16px;color:var(--best)}
/* 直す and the disclosure below: a target at least 32px tall (and 直す wider) around the words, nothing moves */
.spec-b::after{content:"";position:absolute;inset:-8px -10px}
.spec-b:hover{text-decoration:underline;text-underline-offset:3px}
.dsc{position:relative;display:flex;align-items:center;gap:6px;min-height:26px;padding-inline:2px;font-size:12.5px;line-height:16px;color:var(--m2);text-align:left}
.dsc::after{content:"";position:absolute;inset:-3px 0}
.dsc svg{flex:0 0 auto;display:block;transition:transform .15s}
.dsc[aria-expanded="true"] svg{transform:rotate(90deg)}
.dsc:hover > span:first-of-type{text-decoration:underline;text-underline-offset:3px}
.dsc-s{flex:1 1 0;min-width:0;font-size:12px;line-height:16px;color:var(--m3);text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 余白・本数, always shown under the preset's line: 上部の空き and 使える本数 / 台数 in one row, 壁との余白 (four small fields)
   in the next; labels muted, fields 30px, numbers to the right */
.mg-box{display:flex;flex-direction:column;gap:6px;margin-top:2px}
.mg-r{display:flex;align-items:center;gap:8px;min-width:0}
.mgf{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:6px;cursor:text}
.mgf-k{flex:0 0 auto;display:flex;flex-direction:column;font-size:12px;line-height:15px;color:var(--m1);white-space:nowrap}
.mgf-k small{font-size:10px;line-height:12px;color:var(--m3)}
.mgf-in{flex:1 1 0;min-width:0;height:30px;display:flex;align-items:center;border:1px solid var(--b-chip);border-radius:8px;background:var(--wh)}
.mgf-in input{flex:1 1 0;min-width:0;width:0;height:100%;border:0;border-radius:8px;background:transparent;padding:0 0 0 8px;text-align:right;font-family:var(--f-mono);font-size:13px;line-height:16px;font-variant-numeric:tabular-nums;color:var(--txt)}
.mgf-in input::placeholder{font-family:var(--f-body);font-size:12px;color:var(--m3)}
.mgf-in input:focus{outline:none}
.mgf-in .u{flex:0 0 auto;margin:0 8px 0 4px;font-size:11px;line-height:14px;color:var(--m1)}
.mgf-in input:placeholder-shown + .u{color:var(--m3)}
.mgf-in:focus-within{border-color:var(--or);box-shadow:var(--fo)}
.mg-r .pv.mg4{flex:1 1 0;gap:5px}
.mg-r .pv.mg4 label{height:34px;padding:0 6px}
/* a pallet as the 置き場所: 積み付け高さ and 最大積載重量 as two big fields */
.big2{display:flex;gap:8px}
.big{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:5px}
.big-k{display:flex;align-items:baseline;gap:6px;font-size:12.5px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap}
.big-k small{font-size:11px;font-weight:400;line-height:14px;color:var(--m3)}
.big-in{height:40px;display:flex;align-items:center;gap:6px;padding-inline:12px;border:1px solid var(--b-chip);border-radius:10px;background:var(--wh);cursor:text}
.big-in input{flex:1 1 0;min-width:0;width:0;height:100%;border:0;background:transparent;padding:0;text-align:right;font-family:var(--f-num);font-size:17px;font-weight:700;line-height:20px;color:var(--ink)}
.big-in input::placeholder{font-family:var(--f-body);font-size:13px;font-weight:400;color:var(--m3)}
.big-in input:focus{outline:none}
.big-in .u{flex:0 0 auto;font-size:12px;line-height:16px;color:var(--m1)}
.big-in:focus-within{border-color:var(--or);box-shadow:var(--fo)}

/* the fields behind 直す and the disclosures: a pale panel of label ｜ fields rows (the ids and rows as before) */
.fields{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border-radius:10px;background:var(--b-fill)}
.cond > .sec > .sec-body > .fields{margin:0 var(--rpr) 14px 16px}
.prop{flex:0 0 auto;display:flex;align-items:center;gap:8px;min-height:32px}
.pk{flex:0 0 86px;width:86px;display:flex;flex-direction:column;justify-content:center;font-size:12.5px;line-height:15px;color:var(--m2);white-space:nowrap}
.pk small{display:block;font-size:10.5px;line-height:13px;color:var(--m3)}
.pv{flex:1 1 0;min-width:0;display:flex;align-items:stretch;gap:6px;position:relative}
.pv input,.pv select{display:block;min-width:0;height:32px;border:1px solid var(--b-chip);border-radius:8px;background:var(--wh);color:var(--txt)}
.pv input:focus,.pv select:focus{outline:none;border-color:var(--or);box-shadow:var(--fo)}
.pv input[type="number"]{font-family:var(--f-mono);font-size:14px;line-height:18px;font-variant-numeric:tabular-nums;text-align:right}
.pv input::placeholder{font-family:var(--f-body);font-size:12px;color:var(--m3)}
.pv.in{height:32px;align-items:center;border:1px solid var(--b-chip);border-radius:8px;background:var(--wh);cursor:text}
.pv.in input{flex:1 1 0;width:0;height:100%;border:0;border-radius:8px;background:transparent;padding:0 0 0 10px}
.pv.in input:focus{box-shadow:none}
.pv.in .u{flex:0 0 auto;width:22px;margin:0 10px 0 4px;font-size:12px;line-height:16px;color:var(--m1)}
.pv.in input:placeholder-shown + .u{color:var(--m3)}
.pv.in:focus-within{border-color:var(--or);box-shadow:var(--fo)}
.pv.tri3 input{flex:1 1 0;width:0;padding:0 8px}
.pv.mg4 label{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;height:40px;padding:0 7px;border:1px solid var(--b-chip);border-radius:8px;background:var(--wh);cursor:text}
.pv.mg4 label > span{font-size:10px;line-height:12px;color:var(--m3);white-space:nowrap}
.pv.mg4 input{width:100%;height:18px;padding:0;border:0;border-radius:0;background:transparent}
.pv.mg4 input:focus{box-shadow:none}
.pv.mg4 label:focus-within{border-color:var(--or);box-shadow:var(--fo)}
.pv.mg4 input[aria-invalid="true"]{color:var(--warn)}
.pv.mg4 label:has(input[aria-invalid="true"]){border-color:var(--warn)}
.prop.tall .pk{line-height:15px}

/* 3 どう積む？: two radio cards (直積み ／ パレット積み; the chosen one orange), パレット積み's panel under them, the
   conditions as toggle chips (on = ink with a white check) and 最大段数 as − / ＋ */
.cards{display:flex;gap:8px;padding:0 var(--rpr) 0 16px}
.card{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:10px;padding:10px 12px;border:1.5px solid var(--b-line);border-radius:12px;background:var(--wh);text-align:left}
.card:hover{border-color:var(--b-dash)}
.rd{flex:0 0 16px;width:16px;height:16px;display:flex;align-items:center;justify-content:center;border:2px solid var(--b-dash);border-radius:999px;background:var(--wh)}
.cd-t{min-width:0;display:flex;flex-direction:column;gap:1px}
.cd-t b{font-size:13.5px;font-weight:700;line-height:17px;color:var(--ink);white-space:nowrap}
.cd-t small{font-size:11.5px;line-height:15px;color:var(--m1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card[aria-checked="true"]{padding:9.5px 11.5px;border:2px solid var(--or);background:var(--sel)}
.card[aria-checked="true"] .rd{border-color:var(--or)}
.card[aria-checked="true"] .rd::after{content:"";width:8px;height:8px;border-radius:999px;background:var(--or)}
.card[aria-checked="true"] .cd-t b{font-weight:700}
.pl-panel{display:flex;flex-direction:column;gap:10px;margin:8px var(--rpr) 0 16px;padding:12px;border-radius:12px;background:var(--b-fill)}
.pl-panel .chips{padding:0}
.pchips .chip{height:28px;gap:5px;padding-inline:11px;font-size:12.5px}
.pchips .chip .ch-d{display:none;font-size:10.5px}
.pchips .chip[aria-checked="true"] .ch-d{display:inline}
.pchips .chip .ch-long{display:none}
.chip .ch-short{display:none}
.pchips .chip .ch-short{display:inline}
.pl-panel .spec{background:var(--wh)}
.pl-panel .fields{padding:0;background:none}
.pl2{display:flex;gap:8px}
.fld{flex:1 1 0;min-width:0;height:36px;display:flex;align-items:center;gap:6px;padding-inline:12px;border:1px solid var(--b-chip);border-radius:9px;background:var(--wh);position:relative;cursor:text}
.fld-k{flex:0 0 auto;font-size:12px;line-height:16px;color:var(--m1);white-space:nowrap;cursor:inherit}
.fld-in{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:4px}
.fld-in input{flex:1 1 0;min-width:0;width:0;height:34px;border:0;background:transparent;padding:0;text-align:right;font-family:var(--f-num);font-size:15px;font-weight:700;line-height:18px;color:var(--ink)}
.fld-in input:focus{outline:none}
.fld-in .u{flex:0 0 auto;font-size:11px;line-height:14px;color:var(--m1)}
.fld:focus-within{border-color:var(--or);box-shadow:var(--fo)}
.fld.sel{padding:0;cursor:pointer}
.fld.sel .fld-k{position:absolute;left:12px;top:0;height:100%;display:flex;align-items:center;pointer-events:none}
.fld.sel select{width:100%;height:100%;-webkit-appearance:none;appearance:none;border:0;border-radius:9px;background:transparent;padding:0 28px 0 60px;text-align:right;text-align-last:right;font-size:13px;font-weight:700;line-height:16px;color:var(--ink);cursor:pointer}
.fld.sel select:focus{outline:none}
.fld.sel::after,.plo-s::after{content:"";position:absolute;right:12px;top:50%;width:6px;height:6px;margin-top:-5px;border-right:1.6px solid var(--m1);border-bottom:1.6px solid var(--m1);transform:rotate(45deg);pointer-events:none}
.plo{display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px;color:var(--m1)}
.plo-s{position:relative;display:flex}
.plo select{height:28px;-webkit-appearance:none;appearance:none;border:1px solid var(--b-chip);border-radius:999px;background:var(--wh);padding:0 28px 0 12px;font-size:12.5px;line-height:16px;color:var(--ink);cursor:pointer}
.plo select:focus{outline:none;border-color:var(--or);box-shadow:var(--fo)}
.plo-s::after{right:11px;width:5px;height:5px;margin-top:-4px}
.tchips{display:flex;flex-wrap:wrap;gap:6px;padding:12px var(--rpr) 12px 16px}
.tchip{flex:0 0 auto;display:flex;align-items:center;gap:6px;height:30px;padding-inline:12px;border:1px solid var(--b-chip);border-radius:999px;background:var(--wh);font-size:13px;line-height:16px;color:var(--ink);white-space:nowrap}
.tchip:hover{border-color:var(--b-dash)}
.tchip .tc-ck{display:none;flex:0 0 auto}
.tchip[aria-pressed="true"]{padding-left:10px;border-color:var(--ink);background:var(--ink);font-weight:700;color:var(--wh)}
.tchip[aria-pressed="true"] .tc-ck{display:block}
/* 重い箱を上に載せない while 別サイズに重ねない is on: shown, greyed (its tick kept) */
.tchip:disabled,.tchip:disabled:hover,.tchip[aria-pressed="true"]:disabled{border-color:var(--b-chip);background:var(--wh);font-weight:400;color:var(--m3);cursor:default}
.tchips + .stp,.tchips + .cross-n[hidden] + .stp,.tchips + .cross-n[hidden] + .cross-n[hidden] + .stp,.tchips + .cross-n[hidden] + .cross-n[hidden] + .ocands[hidden] + .cross-n[hidden] + .stp{margin-top:-4px}
/* under the chips: 交差積み's note (crossNote, ui/load-step.ts) */
.cross-n{margin:-4px var(--rpr) 8px 16px;font-size:12px;line-height:17px;color:var(--m2)}
/* 積み方の候補 (orderCands, ui/load-step.ts): up to 3 buttons sharing one row, the names (wrapping) over the numbers;
   表示中 the plan on screen */
.ocands{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px;margin:-4px var(--rpr) 8px 16px}
.ocand{min-width:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:1px;padding:5px 6px;border:1px solid var(--b-chip);border-radius:8px;background:var(--wh);font-size:12px;line-height:15px;color:var(--ink);text-align:left}
.ocand:hover{border-color:var(--b-dash)}
.ocand[aria-current="true"]{box-shadow:inset 0 0 0 1px var(--ink);border-color:var(--ink);cursor:default}
.oc-h{max-width:100%;overflow-wrap:anywhere}
.oc-h b{margin-right:5px}
.oc-on{color:var(--m2);white-space:nowrap}
.ocand:not([aria-current="true"]) .oc-on{display:none}
.oc-v{max-width:100%;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
/* 最大段数: − value ＋ in one rounded box (blank = 制限なし, muted); the buttons 34px wide, the value typeable */
.stp{display:flex;align-items:center;gap:10px;padding:0 var(--rpr) 12px 16px}
.stp-k{flex:0 0 auto;font-size:12px;line-height:16px;color:var(--m1)}
.stp-c{flex:0 0 auto;display:flex;align-items:stretch;height:32px;border:1px solid var(--b-chip);border-radius:999px;background:var(--wh)}
.stp-b{flex:0 0 34px;width:34px;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;line-height:1;color:var(--ink)}
.stp-b:first-child{border-radius:999px 0 0 999px}
.stp-b:last-child{border-radius:0 999px 999px 0}
.stp-b:hover:not(:disabled){background:var(--b-fill)}
.stp-b:disabled{color:var(--off);cursor:default}
.stp-b:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.stp-in{display:flex;align-items:center;gap:2px;min-width:72px;padding-inline:4px;border-inline:1px solid var(--b-chip);cursor:text}
.stp-in input{flex:1 1 0;min-width:0;width:40px;height:100%;border:0;background:transparent;padding:0;text-align:right;font-family:var(--f-num);font-size:14px;font-weight:700;line-height:18px;color:var(--ink)}
.stp-in input::placeholder{font-family:var(--f-body);font-size:12px;font-weight:400;color:var(--m3);text-align:center}
.stp-in input:focus{outline:none}
.stp-in .u{flex:0 0 auto;font-size:11px;line-height:14px;color:var(--m1)}
.stp-in input:placeholder-shown + .u{display:none}
.stp-c:has(input:focus){border-color:var(--or);box-shadow:var(--fo)}
/* the keyboard's place on the rounded controls: an ink ring just outside (orange is their 選択中) */
.tile:focus-visible,.chip:focus-visible,.card:focus-visible,.tchip:focus-visible,.cond .add-b:focus-visible{outline:2px solid var(--ink);outline-offset:2px}

/* a pallet as the 置き場所, behind 運賃も出す: 換算方式 (chips, wrapping onto a 2nd line rather than shrinking; 割る数を入力
   turns into its field when chosen), 運賃単価 with 円/kg ｜ 円/才, and the pallet on show worked out under them */
.vw-pane{display:flex;flex-direction:column;gap:6px;padding:8px 10px;border-radius:10px;background:var(--b-fill)}
.vw-r{align-items:flex-start}
.vw-r .pk{min-height:30px}
.vw-how{flex-wrap:wrap;gap:6px}
.vw-how .chip{height:30px;padding-inline:11px;font-size:12.5px}
.vw-how .chip:disabled{border-color:var(--con);background:transparent;font-weight:400;color:var(--off);cursor:default}
.vw-div{gap:2px;padding:0 4px 0 11px;border-color:var(--ink);cursor:text}
.pv .vw-div input{width:72px;height:100%;border:0;border-radius:999px;background:transparent;padding:0 8px 0 4px;font-size:13px;font-weight:700;color:var(--ink)}
.pv .vw-div input:focus{box-shadow:none}
.vw-div:focus-within{border-color:var(--or);box-shadow:var(--fo)}
.vw-div:has(input[aria-invalid="true"]),.vw-in:has(input[aria-invalid="true"]){border-color:var(--warn)}
.vw-div input[aria-invalid="true"],.vw-in input[aria-invalid="true"]{color:var(--warn)}
.vw-in{flex:1 1 0;min-width:0;display:flex;height:32px;border:1px solid var(--b-chip);border-radius:8px;background:var(--wh);cursor:text}
.pv .vw-in input{flex:1 1 0;width:0;height:100%;border:0;border-radius:8px;background:transparent;padding:0 10px;font-weight:700;color:var(--ink)}
.pv .vw-in input:focus{box-shadow:none}
.vw-in:focus-within{border-color:var(--or);box-shadow:var(--fo)}
.vw-seg{flex:0 0 auto;display:flex;gap:2px;padding:2px;border-radius:9px;background:var(--con)}
.vw-seg button{min-width:50px;padding-inline:8px;border-radius:7px;font-size:12.5px;line-height:16px;color:var(--m1);white-space:nowrap}
.vw-seg button[aria-checked="true"]{background:var(--wh);font-weight:700;color:var(--ink);box-shadow:0 1px 2px rgba(28,28,26,.12)}
.vw-seg button:focus-visible{outline:2px solid var(--ink);outline-offset:1px}
.vw{flex:0 0 auto;padding:4px 16px 5px;background:var(--pap);border-bottom:1px solid var(--line);font-size:12px;line-height:16px;color:var(--txt)}
.vw-pane .vw{padding:2px 2px 0;background:none;border:0}
.vw:empty{display:none}
.vw-c{font-size:11px;line-height:15px;color:var(--m1)}
.vw-l{display:grid;grid-template-columns:auto minmax(0,1fr);gap:0 10px;margin:1px 0 0}
.vw-l dt{color:var(--m2);white-space:nowrap}
.vw-l dd{min-width:0;margin:0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.vw-l b{font-weight:700;white-space:nowrap}
.vw-l small{display:inline-block;margin-left:8px;font-size:11px;color:var(--m1)}
.vw-l dd.off{color:var(--m3)}
.vw-l small.uw{color:var(--warn);font-weight:700;cursor:help}
.vw-l dd:last-of-type b{font-size:14px}
/* several pallets: the total of each pallet's 運賃重量 and 運賃 */
.vw-t{overflow-wrap:anywhere}
.vw-t > span{margin-right:4px;font-weight:700;color:var(--ink)}
.vw-t b{font-weight:700;white-space:nowrap}
/* phones on their side, and wherever 置き場所 has no room for the block (fitFreight: .one): one line (運賃, or 運賃重量
   without a 単価; the total when there are several pallets) that opens 詳しく */
#vwBox.one > .vw-c,#vwBox.one > .vw-l,#vwBox.one > .vw-t{display:none}
#vwBox.one > .vw-s{display:flex}
#vwBox.one{padding-top:2px;padding-bottom:2px;line-height:15px}
.vw-s{display:none;width:100%;align-items:center;gap:10px;font-size:12px;line-height:inherit;text-align:left;color:var(--txt)}
.vw-sv{flex:1 1 0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vw-sv > span{margin-right:2px;font-weight:700;color:var(--m2)}
.vw-more{flex:0 0 auto;font-weight:700;color:var(--ink);text-decoration:underline;text-underline-offset:3px}
/* the same in 詳しく: phones only (on PC it is in 置き場所, in view) */
.vw-msg{display:none}
/* PC, when 置き場所 does not show the block (運賃も出す closed, or one line): the block in 詳しく, under the sentence */
.app.vw-one .msg-detail .vw-msg:not(:empty){display:block;margin-top:6px;padding:5px 10px 6px;border:1px solid var(--line);background:var(--pap)}
/* 計算は目安です…: PC, one line at the foot of the right column, under the 3D view (layout 左) or 積荷リスト (下); it takes
   its height from the 3D view, never covers it, and the left column has its room. Phones: in ⋯ (.mm-note), as before */
.disc{flex:0 0 auto;border-top:1px solid var(--line);padding:4px 16px;background:var(--wh);font-size:12px;line-height:16px;color:var(--m1)}
/* PC: the left column where it would still scroll with 3 folded (fitCond, ui/steps.ts: .tight, before 2 or 1 fold,
   and kept only where the column still needs it after a fold). The same text with less room around it. With a mouse the rows, the add
   button and the tiles get lower too; a touch screen this wide (an iPad on its side: pointer coarse) keeps them at
   their size to tap */
@media (min-width:981px){
  .cond.tight .sec-tog{padding-top:10px;padding-bottom:6px}
  .cond.tight .sec[data-open="false"] .sec-tog{min-height:42px;padding-block:10px}
  .cond.tight .sec-head > .sec-info{top:10px}
  .cond.tight .add-row{padding-bottom:10px}
  .cond.tight .nb{margin-bottom:10px}
  .cond.tight .chips{padding-top:8px}
  .cond.tight .sp-box,.cond.tight .pl-box{padding-top:8px;padding-bottom:10px}
  .cond.tight .tchips{padding-top:8px;padding-bottom:10px}
}
@media (min-width:981px) and (pointer:fine){
  .cond.tight .box-row{min-height:44px;padding-block:3px}
  .cond.tight .box-ord{margin-block:-3px}
  .cond.tight .box-row.kgdiff{padding-bottom:16px}
  .cond.tight .box-row.kgdiff .box-ord{margin-bottom:-16px}
  .cond.tight .add-b{height:34px}
  .cond.tight .nh-line:not(.none){padding-block:6px}
  .cond.tight .tile{height:58px;gap:3px}
}
.mtitle{display:none}

/* ---------- summary band ---------- */
.sum{flex:0 0 auto;display:flex;height:64px;background:var(--wh);border-bottom:2px solid var(--ink)}
.sc{flex:0 0 150px;width:150px;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:2px;padding-inline:16px;border-right:1px solid var(--line)}
.sc.need{flex-basis:330px;width:330px;flex-direction:row;align-items:center;gap:12px;padding-right:12px}
.sc-in{flex:1 1 0;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:2px}
.sc.m{flex:1 1 0;width:auto}
.sc:last-child{border-right:0}
.sl{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;line-height:16px;color:var(--m1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sl .vt{flex:0 0 auto;font-size:10px;font-weight:700;line-height:14px;padding:0 4px;background:var(--warn);color:var(--wh)}
.sv{font-family:var(--f-num);font-size:22px;font-weight:700;line-height:26px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.sv.tight{font-size:18px;letter-spacing:-.01em}
/* v30 案B: a value is its number (at .sv's size) and, on its baseline, the words around it (results.ts setVal): the unit
   (箱・台・t …; its space in front is the gap), %, the payload after the weight, × and the vehicle's name. Sized against a
   22px number (unit 16px) and scaled with it where the number is smaller (.tight, a narrow band) */
.sv .u{font-size:max(12px,calc(16em / 22));font-weight:700;color:var(--m2)}
.sv .u.pc{margin-left:1px;font-size:max(12px,calc(17em / 22))}
.sv .lim{font-size:max(12px,calc(16em / 22));font-weight:600;color:var(--m1)}
.sv .x{font-size:max(12px,calc(15em / 22));font-weight:500;color:var(--m1)}
.sv .nm{font-size:max(13px,calc(18em / 22));font-weight:700;color:var(--ink)}
.meter{flex:0 0 auto;display:flex;height:6px;background:var(--line);overflow:hidden}
.meter i{display:block;width:0;background:var(--ink)}
.meter.or i{background:var(--or)}
.meter i[data-hot="true"]{background:var(--warn)}
.cmp-btn{flex:0 0 auto;display:flex;align-items:center;gap:6px;height:32px;padding-inline:10px;border:2px solid var(--ink);font-size:12px;font-weight:700;line-height:16px;color:var(--txt);white-space:nowrap}
.cmp-btn:hover{background:var(--pap)}
.cmp-btn[aria-expanded="true"]{background:var(--ink);color:var(--wh)}
.sum-sp{display:none}

/* ---------- result line: limit tag, arrangement, errors (details open in place) ---------- */
.msg{flex:0 0 auto;display:flex;flex-direction:column;background:var(--pap);border-bottom:1px solid var(--line)}
.msg-line{display:flex;align-items:center;gap:10px;min-height:32px;padding:7px 16px}
.tag{flex:0 0 auto;padding:0 6px;border:1px solid var(--ink);background:var(--wh);font-size:11px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap}
.tag:empty{display:none}
.tag[data-k="weight"]{border-color:var(--warn);color:var(--warn)}
.tag[data-k="stack"]{border-color:var(--m2);color:var(--m2)}
.tag[data-k="over"],.tag[data-k="err"]{border-color:var(--warn);background:var(--warn);color:var(--wh)}
.msg-t{flex:1 1 0;min-width:0;font-size:12px;line-height:18px;color:var(--m2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg-more{flex:0 0 auto;font-size:12px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap}
.msg-more:hover{text-decoration:underline;text-underline-offset:3px}
/* the plan's total before 詳しく (ui/totals.ts): never cut, the sentence gives way (…); its lines open in 詳しく */
.msg-tot{flex:0 0 auto;display:flex;align-items:baseline;gap:6px;padding-left:12px;border-left:1px solid var(--line);font-size:12px;line-height:18px;color:var(--m1);white-space:nowrap}
.msg-tot[hidden]{display:none}
.msg-tot b{font-family:var(--f-num);font-size:13px;font-weight:700;line-height:16px;color:var(--ink);font-variant-numeric:tabular-nums}
.msg-tot .r{margin-left:-4px}
.msg-tl p + p{margin-top:0}
.msg-tl:not([hidden]) + table{margin-top:6px}
.mix tr.tot td{font-weight:700;border-bottom:1px solid var(--ink)}
/* 重心 of the pallet on show (a pallet as the 置き場所: ui/freight.ts cogOf), under the table in 詳しく */
.msg-cog{margin-top:6px;color:var(--ink)}
.msg-cog b{font-weight:700}
.msg-err{padding:6px 16px 7px 12px;border-top:1px solid var(--line);border-left:4px solid var(--warn);background:var(--wh);font-size:12px;font-weight:700;line-height:18px;color:var(--warn)}
.msg-err p + p{margin-top:2px}
.msg-detail{max-height:40vh;overflow:auto;padding:0 16px 10px;font-size:12px;line-height:18px;color:var(--m2)}
.msg-detail p + p,.msg-detail p + table{margin-top:6px}
.msg.open .msg-t{white-space:normal}
.msg-sh{display:none}
table.mix{border-collapse:collapse;font-size:12px;line-height:16px;color:var(--txt);background:var(--wh);min-width:min(100%,520px)}
.mix th{text-align:left;font-weight:400;font-size:11px;color:var(--m1);padding:4px 8px;border-bottom:1px solid var(--ink);white-space:nowrap}
.mix td{padding:5px 8px;border-bottom:1px solid var(--line);white-space:nowrap}
.mix .num{text-align:right;font-family:var(--f-mono);font-variant-numeric:tabular-nums}
.mix td:first-child,.mix th:first-child{width:22px;padding-right:0}
.sw{display:inline-block;width:10px;height:10px;vertical-align:-1px;flex:0 0 auto}

/* ---------- 3D view and its bar ---------- */
.viewport{flex:1 1 0;min-height:0;display:flex;flex-direction:column;position:relative}
.vbar{flex:0 0 auto;display:flex;height:38px;background:var(--wh);border-bottom:1px solid var(--ink);position:relative;z-index:4}
.hs{flex:0 0 auto;display:flex}
.hs-a{flex:0 0 36px;width:36px;display:flex;align-items:center;justify-content:center;border-right:1px solid var(--line);font-size:16px;line-height:20px;color:var(--ink)}
.hs-a:hover:not(:disabled){background:var(--pap)}
.hs-a:disabled{color:var(--off)}
/* which hold: a fixed width sized for the longest case (「500か所目 / 1,000か所 10,000箱」: 500 holds listed at most, and
   1,000 holds of a 5-digit count is the most 1e7 boxes give), so it does not jump when you
   step through. The count never shrinks while it has 5 digits or fewer: the hold part gives way first (「/ 143か所」, then
   the hold number), and only a count longer than that is cut (…, the full text in the title). */
.hs-mid{flex:0 0 252px;width:252px;display:flex;align-items:center;gap:8px;padding-inline:12px;background:var(--ink);color:var(--wh);overflow:hidden;white-space:nowrap;text-align:left}
.hs-n{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:13px;font-weight:700;line-height:16px;font-variant-numeric:tabular-nums}
.hs-of{flex:0 1000 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:500;line-height:16px;color:var(--dk-mut)}
.hs-of .hs-sh{display:none}
.hs-c{flex:0 0 auto;max-width:96px;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:700;line-height:16px;color:var(--or);font-variant-numeric:tabular-nums}
.hs-c .u{margin-left:2px;font-size:min(12px,1em)}
.hs-c.v{color:#FF8A8F}
.hs-mid .hs-dd{margin-left:auto;color:#F2F1ED}
.hs-mid[aria-expanded="true"] .hs-dd{transform:rotate(180deg)}
.hs-list{position:absolute;left:36px;top:37px;z-index:6;width:330px;display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:var(--sh)}
.hs-items{max-height:min(360px,60vh);overflow-y:auto;overscroll-behavior:contain}
.hs-item{flex:0 0 auto;display:flex;align-items:center;gap:10px;width:100%;height:36px;padding:0 12px;border-bottom:1px solid var(--con);font-size:13px;line-height:16px;text-align:left;white-space:nowrap}
.hs-item:hover{background:var(--pap)}
.hs-item[aria-selected="true"]{background:var(--sel);box-shadow:inset 4px 0 0 var(--or);font-weight:700}
.hs-item b{flex:0 0 auto;min-width:64px}
.hs-item .same{flex:0 0 auto;font-size:10px;font-weight:700;line-height:14px;padding:0 4px;border:1px solid var(--m3);color:var(--m2)}
.hs-item .c{flex:1 1 0;font-size:12px;font-weight:400;color:var(--txt);font-variant-numeric:tabular-nums}
.hs-item .u{font-size:12px;font-weight:400;color:var(--m1);font-variant-numeric:tabular-nums}
.hs-item .vt{font-size:10px;font-weight:700;line-height:14px;padding:0 4px;background:var(--warn);color:var(--wh)}
.hs-more{padding:8px 12px;font-size:11px;line-height:16px;color:var(--m1)}
.vseg{display:flex}
.vseg button,.vb{display:flex;align-items:center;gap:6px;padding-inline:12px;border-left:1px solid var(--line);font-size:13px;font-weight:500;line-height:16px;color:var(--txt);white-space:nowrap}
.vseg button:hover,.vb:hover{background:var(--pap)}
.vseg button[aria-pressed="true"]{background:var(--con);font-weight:700}
#planBtn[aria-expanded="true"]{background:var(--or);font-weight:700}
.vb.dimt{border-left-color:var(--ink)}
.ckv{flex:0 0 auto;width:16px;height:16px;border:2px solid var(--ink);background:var(--wh)}
[aria-pressed="true"] > .ckv{border-color:var(--or);background:var(--or) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.7 5.3 4.1 7.6 8.4 2.7' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='square'/%3E%3C/svg%3E") center/12px 12px no-repeat}
.scene{flex:1 1 0;min-height:0;position:relative;background:var(--scene);overflow:hidden}
.scene canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
.labels{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:1}
.dim{position:absolute;left:0;top:0;padding:1px 6px;background:var(--wh);border:1px solid var(--line);font-family:var(--f-mono);font-size:11.5px;line-height:16px;color:var(--ink);white-space:nowrap}
.hold-tag{pointer-events:auto;cursor:pointer;font-family:var(--f-body);font-size:12px;font-weight:700;border-color:var(--ink)}
.hold-tag.is-v{color:var(--warn);border-color:var(--warn)}
.hold-tag.is-cur{background:var(--or);color:var(--ink);border-color:var(--ink)}
.hold-tag.is-v.is-cur{background:var(--warn);color:var(--wh);border-color:var(--warn)}
.layer{position:absolute;left:12px;bottom:12px;z-index:2;display:flex;align-items:center;gap:12px;padding:8px 12px;background:var(--wh);border:2px solid var(--ink)}
.layer label{font-size:13px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap}
.layer input[type="range"]{-webkit-appearance:none;appearance:none;width:180px;height:18px;margin:0;background:transparent;cursor:pointer}
.layer input[type="range"]::-webkit-slider-runnable-track{height:4px;background:var(--ink)}
.layer input[type="range"]::-moz-range-track{height:4px;background:var(--ink)}
.layer input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:12px;height:18px;margin-top:-7px;background:var(--ink);border:0;border-radius:0}
.layer input[type="range"]::-moz-range-thumb{width:12px;height:18px;background:var(--ink);border:0;border-radius:0}
.layer input[type="range"]:focus-visible{outline:2px solid var(--or);outline-offset:2px}
.layer input[type="range"]:disabled{opacity:.35;cursor:default}
.layer output{flex:0 0 56px;width:56px;text-align:right;font-family:var(--f-mono);font-size:13px;line-height:16px;color:var(--ink);white-space:nowrap}
.notes{position:absolute;right:12px;bottom:12px;z-index:2;display:flex;flex-direction:column;align-items:flex-end;gap:6px;max-width:calc(100% - 420px);pointer-events:none}
.note{display:block;padding:4px 10px;background:var(--wh);border:2px solid var(--ink);font-size:12px;font-weight:700;line-height:16px;color:var(--ink);text-align:left;pointer-events:auto}
.note.warn{border-color:var(--warn);color:var(--warn)}
.msg-chip{display:none}
/* the 3D view could not start, stopped, or could not be built (or three.js did not load): said in the middle of the 3D area */
/* 箱を動かす (render/move-box.ts): while the mode is on, its hint and buttons in the 3D view's top left (its own button
   is in the view pad, .vp-go) */
.mv-panel{position:absolute;left:12px;top:12px;z-index:3;display:flex;flex-direction:column;gap:6px;max-width:calc(100% - 24px);padding:8px 10px;background:var(--wh);border:2px solid var(--ink)}
/* 箱を動かす's hint (move-box.ts tip): the other hints' look (.qh), within the 3D view, its arrow at the button */
.qh.mv-tip{position:absolute;width:max-content;max-width:min(280px,calc(100% - 24px))}
.mv-tip:not(.up)::before{display:none}
.mv-tip.up::before{right:8px}
.mv-t{margin:0;font-size:12px;font-weight:700;line-height:16px;color:var(--ink)}
.mv-t.bad{color:var(--warn)}
.mv-b{display:flex;flex-wrap:wrap;gap:6px}
.mv-b button{height:28px;padding-inline:10px;border:1px solid var(--ink);background:var(--wh);font-size:12px;line-height:16px;color:var(--ink);white-space:nowrap}
.mv-b button:hover:not(:disabled){background:var(--pap)}
.mv-b button:disabled{opacity:.35;cursor:default}
#moveEnd{background:var(--or);border-color:var(--or)}
.mv-b kbd{font-family:var(--f-mono);font-size:11px;color:var(--m2)}
.scene.moving.hov-ok canvas{cursor:grab}
.scene.moving.hov-no canvas{cursor:not-allowed}
.scene.dragging canvas{cursor:grabbing}
.vp-msg{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:4;width:min(440px,calc(100% - 32px));padding:12px 16px;background:var(--wh);border:2px solid var(--ink);box-shadow:var(--sh);font-size:13px;line-height:20px;color:var(--txt);text-align:center}
/* the view pad (render/view-pad.ts): ← → ↑ ↓ ◎ and ＋ −, light over the cargo in the bottom-right corner. Only for a mouse on
   the PC layout (phones and tablets use two fingers), while the 3D view draws (.off3d: state.ts) and has room for it
   (data-pad: m, or s on a short 3D view); the notes then stand above it, and 配置図 stops 16 px above it (its body
   scrolls; view-pad.ts PLAN_ROOM) or, on a 3D view too short for that (data-pad-tight), the pad gives way while 配置図
   is open */
.vpad{position:absolute;right:12px;bottom:12px;z-index:2;display:none;align-items:flex-end;gap:4px;-webkit-user-select:none;user-select:none}
.vp-mv{display:grid;grid-template-columns:repeat(3,26px);grid-template-rows:repeat(3,26px)}
.vp-z{display:flex;flex-direction:column}
.vp-mv,.vp-z,.vp-go{background:rgba(255,255,255,.55);border:1px solid rgba(28,28,26,.3)}
/* ＋ − at the bottom of their column, 箱を動かす (.vp-go: bordered on its own, the accent while the mode is on) above */
.vp-sd{display:flex;flex-direction:column;gap:4px}
.vpad button{display:flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--m2)}
.vpad button:hover{background:var(--wh);color:var(--ink)}
.vpad button:active{background:var(--con);color:var(--ink)}
.vp-z button + button{border-top:1px solid rgba(28,28,26,.18)}
.vp-u{grid-area:1/2}.vp-l{grid-area:2/1}.vp-c{grid-area:2/2}.vp-r{grid-area:2/3}.vp-d{grid-area:3/2}
.vpad svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:square}
.vpad .dot{fill:currentColor;stroke:none}
.vpad .vp-go{width:28px;height:28px}
.vpad .vp-go[aria-pressed="true"]{background:var(--or);border-color:var(--or);color:var(--ink)}
.scene[data-pad="s"] .vp-mv{grid-template-columns:repeat(3,22px);grid-template-rows:repeat(3,22px)}
.scene[data-pad="s"] .vpad button{width:22px;height:22px}
.scene[data-pad="s"] .vpad svg{width:12px;height:12px}
.scene[data-pad="s"] .vpad .vp-go{width:24px;height:24px}
/* the tour's card stands over the same corner */
.app.touring #viewPad{visibility:hidden}
@media (hover:hover) and (pointer:fine) and (min-width:981px){
  .scene[data-pad]:not(.off3d) > .vpad{display:flex}
  .scene[data-pad]:not(.off3d) > .notes{bottom:100px}
  .scene[data-pad="s"]:not(.off3d) > .notes{bottom:88px}
  .scene[data-pad]:not(.off3d):not([data-pad-tight]) > .plan{max-height:calc(100% - 124px)}
  .scene[data-pad-tight]:has(> .plan:not([hidden])) > .vpad{display:none}
}

/* floor plan: a panel over the 3D, open until closed */
.plan{position:absolute;right:16px;top:16px;z-index:3;width:460px;max-width:calc(100% - 32px);max-height:calc(100% - 32px);display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:var(--sh)}
.plan-h{flex:0 0 auto;display:flex;height:36px;background:var(--ink)}
.plan-h h2{flex:1 1 0;min-width:0;display:flex;align-items:center;padding-left:14px;font-size:13px;font-weight:700;line-height:16px;color:#F2F1ED;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.px{flex:0 0 40px;width:40px;display:flex;align-items:center;justify-content:center;border-left:1px solid var(--dk-line);font-size:16px;line-height:20px;color:#F2F1ED}
.px:hover{background:#2B2B29}
.plan-b{min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:12px 14px 14px}
.plan-note{font-size:12px;line-height:16px;color:var(--m1)}
.plans{display:flex;flex-direction:column;gap:12px}
.pl1{display:flex;flex-direction:column;gap:8px}
.pl1 svg{display:block;width:100%;height:auto;max-height:170px}
.pl1.sub svg{max-height:120px;max-width:200px}
.pl1 p{font-size:12px;line-height:16px;color:var(--txt)}
/* 交差積み: the switch between a pallet's odd and even layers (ui/plan.ts) */
.ly-seg{align-self:flex-start;flex:0 0 auto;display:flex;gap:2px;max-width:100%;padding:2px;border-radius:9px;background:var(--con)}
.ly-seg button{min-width:0;height:28px;padding-inline:12px;border-radius:7px;font-size:12.5px;line-height:16px;color:var(--m1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ly-seg button[aria-checked="true"]{background:var(--wh);font-weight:700;color:var(--ink);box-shadow:0 1px 2px rgba(28,28,26,.12)}
.ly-seg button:focus-visible{outline:2px solid var(--ink);outline-offset:1px}
.legend-line{display:flex;flex-wrap:wrap;gap:4px 16px}
.legend-line > span{display:inline-flex;align-items:center;gap:6px}
.legend-line .vtag{color:var(--warn);font-weight:700}
.pl-floor{fill:var(--pap);stroke:var(--m1)}
.pl-hatch{fill:var(--m3);opacity:.6}
.pl-clear{stroke:var(--m3)}
.pl-door{fill:var(--ink)}
.pl-box{stroke:rgba(52,36,18,.55)}
.pl-txt{fill:var(--m1);font-family:var(--f-body)}
/* 段ごとに積む: the layers of a pallet one at a time (ui/plan.ts), the boxes of the layers below that reach it faint */
.ly-step{align-self:flex-start;display:flex;align-items:center;gap:2px;padding:2px;border-radius:9px;background:var(--con)}
.ly-step button{width:30px;height:28px;border-radius:7px;font-size:15px;line-height:16px;color:var(--ink)}
.ly-step button:disabled{color:var(--faint);cursor:default}
.ly-step button:not(:disabled):hover{background:var(--wh)}
.ly-step output{min-width:120px;padding-inline:8px;text-align:center;font-size:12.5px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap}
.pl-box.low{opacity:.32}

/* comparison: drops from the summary band */
.cmp{position:absolute;left:150px;top:64px;z-index:8;width:440px;max-width:calc(100% - 160px);max-height:calc(100% - 76px);overflow-y:auto;background:var(--wh);border:2px solid var(--ink);box-shadow:var(--sh)}
.grab{display:none}
.cmp-h{display:flex;align-items:center;height:38px;background:var(--ink);padding-left:14px;position:sticky;top:0;z-index:1}
.cmp-ht{flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px}
.cmp-h h2{font-size:13px;font-weight:700;line-height:16px;color:#F2F1ED;white-space:nowrap}
.cmp-sub{font-size:12px;line-height:16px;color:var(--dk-mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmp-x{flex:0 0 auto;height:38px;padding:0 14px 0 12px;font-size:12px;line-height:16px;color:var(--dk-mut)}
.cmp-x:hover{color:#F2F1ED}
table.ctab{width:100%;border-collapse:collapse;table-layout:fixed}
.ctab th{height:30px;padding:2px 0 2px 6px;border-bottom:1px solid var(--ink);font-size:11px;font-weight:400;line-height:14px;color:var(--m1);text-align:left;white-space:pre-line;vertical-align:middle}
.ctab th:first-child,.ctab td:first-child{padding-left:14px}
.ctab th:last-child,.ctab td:last-child{padding-right:14px}
.ctab .num{text-align:right}
.ctab col.c1{width:40px}.ctab col.c2{width:70px}.ctab col.c3{width:58px}.ctab col.c4{width:66px}
.ctab.single col.c1{width:64px}.ctab.single col.c2{width:58px}.ctab.single col.c3{width:54px}.ctab.single col.c4{width:72px}
.ctab td{height:40px;padding:0 0 0 6px;border-bottom:1px solid var(--line);font-size:13px;line-height:16px;color:var(--txt);vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ctab td.num{font-family:var(--f-mono);font-variant-numeric:tabular-nums}
.ctab td.n1{font-weight:600}
.ctab td.lost{font-family:var(--f-body);color:var(--m1)}
.ctab td.warn{color:var(--warn);font-weight:700}
.ctab tbody tr{cursor:pointer}
.ctab tbody tr:hover{background:var(--pap)}
.ctab tbody tr.is-cur{background:var(--pap)}
.ctab tbody tr.is-cur td:first-child{box-shadow:inset 4px 0 0 var(--or);font-weight:700}
.ctab tbody tr:focus-visible{outline:2px solid var(--or);outline-offset:-2px}
.ctab .best{display:block;font-size:11px;font-weight:700;line-height:14px;color:var(--best)}
/* 扉×: the load does not pass that door (the reasons in the title) */
.ctab .doorx{display:inline-block;margin-left:6px;padding:0 4px;border:1px solid var(--warn);font-size:10px;font-weight:700;line-height:14px;color:var(--warn);vertical-align:1px}
.ctab .best + .doorx,.ctab td:first-child:has(.doorx){white-space:normal}
.ctab td:first-child:has(.best){white-space:normal}
.ctab td:first-child:has(.cn){white-space:normal}
.ctab .cn{display:inline-block;white-space:nowrap}
.cmp-note{padding:10px 14px;font-size:11px;line-height:16px;color:var(--m1)}

/* ---------- 積荷リスト under the 3D (layout 下) ---------- */
.ct{display:none}
.app[data-layout="bottom"] .ct{flex:0 0 auto;display:flex;flex-direction:column;max-height:46%;background:var(--wh);border-top:2px solid var(--ink)}
.ct-bar{flex:0 0 auto;display:flex;align-items:stretch;height:36px;background:var(--ink)}
.ct-t{display:flex;align-items:center;padding-inline:16px;font-size:13px;font-weight:700;line-height:16px;color:#F2F1ED;white-space:nowrap}
.ct-hint{flex:1 1 0;min-width:0;align-self:center;padding-inline:4px;font-size:12px;line-height:16px;color:var(--dk-mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tb{display:flex;align-items:center;gap:6px;padding-inline:14px;border-left:1px solid var(--dk-line);font-size:13px;line-height:16px;color:#F2F1ED;white-space:nowrap;cursor:pointer}
button.tb:hover{background:#2B2B29}
.tb[aria-expanded="true"]{background:var(--pap);color:var(--ink);font-weight:700}
.tb.primary{background:var(--or);color:var(--ink);font-weight:700;padding-inline:16px;border-left:0}
button.tb.primary:hover{background:#FF7440}
.tb.primary:disabled{background:#6E6D68;color:#C9C8C2}
.ct-head,.ct-row,.ct-total{display:flex;align-items:stretch;padding-left:12px}
.ct-head{flex:0 0 auto;height:28px;background:var(--pap);border-bottom:1px solid var(--ink);font-size:11px;line-height:14px;color:var(--m1)}
.ct-head > *{display:flex;align-items:center}
.ct-body{flex:0 1 auto;min-height:0;overflow-y:auto}
.ct-row{height:38px;border-bottom:1px solid var(--line)}
.ct-total{flex:0 0 auto;height:34px;background:var(--pap)}
/* 積荷リスト: the add button in the bar; 積荷が 0 行 inside the table */
.ct-hint b{color:#F2F1ED}
.ct-hint .sep{padding-inline:5px;color:#6E6D68}
.ct-hint.full{font-weight:700;color:#F2F1ED}
/* 上に重い箱を載せない under 計 (the line of the left column, as one of the table's rows) */
.ct .nh-line{flex:0 0 auto;align-items:center;min-height:40px;margin:0;padding:7px 16px;border-radius:0;background:var(--wh)}
.ct .nh-line.none .nh-pick{margin-left:0}
.ct-empty{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:22px 16px;border-bottom:1px solid var(--line);text-align:center}
.ct-empty b{font-size:15px;line-height:20px;color:var(--txt)}
.ct-empty > span{font-size:12px;line-height:16px;color:var(--m1)}
.ct-empty .add-b{flex:0 0 auto}
/* the table's last row (案Z): 「＋ 段ボールを追加」, which turns into fields under 名前・長さ・幅・高さ */
.ct-add{flex:0 0 auto}
.ct-add-b{display:flex;align-items:center;width:100%;height:38px;padding-left:12px;border-bottom:1px solid var(--line);text-align:left;font-size:13px;line-height:16px;color:var(--ink);white-space:nowrap}
.ct-add-b .c-o{border-right-color:transparent}
.ct-add-b .c-sw{color:var(--m1)}
.ct-add-b .c-sw svg{display:block}
.ct-add-b b{font-weight:700}
.ct-add-h{min-width:0;margin-left:16px;font-size:12px;color:var(--m3);overflow:hidden;text-overflow:ellipsis}
.ct-add-b:hover:not(:disabled){background:var(--pap)}
.ct-add-b:disabled{color:var(--m3);cursor:default}
.nb-t{box-shadow:inset 3px 0 0 var(--or)}
.nb-t .c-sw i{border:1.5px dashed var(--b-dash);background:none}
.nb-t .c-nm{padding-right:10px}
.nb-t .c-d{padding:0 6px}
.nb-t input{width:100%;height:28px;border:1px solid var(--b-chip);border-radius:6px;background:var(--wh);padding:0 8px;font-size:13px;font-weight:400;line-height:16px;color:var(--ink)}
.nb-t .c-nm input{border-color:transparent;background:var(--b-fill);padding-left:28px}
.nb-tq{position:relative;flex:1 1 auto;min-width:0;display:flex;align-items:center}
.nb-tq .nb-q{position:absolute;left:9px;pointer-events:none}
.nb-t .c-d input{text-align:right;font-family:var(--f-mono);font-size:14px;font-weight:600}
.nb-t input::placeholder{font-family:var(--f-body);font-size:12px;font-weight:400;color:var(--m3)}
.nb-t input:focus{outline:none;border-color:var(--or);box-shadow:var(--fo)}
.nb-t input[aria-invalid="true"]{border-color:var(--warn);color:var(--warn)}
.nb-tip{font-family:var(--f-body);font-size:11px;color:var(--m3)}
/* 積荷が 0 行: the 3D keeps its space without boxes and says why; the hold switcher waits */
.vp-empty{position:absolute;inset:0;z-index:3;display:none;align-items:center;justify-content:center;padding:24px;font-size:14px;font-weight:700;line-height:20px;color:var(--m2);text-align:center;pointer-events:none}
.vp-empty span{padding:8px 14px;background:rgba(255,255,255,.92);border:1px solid var(--line)}
.app.is-empty .vp-empty{display:flex}
.app.is-empty .hs,.app.is-empty #tagLayer,.app.is-empty #layerCtl,.app.is-empty #colNote,.app.is-empty #vpVirtual,.app.is-empty #showNote,.app.is-empty #liteNote,.app.is-empty #viewPad{visibility:hidden}
.c-sw{flex:0 0 20px;display:flex;align-items:center}
/* the table's ↑ / ↓: side by side in their own column (積む順), in the row's left padding */
.c-o{flex:0 0 52px;display:flex;align-items:center;margin:0 8px 0 -12px;border-right:1px solid var(--con);font-size:11px;line-height:14px}
.ct-head .c-o{justify-content:center;border-right-color:transparent}
.ct-total .c-o{border-right-color:transparent}
.c-o .ord-b{align-self:stretch}
.ct.one .c-o{display:none}
.c-sw i{width:12px;height:12px}
.c-nm{flex:1 1 0;min-width:0;display:flex;align-items:center;font-size:14px;font-weight:700;line-height:18px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 案Z: the values of a row, text until pressed (ui/row-edit.ts): a whole cell to press for a size or the 印字, the name's
   own width; the field takes the cell, inside its lines. Under a value that is not as saved: 「登録 260」, and
   「登録を更新」 at the right of 名前 with the bookmark */
.ct-row [data-c]{position:relative}
.ct-row .c-d[data-c]{padding-right:0}
.ct-row .c-p[data-c]{padding-left:0}
/* 名前 clips its overflow: it reaches 8px back over the swatch's empty side, so the name's field (and its hover ground)
   can start 6px before the text */
.ct-row .c-nm[data-c]{margin-left:-8px;padding-left:8px}
.ct-row [data-c] > .ev{align-self:stretch;display:flex;align-items:center;margin:0;border-radius:0}
.ct-row .c-d > .ev{flex:1 1 auto;justify-content:flex-end;padding:0 10px 0 4px}
.ct-row .c-p > .ev{flex:1 1 auto;min-width:0;padding:0 8px 0 10px;overflow:hidden;white-space:nowrap}
.ct-row .c-p > .ev.none{color:var(--faint)}
.ct-row .c-nm > .ev{flex:0 1 auto;display:block;min-width:0;margin-left:-6px;padding:0 6px;line-height:38px;overflow:hidden;text-overflow:ellipsis}
.ct-row [data-c].diff > .ev{padding-bottom:11px}
.ct-row .c-nm.diff > .ev{line-height:27px;padding-bottom:11px}
/* the field: 3px inside the cell's lines and 7px inside itself, so a size ends 10px from the right and the 印字 starts
   10px from the left as when written; the name's 6px before the text */
.ct-row [data-c] > .ev-in{flex:1 1 auto;width:0;align-self:stretch;margin:5px 3px;padding:0 7px;font-size:14px}
.ct-row .c-d > .ev-in{text-align:right;font-family:var(--f-mono)}
.ct-row .c-p > .ev-in{font-family:var(--f-mono);font-size:13px}
.ct-row .c-nm > .ev-in{margin-left:-6px;padding-left:6px;font-weight:700}
.ct-row.editing [data-c] > .c-reg{visibility:hidden}
.c-reg{position:absolute;right:10px;bottom:3px;font-family:var(--f-body);font-size:10px;font-weight:400;line-height:12px;color:var(--m1);white-space:nowrap;pointer-events:none}
.c-reg:empty{display:none}
.c-nm > .c-reg{left:8px;right:auto;max-width:60%;overflow:hidden;text-overflow:ellipsis}
.c-p > .c-reg{left:10px;right:auto}
.c-up{flex:0 0 auto;margin-left:auto;padding-left:8px}
.c-up .reg-up{font-size:11px;line-height:14px}
.c-nm > .bm{margin:0 10px 0 8px}
/* リストの順: いちばん下 / いちばん上 (a pallet) or いちばん奥 / いちばん手前 after the first and the last row's name, quiet
   (rows.ts markOrder); 下 / 上 / 奥 / 手前 alone in a cell under 260px (PC under about 1200px) and none under 120px
   (about 1000px), so the name keeps its room */
.ct-row .c-nm{container-type:inline-size}
.c-nm > .ord-cue{flex:0 0 auto;margin-left:6px;font-size:11px;font-weight:400;line-height:14px;color:var(--m1)}
@container (max-width:259px){.ord-cue .oc-l{display:none}}
@container (max-width:119px){.c-nm > .ord-cue{display:none}}
.ct-head .c-nm{font-size:11px;font-weight:400;line-height:14px}
.ct-total .c-nm{font-size:13px;line-height:16px}
.c-d{flex:0 0 70px;display:flex;align-items:center;justify-content:flex-end;padding-right:10px;border-left:1px solid var(--con);font-family:var(--f-mono);font-size:14px;line-height:18px}
.c-d.kg{flex-basis:76px}
.c-d.c-kin{padding-right:0;font-family:var(--f-body)}
.c-kin .kgw{flex:1 1 auto;width:auto;align-self:stretch}
.c-kin .kgw input{width:100%;height:100%;border:0;border-radius:0;background:var(--wh);box-shadow:inset 0 -2px 0 var(--ink);padding:0 10px 0 4px;text-align:right;font-family:var(--f-mono);font-size:15px;font-weight:600;line-height:18px;color:var(--txt)}
.c-kin .kgw input::placeholder{font-family:var(--f-body);font-size:12px;font-weight:400;color:var(--m3)}
.c-kin .kgw input:focus{outline:none;background:var(--sel);box-shadow:inset 0 -2px 0 var(--or)}
.c-kin .kgw input[aria-invalid="true"]{box-shadow:inset 0 -2px 0 var(--warn);color:var(--warn)}
.c-kin .kgu{display:none}
.c-kin .kgw.diff input{padding-bottom:11px}
.c-kin .kg-reg{top:auto;bottom:4px;right:10px;margin:0}
.ct-head .c-d,.ct-total .c-d{border-left-color:transparent;font-family:var(--f-body);font-size:11px;line-height:14px}
.ct-total .c-d.kg{font-family:var(--f-mono);font-size:12px;font-weight:500;line-height:16px;color:var(--m1)}
.c-p{flex:0 0 120px;display:flex;align-items:center;padding-left:10px;border-left:1px solid var(--con);font-family:var(--f-mono);font-size:13px;line-height:16px;white-space:nowrap;overflow:hidden}
.c-p.none{color:var(--faint)}
.ct-head .c-p,.ct-total .c-p{border-left-color:transparent;font-family:var(--f-body);font-size:11px;line-height:14px}
.c-q{flex:0 0 84px;display:flex;border-left:1px solid var(--con)}
.ct-head .c-q{border-left-color:transparent;justify-content:flex-end;padding-right:10px;font-weight:700;color:var(--ink)}
.ct-total .c-q{border-left-color:transparent;justify-content:flex-end;align-items:center;padding-right:10px;font-family:var(--f-mono);font-size:15px;font-weight:700;line-height:18px}
.c-q input{width:100%;height:100%;border:0;border-radius:0;background:var(--wh);box-shadow:inset 0 -2px 0 var(--ink);padding:0 10px;text-align:right;font-family:var(--f-mono);font-size:15px;font-weight:600;line-height:18px;color:var(--txt)}
.c-q input::placeholder{font-family:var(--f-body);font-size:12px;font-weight:400;color:var(--m3)}
.c-q input:focus{outline:none;background:var(--sel);box-shadow:inset 0 -2px 0 var(--or)}
.c-a{flex:0 0 44px;display:flex;align-items:center;justify-content:center;border-left:1px solid var(--con)}
.ct-head .c-a,.ct-total .c-a{border-left-color:transparent}
.c-x{align-self:stretch;width:100%;font-size:15px;line-height:18px;color:var(--m1)}
.c-x:hover{color:var(--warn)}
.c-x.ghost{visibility:hidden}

/* ---------- dropdown: the saved boxes, under the add row (ui/box-add.ts) ---------- */
.ld{position:fixed;z-index:20;width:390px;max-width:calc(100vw - 16px);display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:6px 6px 0 rgba(28,28,26,.2)}
.srch{flex:0 0 auto;display:flex;align-items:center;gap:8px;height:40px;padding-inline:12px;background:var(--pap);border-bottom:1px solid var(--line);cursor:text}
.srch > span{font-size:14px;line-height:18px;color:var(--m1)}
.srch input{flex:1 1 0;min-width:0;height:100%;border:0;background:transparent;font-size:13px;line-height:16px;color:var(--txt)}
.srch input::placeholder{color:var(--m3)}
.srch input:focus{outline:none}
.srch:focus-within{box-shadow:inset 0 -2px 0 var(--or)}
.ld-list{flex:0 1 auto;min-height:0;max-height:min(360px,50vh);overflow-y:auto}
.ld-row{width:100%;text-align:left;cursor:pointer}
.ld-row:disabled{cursor:default}
.ld-grp{padding:8px 12px 4px;font-size:11px;line-height:14px;color:var(--m3)}
.ld-full{flex:0 0 auto;padding:8px 12px;background:var(--sel);font-size:12px;font-weight:700;line-height:16px;color:var(--m2)}
.ld-row{display:flex;align-items:center;gap:10px;height:40px;padding-inline:12px;border-bottom:1px solid var(--con)}
.ld-row:not(:disabled):hover,.ld-row:not(:disabled):focus-visible{outline:none;background:var(--sel);box-shadow:inset 4px 0 0 var(--or);padding-left:12px}
.ld-n{flex:1 1 0;min-width:0;font-size:14px;line-height:18px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ld-row:not(:disabled):hover .ld-n,.ld-row:not(:disabled):focus-visible .ld-n{font-weight:700}
.ld-row:not(:disabled):hover .ld-a,.ld-row:not(:disabled):focus-visible .ld-a{font-weight:700;color:#C2410C}
.ld-d{flex:0 0 auto;font-family:var(--f-mono);font-size:12px;line-height:16px;color:var(--m2);white-space:nowrap}
.ld-a{flex:0 0 72px;width:72px;display:flex;justify-content:flex-end;font-size:12px;line-height:16px;color:var(--m3);white-space:nowrap}
.ld-row.in .ld-n,.ld-row.full .ld-n{color:var(--m3)}
.ld-row.in .ld-d,.ld-row.full .ld-d{color:var(--faint)}
.ex{margin-left:6px;padding:0 4px;border:1px solid var(--line);font-size:10px;font-weight:400;line-height:14px;color:var(--m1);vertical-align:1px}
/* the three sizes typed: that size as a new row (not saved), Enter */
.ld-row.ld-add{height:auto;min-height:52px;padding-block:7px;background:var(--sel)}
.ld-plus{flex:0 0 22px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--or);color:var(--wh)}
.ld-plus svg{display:block}
.ld-at{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:1px}
.ld-at b{font-family:var(--f-mono);font-size:13.5px;line-height:18px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ld-at small{font-size:11px;line-height:14px;color:var(--m1)}
.ld-add.dup small{color:var(--best)}
.ld-add kbd{flex:0 0 auto;padding:1px 6px;border:1px solid var(--b-chip);border-radius:4px;background:var(--wh);font-family:var(--f-mono);font-size:11px;line-height:14px;color:var(--m2)}
.ld-empty{padding:14px 12px;font-size:12px;line-height:18px;color:var(--m1)}
.ld-f{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;height:36px;padding-inline:12px;border-top:1px solid var(--line);background:var(--wh);font-size:12px;line-height:16px;color:var(--m1)}
.ld-f button{font-weight:400;color:var(--m2);white-space:nowrap}
.ld-f button:hover{text-decoration:underline;text-underline-offset:3px}

/* ---------- 保存した箱 ---------- */
.ov{position:fixed;inset:0;z-index:25;background:rgba(28,28,26,.45)}
.bx{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:30;width:940px;height:660px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:8px 8px 0 rgba(28,28,26,.25)}
.bx-h{flex:0 0 auto;display:flex;align-items:stretch;height:44px;background:var(--ink)}
.bx-h h2{flex:1 1 0;min-width:0;display:flex;align-items:center;padding-left:18px;font-size:15px;font-weight:700;line-height:18px;color:#F2F1ED;white-space:nowrap}
.bx-store{display:flex;align-items:center;padding-inline:16px;font-size:12px;line-height:16px;color:var(--dk-mut);white-space:nowrap}
.bx-store.warn{color:#FF8A8F}
.bx-x{flex:0 0 52px;width:52px;border-left:1px solid var(--dk-line);font-size:18px;line-height:22px;color:#F2F1ED}
.bx-x:hover{background:#2B2B29}
.bx-b{flex:1 1 0;min-height:0;display:flex}
.bx-lc{flex:1 1 0;min-width:0;display:flex;flex-direction:column;border-right:2px solid var(--ink)}
.bx-s{flex:0 0 auto;display:flex;height:44px;border-bottom:1px solid var(--line)}
.bx-s .srch{flex:1 1 0;height:auto;padding-inline:14px;background:var(--wh);border:0}
.bx-new{flex:0 0 auto;padding-inline:16px;background:var(--or);font-size:13px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap}
.bx-new:hover{background:#FF7440}
.bx-lh,.bx-it{display:flex;align-items:center;padding:0 14px 0 18px}
.bx-lh{flex:0 0 auto;height:28px;background:var(--pap);border-bottom:1px solid var(--ink);font-size:11px;line-height:14px;color:var(--m1)}
.bx-lh > :first-child,.bx-it > :first-child{flex:1 1 0;min-width:0}
.bx-c1{flex:0 0 150px;text-align:right}
.bx-c2{flex:0 0 70px;text-align:right}
.bx-c3{flex:0 0 110px;padding-left:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bx-list{flex:1 1 0;min-height:0;overflow-y:auto}
.bx-grp{padding:8px 18px 6px;background:var(--wh);font-size:11px;font-weight:700;line-height:14px;color:var(--m1);border-bottom:1px solid var(--line)}
.bx-it{width:100%;height:42px;border-bottom:1px solid var(--line);font-size:14px;line-height:18px;text-align:left;color:var(--txt)}
.bx-it:hover{background:var(--pap)}
.bx-it[aria-selected="true"]{background:var(--sel);box-shadow:inset 4px 0 0 var(--or);font-weight:700}
.bx-it > :first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bx-it .bx-c1,.bx-it .bx-c2{font-family:var(--f-mono);font-size:13px;font-weight:400;line-height:16px}
.bx-it .bx-c3{font-family:var(--f-mono);font-size:12px;font-weight:400;line-height:16px}
.bx-it .bx-c3.none{color:var(--faint)}
.bx-it .bx-c2{white-space:nowrap}
.bx-empty{padding:16px 18px;font-size:12px;line-height:18px;color:var(--m1)}
.bx-ec{flex:0 0 360px;width:360px;display:flex;flex-direction:column;background:var(--pap);min-height:0;overflow-y:auto}
.bx-eh{flex:0 0 auto;display:flex;align-items:center;gap:10px;height:44px;padding-inline:18px;border-bottom:1px solid var(--line);font-size:14px;line-height:18px}
.bx-eh b{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bx-back{display:none}
.bx-f{display:flex;flex-direction:column;gap:14px;padding:18px}
.f{min-width:0;display:flex;flex-direction:column;gap:4px;flex:1 1 0}
.f > span{font-size:12px;line-height:16px;color:var(--m2);white-space:nowrap}
.f input{width:100%;height:36px;border:0;border-radius:0;border-bottom:2px solid var(--ink);background:var(--wh);padding:0 10px;font-size:14px;line-height:18px;color:var(--txt)}
.f input[type="number"]{text-align:right;font-family:var(--f-mono);font-variant-numeric:tabular-nums}
.f input#bxPrint{font-family:var(--f-mono)}
.f input::placeholder{font-family:var(--f-body);font-size:13px;color:var(--faint)}
.f input:focus{outline:none;border-bottom-color:var(--or);background:var(--sel)}
.f3,.f2{display:flex;gap:8px}
.f.kg{flex:0 0 100px}
.bx-ex{font-size:12px;line-height:18px;color:var(--m2)}
.bx-ft{flex:0 0 auto;display:flex;flex-direction:column;gap:10px;padding:16px 18px 18px;border-top:1px solid var(--line)}
.bx-btns{display:flex;gap:8px}
.btn-or,.btn-ol{flex:1 1 0;display:flex;align-items:center;justify-content:center;height:40px;padding-inline:10px;font-size:14px;font-weight:700;line-height:18px;color:var(--txt);white-space:nowrap}
.btn-or{background:var(--or)}
.btn-or:hover:not(:disabled){background:#FF7440}
.btn-ol{background:var(--wh);border:2px solid var(--ink)}
.btn-ol:hover:not(:disabled){background:var(--pap)}
.btn-or:disabled,.btn-ol:disabled{background:var(--con);border-color:var(--con);color:var(--m3)}
.bx-note{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;line-height:16px;color:var(--m1)}
.bx-del{flex:0 0 auto;font-weight:700;color:var(--warn);white-space:nowrap}
.bx-del:hover{text-decoration:underline;text-underline-offset:3px}

/* ---------- small dialogs ---------- */
.cpy{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:30;width:520px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:8px 8px 0 rgba(28,28,26,.25)}
.cpy-h{display:flex;height:40px;background:var(--ink)}
.cpy-h h2{flex:1 1 0;display:flex;align-items:center;padding-left:14px;font-size:13px;font-weight:700;color:#F2F1ED}
.cpy .hint{border-bottom:0;background:var(--wh)}
.copy-fallback{display:block;width:calc(100% - 28px);min-height:160px;margin:0 14px 14px;padding:8px 10px;border:0;border-radius:0;border-bottom:2px solid var(--ink);background:var(--pap);font-family:var(--f-mono);font-size:12px;line-height:18px;resize:vertical}
.sheet{display:none}
.toast{position:fixed;left:50%;bottom:24px;z-index:50;transform:translate(-50%,16px);width:max-content;max-width:min(720px,calc(100vw - 32px));padding:10px 16px;background:var(--ink);color:#F2F1ED;font-size:13px;line-height:18px;box-shadow:var(--sh);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.toast.show{opacity:1;transform:translate(-50%,0)}
/* a note whose button follows its last words (toast.ts inline: a paste's note in two lines) */
.toast.act.inl{display:block}
.toast.inl .toast-m{display:inline}
.toast.inl .toast-a{margin-left:14px}
/* the first box added: what its 数量 means, under (or over) the field, once */
.qh{position:fixed;z-index:22;display:flex;flex-direction:column;gap:2px;max-width:min(280px,calc(100vw - 16px));padding:8px 12px;background:var(--ink);color:#F2F1ED;font-size:12px;line-height:16px;box-shadow:var(--sh);pointer-events:none}
.qh b{font-size:13px;line-height:17px}
.qh::before{content:"";position:absolute;right:30px;top:-6px;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid var(--ink)}
.qh.up::before{top:auto;bottom:-6px;border-bottom:0;border-top:6px solid var(--ink)}
/* read out only (a moved row's new place) */
.vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.tabbar{display:none}

/* ---------- 使い方: the demo that plays itself (ui/tour.ts) ---------- */
.tour-dim{position:fixed;inset:0;z-index:60;background:transparent}
.tour-spot{position:fixed;z-index:61;box-shadow:0 0 0 9999px rgba(28,28,26,.38),0 0 0 3px var(--or);pointer-events:none;transition:left .28s ease,top .28s ease,width .28s ease,height .28s ease}
.tour-spot.center{box-shadow:0 0 0 9999px rgba(28,28,26,.38)}
.tour-card{position:fixed;z-index:62;width:min(360px,calc(100vw - 16px));display:flex;flex-direction:column;gap:8px;padding:10px 12px 12px 14px;background:var(--wh);color:var(--txt);border:2px solid var(--ink);box-shadow:var(--sh)}
.tour-head{display:flex;align-items:center;gap:10px;margin:-4px -6px -2px 0}
.tour-step{flex:0 0 auto;font-family:var(--f-mono);font-size:11px;line-height:14px;letter-spacing:.08em;color:var(--m1)}
.tour-step:empty{display:none}
.tour-card h3{flex:1 1 auto;min-width:0;font-size:16px;font-weight:700;line-height:22px}
.tour-card p.tour-body{min-height:42px;font-size:14px;line-height:21px}
.tour-x{flex:0 0 auto;width:36px;height:36px;display:grid;place-items:center;font-size:20px;line-height:1;color:var(--m1)}
.tour-x:hover,.tour-x:focus-visible{color:var(--ink);background:var(--sel);outline:none}
.tour-nav{display:flex;align-items:center;gap:8px}
.tour-nav .btn-or,.tour-nav .btn-ol{flex:0 0 auto;height:32px;padding-inline:14px;font-size:13px}
/* ❚❚ / ▶ (↻ at the end) and the progress: a segment per scene, the one playing filling */
.tour-pp{flex:0 0 auto;width:32px;height:32px;display:grid;place-items:center;border:1.5px solid var(--ink);font-size:12px;line-height:1;color:var(--ink)}
.tour-pp:hover{background:var(--sel)}
.tour-bar{flex:1 1 auto;min-width:40px;display:flex;gap:3px}
.tour-bar i{flex:1 1 0;height:4px;overflow:hidden;background:var(--line)}
.tour-bar b{display:block;width:0;height:100%;background:var(--or)}
.tour-card.paused .tour-bar b{background:var(--m3)}
/* 次へ keeps its width at the end (はじめる), so it does not move */
#tourNext{min-width:88px}
/* the cursor (its tip at its place), a press, a key, a field typed in, a thing pointed at */
.demo-cur{position:fixed;left:0;top:0;z-index:64;pointer-events:none;filter:drop-shadow(1px 2px 1px rgba(0,0,0,.28))}
.demo-rip{position:fixed;z-index:63;width:36px;height:36px;margin:-18px 0 0 -18px;border:2px solid var(--or);border-radius:50%;pointer-events:none;animation:demoRip .45s ease-out forwards}
@keyframes demoRip{from{transform:scale(.3);opacity:1}to{transform:scale(1.15);opacity:0}}
.demo-key{position:fixed;z-index:64;padding:3px 8px;background:var(--wh);color:var(--ink);border:1.5px solid var(--ink);box-shadow:0 2px 0 var(--ink);font:600 12px/16px var(--f-mono);pointer-events:none}
.demo-fo{border-color:var(--or)!important;box-shadow:var(--fo)!important}
.demo-hi{outline:3px solid var(--or)!important;outline-offset:-3px}
/* a short phone: the 3D gives way while the inputs play, so they show above the card; the result has it whole */
@media (max-width:980px) and (max-height:760px){.app.touring:not(.tour-res) .viewport{flex-basis:120px;height:120px}}

/* ---------- PC: a narrow 3D column ---------- */
/* PC with a narrow 3D column (981px wide with the cargo list on the left: a 581px bar). The bar has to hold the switcher,
   視点, 配置図, 寸法 and 軽量表示: buttons get tighter, and the switcher goes to two lines (「143か所目/143」 over
   「12,345箱」) so a 5-digit count still shows whole. Left layout: bar = width - 400px; bottom layout: width - 330px. */
@media (min-width:981px) and (max-width:1129px){
  .app .hs-a{flex-basis:26px;width:26px}
  .app .hs-mid{flex-basis:126px;width:126px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-content:center;gap:0 1px;padding-inline:7px}
  .app .hs-n{grid-area:1/1;font-size:12px;line-height:14px}
  .app .hs-of{grid-area:1/2;font-size:11px;line-height:14px}
  .app .hs-c{grid-area:2/1/3/3;max-width:none;font-size:12px;line-height:14px}
  .app .hs-mid .hs-dd{grid-area:1/3/3/4;align-self:center;margin-left:5px}
  .app .hs-of .hs-lg{display:none}
  .app .hs-of .hs-sh{display:inline}
  .app .hs-list{left:26px}
  .app .vseg button,.app .vbar .vb{padding-inline:7px}
  .app .vbar .vb{gap:5px}
}
/* the table under a narrow 3D column (bottom layout under 1130px): the size and print columns give the name some room
   back from 積む順 */
@media (min-width:981px) and (max-width:1129px){
  .app[data-layout="bottom"] .c-d{flex-basis:62px}
  .app[data-layout="bottom"] .c-d.kg{flex-basis:70px}
  .app[data-layout="bottom"] .c-p{flex-basis:88px}
}
@media (min-width:1130px) and (max-width:1199px){
  .app:not([data-layout="bottom"]) .hs-a{flex-basis:26px;width:26px}
  .app:not([data-layout="bottom"]) .hs-mid{flex-basis:126px;width:126px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-content:center;gap:0 1px;padding-inline:7px}
  .app:not([data-layout="bottom"]) .hs-n{grid-area:1/1;font-size:12px;line-height:14px}
  .app:not([data-layout="bottom"]) .hs-of{grid-area:1/2;font-size:11px;line-height:14px}
  .app:not([data-layout="bottom"]) .hs-c{grid-area:2/1/3/3;max-width:none;font-size:12px;line-height:14px}
  .app:not([data-layout="bottom"]) .hs-mid .hs-dd{grid-area:1/3/3/4;align-self:center;margin-left:5px}
  .app:not([data-layout="bottom"]) .hs-of .hs-lg{display:none}
  .app:not([data-layout="bottom"]) .hs-of .hs-sh{display:inline}
  .app:not([data-layout="bottom"]) .hs-list{left:26px}
  .app:not([data-layout="bottom"]) .vseg button,.app:not([data-layout="bottom"]) .vbar .vb{padding-inline:7px}
  .app:not([data-layout="bottom"]) .vbar .vb{gap:5px}
}
/* ---------- PC: the summary band in a narrow right column ----------
   One row needs about 1010px of right column (left layout: width - 400px; bottom layout: width - 330px). Below that the
   values get 16px and the cells fixed, tighter widths (needs ~860px); below that the band takes two rows: 箱数 · 必要本数
   · 1本目の箱数, then the three meters. Labels and values stay whole (a value over its cell still gets .tight and a title). */
@media (min-width:981px) and (max-width:1199px){
  .app .sum{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));height:auto}
  .app .sc{width:auto;height:54px;padding-inline:12px;grid-column:span 3}
  .app .sc.need{width:auto;grid-column:span 6;gap:10px;padding-right:10px}
  .app .sc:nth-child(3){border-right:0}
  .app .sc.m{grid-column:span 4;height:50px;border-top:1px solid var(--line)}
  .app .sc.m .sv{font-size:16px;line-height:20px}
  .app .sc.m .meter{height:4px}
}
@media (min-width:1200px) and (max-width:1269px){
  .app:not([data-layout="bottom"]) .sum{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));height:auto}
  .app:not([data-layout="bottom"]) .sc{width:auto;height:54px;padding-inline:12px;grid-column:span 3}
  .app:not([data-layout="bottom"]) .sc.need{width:auto;grid-column:span 6;gap:10px;padding-right:10px}
  .app:not([data-layout="bottom"]) .sc:nth-child(3){border-right:0}
  .app:not([data-layout="bottom"]) .sc.m{grid-column:span 4;height:50px;border-top:1px solid var(--line)}
  .app:not([data-layout="bottom"]) .sc.m .sv{font-size:16px;line-height:20px}
  .app:not([data-layout="bottom"]) .sc.m .meter{height:4px}
}
@media (min-width:1200px) and (max-width:1269px){
  .app[data-layout="bottom"] .sc{flex:0 0 108px;width:108px;padding-inline:12px}
  .app[data-layout="bottom"] .sc.need{flex:0 0 290px;width:290px;gap:10px;padding-right:10px}
  .app[data-layout="bottom"] .sc.m{flex:1 1 0;width:auto;min-width:112px}
  .app[data-layout="bottom"] .sl{font-size:11px;line-height:15px}
  .app[data-layout="bottom"] .sv{font-size:16px;line-height:22px}
}
@media (min-width:1270px) and (max-width:1339px){
  .app .sc{flex:0 0 108px;width:108px;padding-inline:12px}
  .app .sc.need{flex:0 0 290px;width:290px;gap:10px;padding-right:10px}
  .app .sc.m{flex:1 1 0;width:auto;min-width:112px}
  .app .sl{font-size:11px;line-height:15px}
  .app .sv{font-size:16px;line-height:22px}
}
@media (min-width:1340px) and (max-width:1409px){
  .app:not([data-layout="bottom"]) .sc{flex:0 0 108px;width:108px;padding-inline:12px}
  .app:not([data-layout="bottom"]) .sc.need{flex:0 0 290px;width:290px;gap:10px;padding-right:10px}
  .app:not([data-layout="bottom"]) .sc.m{flex:1 1 0;width:auto;min-width:112px}
  .app:not([data-layout="bottom"]) .sl{font-size:11px;line-height:15px}
  .app:not([data-layout="bottom"]) .sv{font-size:16px;line-height:22px}
}
/* ---------- touch screens: every field 16px, so iOS Safari does not zoom in when one takes the focus ----------
   All of them at once (a list of selectors lost to the more specific rules that size each field: the values written
   on a row, a long 数量, 積荷リスト's add row and weights). Pinch zoom stays: the viewport meta does not stop it */
@media (pointer:coarse),(hover:none){
  input:not([type="checkbox"],[type="radio"],[type="range"]),select,textarea{font-size:16px!important}
  /* 積荷リスト's 数量 at 16px: 「120,000」 whole in its 84px cell (6px in from each side, not 10) */
  .c-q input{padding-inline:6px}
}
@media (pointer:coarse){
  /* a row's ↑ / ↓ and ×, a pill's × and 選ぶ: bigger to tap; the chips a little taller */
  .nh-x::after{inset:-9px}
  .nh-pick::after{inset:-12px -10px}
  .box-ord{flex-basis:40px;margin-right:-2px}
  .cond{--xw:24px}
  .chip,.tchip,.rows-t .chip,.pchips .chip{min-height:36px}
  .vw-in{height:36px}
  .plo select{height:36px}
}
/* a touch screen with the PC layout (an iPad on its side): the bigger ↑ / ↓ and × leave the name and the sizes 98px, so
   the bookmark goes on line 1 after the name and line 2 is the sizes alone, 11px (「4999×4999×4999」 92px, whole). ↑ / ↓
   32px wide (as on a 320px phone). The rows keep their height, so the column still fits; a row narrower still (a long
   weight's field grown, below) lets its sizes go on to another line rather than cut them. · 印字 never had the room
   here (it is in the line's title and in 積荷リスト). The saved values under a changed row wrap, as on phones (a finger
   has no title to read) */
@media (pointer:coarse) and (min-width:981px){
  .box-ord{flex-basis:32px}
  .box-info{flex-direction:row;flex-wrap:wrap;align-items:center;align-content:center;gap:0 4px}
  .box-info > .box-name{max-width:calc(100% - 20px)}
  .box-line{display:contents}
  /* the line break after name + bookmark (1px: the gap the column had) */
  .box-info::before{content:"";order:2;flex:0 0 100%;height:1px}
  .box-meta{order:3;flex-shrink:1;max-width:100%;font-size:11px;line-height:16px;white-space:normal}
  .box-pr{display:none}
  .box-reg,.zero0{order:4;flex:0 0 100%;margin-top:1px}
  .box-reg{display:block;white-space:normal}
  /* the sizes opened on their own line under the row (above): their line here keeps its place */
  .box-info:has(.box-meta .ev-in)::after{content:"";order:3;flex:0 0 100%;height:16px}
  /* a long weight or 数量 (16px figures here) without kg / 箱, as on phones: 「12.345」 and 「999,999」 whole in the
     fields as they are (longer ones grow them: above) */
  .box-row .kgw.long .kgu,.qtw.long .qtu{display:none}
  .box-row .kgw.long input{padding:0 4px 0 2px}
  .qtw.long .qty{padding-right:8px}
}

/* =================== phones (980px and below) =================== */
@media (max-width:980px){
  body{font-size:13px}
  /* the steps' heads give way to the title above the inputs (mtitle); 2 a little lower: the tiles in one line, the
     models' sizes only on the chosen chip, 寸法 for 寸法を入力 */
  .sec-body{padding-top:10px}
  .tile{height:48px;flex-direction:row;gap:6px;padding-right:14px;font-size:12.5px}
  .tl-ck{top:3px;right:3px;width:14px;height:14px}
  .tl-ck svg{width:8px;height:8px}
  .tile > svg{width:22px;height:18px}
  #spChips .chip .ch-d{display:none}
  #spChips .chip[aria-checked="true"] .ch-d{display:inline}
  #spChips .chip .ch-long{display:none}
  #spChips .chip .ch-short{display:inline}
  .pl-box{gap:8px}
  .vw-pane{gap:4px;padding:6px 8px}
  .pc-only{display:none!important}
  .top{height:calc(44px + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px);padding-left:16px;box-shadow:inset 0 -1px 0 #2B2B29}
  .top h1{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis}
  .top > .grow{display:none}
  .lay,#helpBtn,#copyBtn{display:none}
  .tbtn{height:44px}
  .tbtn.primary{padding-inline:14px}
  .tbtn.more{display:flex;justify-content:center;width:44px;padding:0;font-size:18px;line-height:22px}
  .body{flex-direction:column}
  .work{display:contents}
  .cond{order:4;flex:1 1 0;width:auto;min-height:0;border-right:0;overflow-y:auto}
  .app[data-layout="bottom"] .cond{width:auto}
  .sum,.msg-line,.msg-err{display:none}
  .sum-sp{order:1;flex:0 0 auto;display:flex;align-items:center;gap:10px;height:44px;padding:0 10px 0 14px;background:var(--wh);border-bottom:1px solid var(--line)}
  .ss-a{flex:1 1 0;min-width:0;display:flex;align-items:baseline;gap:4px;white-space:nowrap;overflow:hidden}
  .ss-a b{font-size:14px;font-weight:700;line-height:18px;color:var(--txt)}
  .ss-a b:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .ss-a .arr{font-size:10px;line-height:12px;color:var(--m3)}
  /* IBM Plex Sans JP's figures are wider: 44px cells (6px apart) and ⚠ 1px from the weight keep 「100.0%」「999kg⚠」 whole */
  .ss-m{flex:0 0 auto;display:flex;gap:6px}
  .ss-m > div{flex:0 0 44px;width:44px;display:flex;flex-direction:column;gap:1px}
  .ss-m span{font-size:9px;line-height:12px;color:var(--m1)}
  .ss-m b{font-size:11px;font-weight:700;line-height:13px;color:var(--txt);white-space:nowrap;overflow:hidden}
  .ss-m .meter{height:2px}
  .ss-m .uw{margin-left:1px}
  .cmp-btn2{flex:0 0 auto;display:flex;align-items:center;height:26px;padding-inline:7px;border:1px solid var(--ink);font-size:11px;font-weight:700;line-height:14px;color:var(--txt)}
  .cmp-btn2[aria-expanded="true"]{background:var(--ink);color:var(--wh)}
  .msg{display:none}
  .viewport{order:2;flex:0 0 256px;height:256px}
  .vbar{position:absolute;left:10px;right:10px;top:10px;height:30px;background:transparent;border:0;pointer-events:none;gap:6px}
  .vbar > *{pointer-events:auto}
  .vbar > .grow{pointer-events:none}
  .hs{height:30px;background:var(--wh);border:1px solid var(--ink)}
  .hs-a{flex-basis:28px;width:28px;font-size:15px;line-height:18px}
  .hs-a + .hs-mid + .hs-a{border-right:0}
  .hs-mid{flex-basis:118px;width:118px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-content:center;gap:0 2px;padding-inline:8px}
  .hs-n{grid-area:1/1;font-size:11px;line-height:13px}
  .hs-of{grid-area:1/2;font-size:10px;line-height:13px}
  .hs-c{grid-area:2/1/3/3;max-width:none;font-size:12px;line-height:13px}
  .hs-mid .hs-dd{grid-area:1/3/3/4;align-self:center;margin-left:6px;border-left-width:3.5px;border-right-width:3.5px;border-top-width:4px}
  .hs-of .hs-lg{display:none}
  .hs-of .hs-sh{display:inline}
  .vseg,.layer{display:none}
  /* the row's fields a little narrower than on PC, so the name and the sizes keep their room (the quantity's figure
     16px: a phone does not zoom in on it) */
  .cond{--kgw:58px;--qtw:84px}
  /* IBM Plex Sans JP's wider figures: 「12.5」 at 16px still fits the weight (kg 2px further right, no left padding: the
     figures are at the right); four figures or more (12.25, 1000) without kg, as 数量 without 箱 (rows.ts .long) */
  .box-row .kgw input{padding-left:0;padding-right:20px}
  .box-row .kgu{right:5px}
  .box-row .kgw.long input{padding-right:6px}
  .box-row .kgw.long .kgu{display:none}
  .box-ic{width:20px;height:20px}
  .qtw .qty{padding-left:6px;font-size:16px}
  .qtu{padding:0 7px 0 3px}
  .qtw.long .qtu{display:none}
  .qtw.long .qty{padding-right:8px}
  .vb{height:30px;padding-inline:10px;background:var(--wh);border:1px solid var(--ink);font-size:12px;line-height:16px}
  /* checkboxes 20px on phones */
  input.ck.ck,.vb .ckv{width:20px;height:20px}
  input.ck.ck:checked,[aria-pressed="true"] > .ckv{background-size:15px 15px}
  .vb.dimt{gap:6px}
  #planBtn[aria-expanded="true"]{background:var(--or)}
  .scene{flex:1 1 0}
  .notes{left:10px;right:auto;bottom:10px;align-items:flex-start;max-width:calc(100% - 20px)}
  .note{padding:3px 8px;font-size:11px;line-height:14px;border-width:1px}
  .msg-chip{display:flex;align-items:center;gap:6px;max-width:100%}
  .msg-chip .tag{font-size:10px;line-height:14px;padding:0 4px}
  .msg-chip .mc-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
  .msg-chip.err{border-color:var(--warn);color:var(--warn)}
  .mtitle{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:8px;flex:0 0 32px;height:32px;padding-inline:16px;background:var(--con);border-top:1px solid var(--ink);border-bottom:1px solid var(--line)}
  .mtitle b{font-size:13px;font-weight:700;line-height:16px;color:var(--txt);white-space:nowrap}
  .mtitle > span:not(.grow){min-width:0;font-size:11px;line-height:14px;color:var(--m1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .m-info{flex:0 0 auto;height:32px;margin-right:-8px;padding-inline:8px;font-size:13px;line-height:16px;color:var(--m1)}
  .m-info[aria-expanded="true"]{color:var(--ink)}
  .sec{display:none}
  .app[data-tab="cargo"] #secCargo,.app[data-tab="space"] #secSpace,.app[data-tab="load"] #secLoad{display:flex}
  .app[data-layout="bottom"] #secCargo{display:none}
  .app[data-layout="bottom"][data-tab="cargo"] #secCargo{display:flex}
  .sec-head{display:none}
  .sec[data-open] .sec-body{display:flex}
  .disc,.cond > .grow-v{display:none}
  .ct{display:none!important}
  /* no padding of our own under the tabs: in Safari its toolbar covers the home-indicator zone, and the home-screen app
     gets the real inset from env() */
  .tabbar{order:5;flex:0 0 auto;display:flex;height:calc(56px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);background:var(--wh);border-top:1px solid var(--ink)}
  .tab{flex:1 1 0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;margin-top:-1px;border-top:3px solid transparent;font-size:12px;line-height:16px;color:var(--m3)}
  .tab svg{display:block}
  .tab[aria-selected="true"]{border-top-color:var(--ink);color:var(--ink);font-weight:700}

  /* sheets: from the bottom over a dimmed page */
  .ov{z-index:40}
  .cmp,.plan,.ld,.hs-list,.sheet,.msg.as-sheet,.cpy{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:41;width:auto;max-width:none;max-height:85dvh;transform:none;display:flex;flex-direction:column;overflow-y:auto;background:var(--wh);border:0;border-top:2px solid var(--ink);box-shadow:none;padding-bottom:env(safe-area-inset-bottom,0px)}
  .cmp[hidden],.plan[hidden],.ld[hidden],.hs-list[hidden],.sheet[hidden],.cpy[hidden]{display:none!important}
  .grab{display:flex;justify-content:center;flex:0 0 auto;padding:8px 0 4px}
  .grab i{width:40px;height:4px;background:var(--faint)}
  .sh-h{display:flex;flex:0 0 auto;align-items:stretch;height:44px;border-bottom:1px solid var(--ink)}
  .sh-h h2{flex:1 1 0;min-width:0;display:flex;align-items:center;padding-left:16px;font-size:15px;font-weight:700;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sh-x{flex:0 0 52px;width:52px;border-left:1px solid var(--line);font-size:18px;line-height:22px;color:var(--txt)}
  .cmp{max-height:calc(100dvh - 120px)}
  .cmp-h{position:static;height:44px;background:var(--wh);border-bottom:1px solid var(--ink);padding-left:16px}
  .cmp-ht{flex-direction:column;align-items:flex-start;justify-content:center;gap:0}
  .cmp-h h2{font-size:15px;line-height:18px;color:var(--txt)}
  .cmp-sub{font-size:11px;line-height:14px;color:var(--m1)}
  .cmp-x{flex:0 0 52px;width:52px;height:44px;padding:0;border-left:1px solid var(--line);font-size:0;color:var(--txt)}
  .cmp-x::after{content:"×";font-size:18px;line-height:22px}
  .ctab th{height:28px;background:var(--pap);border-bottom:1px solid var(--line)}
  .ctab th:first-child,.ctab td:first-child{padding-left:16px}
  .ctab th:last-child,.ctab td:last-child{padding-right:16px}
  .ctab td{height:46px}
  .ctab td:first-child{font-size:14px;line-height:18px}
  .ctab tbody tr.is-cur{background:var(--sel)}
  .ctab tbody tr.is-cur td:first-child{padding-left:12px;box-shadow:inset 4px 0 0 var(--or)}
  .ctab col.c1{width:40px}.ctab col.c2{width:70px}.ctab col.c3{width:56px}.ctab col.c4{width:70px}
  .ctab.single col.c1{width:58px}.ctab.single col.c2{width:58px}.ctab.single col.c3{width:52px}.ctab.single col.c4{width:70px}
  .howto{display:flex}
  #rowsHowtoIn{display:none}
  .rows-h .sec-info{visibility:hidden}
  .add-row{padding:14px 16px 0}
  .add-b{height:46px;font-size:15px}
  .cmp-note{padding:10px 16px 30px}
  .plan{max-height:80dvh}
  .plan-h{background:var(--wh);height:44px;border-bottom:1px solid var(--ink)}
  .plan-h h2{padding-left:16px;font-size:15px;line-height:18px;color:var(--txt)}
  .px{flex-basis:52px;width:52px;border-left-color:var(--line);font-size:18px;color:var(--txt)}
  .plan-b{padding:12px 16px 24px}
  .ld{max-height:80dvh}
  /* the saved boxes stay in the page, under the add row (no sheet, no dimming): the keyboard stays up */
  .add-area > .ld{position:static;z-index:auto;width:auto;max-width:none;max-height:none;margin:-4px 12px 14px 16px;border:1.5px solid var(--ink);box-shadow:none;padding-bottom:0;overflow:visible}
  .add-area > .ld .ld-list{max-height:none}
  .cmp > *,.plan > *,.sheet > *,.cpy > *,.ld > :not(.ld-list){flex-shrink:0}
  .ld-list{max-height:none;flex:1 1 auto}
  .ld-row{height:48px;padding-inline:16px}
  .ld-f{height:48px;padding-inline:16px}
  .srch{padding-inline:16px}
  .hs-list{max-height:70dvh;overflow:hidden}
  .hs-list .msg-sh{display:flex}
  .ld.nhd{width:auto}
  .nhd .msg-sh{display:flex}
  .hs-items{flex:1 1 auto;min-height:0;max-height:none}
  .hs-item{height:46px;padding-inline:16px;font-size:14px}
  .sheet{padding-bottom:max(22px,env(safe-area-inset-bottom,0px))}
  .mm{display:flex;align-items:center;height:52px;padding-inline:16px;border-bottom:1px solid var(--line);font-size:15px;line-height:18px;color:var(--txt);text-align:left}
  .mm:active{background:var(--pap)}
  .mm-st{margin-left:auto;font-size:13px;font-weight:700;color:var(--m1)}
  .mm[aria-pressed="true"] .mm-st{color:var(--or)}
  .vb.lite{display:none}
  .mm-note{padding:12px 16px 4px;font-size:12px;line-height:18px;color:var(--m1)}
  .msg.as-sheet{max-height:75dvh}
  .msg.as-sheet .msg-line{display:flex;flex-wrap:wrap;padding:12px 16px 4px}
  .msg.as-sheet .msg-t{white-space:normal;font-size:13px;line-height:20px;flex-basis:100%}
  .msg.as-sheet .msg-more,.msg.as-sheet .msg-tot{display:none}
  .msg.as-sheet .msg-err{display:block;margin:6px 16px 0}
  .msg.as-sheet .msg-detail{max-height:none;overflow:visible;overflow-x:auto;padding:8px 16px 16px;font-size:13px;line-height:20px}
  .msg.as-sheet .mix th,.msg.as-sheet .mix td{padding-inline:5px}
  .msg.as-sheet .msg-sh{display:flex}
  .msg.as-sheet .vw-msg:not(:empty){display:block;margin-top:8px;padding:6px 10px 8px;border:1px solid var(--line)}
  /* a sheet taller than the screen scrolls, its parts keep their height (the sentence is not cut under the block) */
  .msg.as-sheet > *{flex-shrink:0}
  .msg.as-sheet #mixTable:not([hidden]) + .vw-msg{margin-top:10px}
  .mix{font-size:12px}
  .cpy{transform:none}
  .cpy-h{background:var(--wh);border-bottom:1px solid var(--ink)}
  .cpy-h h2{color:var(--txt);font-size:15px;padding-left:16px}
  .cpy-h .px{color:var(--txt);border-left-color:var(--line)}
  /* 保存した箱: the whole screen, list then edit */
  .bx{z-index:41;left:0;top:0;right:0;bottom:0;transform:none;width:auto;height:auto;max-width:none;max-height:none;border:0;box-shadow:none;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);background:var(--wh)}
  .bx-h{height:44px}
  .bx-h h2{padding-left:16px}
  .bx-store{display:none}
  .bx-b{flex-direction:column}
  .bx-lc{border-right:0}
  .bx[data-step="edit"] .bx-lc,.bx[data-step="list"] .bx-ec{display:none}
  .bx-ec{flex:1 1 0;width:auto}
  .bx-back{display:flex;align-items:center;height:44px;margin-left:-6px;padding-inline:6px;font-size:13px;font-weight:700;color:var(--txt)}
  .bx-eh{padding-inline:16px}
  .bx-lh{padding:0 16px}
  .bx-it{height:52px;padding:0 16px}
  .bx-c1{flex-basis:auto;padding-left:10px}
  .bx-c3,.bx-lh .bx-c3{display:none}
  .bx-it{flex-wrap:nowrap}
  .bx-f{padding:16px}
  .bx-ft{padding:14px 16px 16px}
  .toast{top:calc(env(safe-area-inset-top,0px) + 52px);bottom:auto;transform:translate(-50%,-12px)}
  .toast.show{transform:translate(-50%,0)}
}
@media (max-width:420px){
  /* the 運賃 block of a pallet 置き場所 a little tighter, so 置き場所 still needs no scrolling */
  .vw{line-height:15px}
  .bx-c2{flex-basis:56px}
  .bx-it .bx-c1{font-size:12px}
}
/* phones up to 410px (iPhone SE to 16, most Androids): a row's gaps, ×, its right padding and the box drawn a little
   narrower, so 4-digit sizes keep one line (375px: 110px for them, 「4500×3200×2800」 is 97; it was 89) */
@media (max-width:410px){
  .cond{--rg:5px;--rpr:12px;--xw:22px}
  .box-ic{width:18px;height:18px}
}
/* phones under 375px: the weight and the quantity narrower too, so the name and the sizes still show (sizes longer than
   that go on to a second line). ↑ / ↓ keep their 40px for a finger down to 341 (the narrower fields and gaps make up for
   them); only under 341 do they give way (below). A 7-figure 数量 (120,000) keeps its figures whole */
@media (max-width:374px){
  .cond{--kgw:56px;--qtw:76px}
  .qtw.long .qty{padding-left:2px;padding-right:4px}
}
/* 320px phones: ↑ / ↓ 32px, the fields narrower still; the bar over the 3D (switcher, 配置図, 寸法) keeps its 10px inset
   on the right */
@media (max-width:340px){
  .cond{--rg:5px;--rpr:12px;--kgw:54px;--qtw:70px;--xw:20px}
  /* the quantity without its 箱 (数量 is over it); the tiles their names only */
  .qtu{display:none}
  .tile > svg{display:none}
  .qtw .qty{padding-right:8px}
  /* 「12.5」 whole in the 54px weight: kg 1px further right, the figures 2px closer to it */
  .box-row .kgw input{padding-right:18px}
  .box-row .kgu{right:4px}
  .box-ord{flex-basis:32px;margin-right:-4px}
  .vbar{gap:4px}
  .vb{padding-inline:5px}
  .vb.dimt{gap:4px}
}
/* このツールについて: what the tool does and a short FAQ, in the HTML so search engines read it. PC: a dialog over a
   dimmed page, opened from the header; phones: a sheet from the bottom, opened from ⋯. Plus the message without JavaScript */
.about{width:640px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 48px);margin:auto;padding:0;border:2px solid var(--ink);border-radius:0;background:var(--wh);color:var(--txt);box-shadow:8px 8px 0 rgba(28,28,26,.25);overflow:hidden}
.about:not([open]){display:none}
.about[open]{display:flex;flex-direction:column}
.about::backdrop{background:rgba(28,28,26,.45)}
.about > *{flex-shrink:0}
.ab-h{display:flex;align-items:stretch;height:44px;background:var(--ink)}
.ab-h h2{flex:1 1 0;min-width:0;display:flex;align-items:center;padding-left:18px;font-size:15px;font-weight:700;line-height:18px;color:#F2F1ED;white-space:nowrap}
.ab-x{flex:0 0 52px;width:52px;border-left:1px solid var(--dk-line);font-size:18px;line-height:22px;color:#F2F1ED}
.ab-x:hover{background:#2B2B29}
.about .ab-b{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:18px 20px 22px;font-size:13px;line-height:21px}
.ab-lead{font-size:14px;line-height:23px}
.ab-dl,.ab-faq{margin:0}
.ab-dl{margin-top:16px;border-top:2px solid var(--ink)}
.ab-dl > div{display:flex;gap:14px;padding:10px 0;border-bottom:1px solid var(--line)}
.ab-dl dt{flex:0 0 64px;font-weight:700}
.ab-dl dd{flex:1 1 0;min-width:0;margin:0}
.ab-q{margin-top:22px;padding-bottom:6px;border-bottom:2px solid var(--ink);font-size:13px;font-weight:700;line-height:16px}
.ab-faq dt{padding-top:10px;font-weight:700}
.ab-faq dd{margin:2px 0 0;padding-bottom:10px;border-bottom:1px solid var(--line);color:var(--m2)}
.ab-f{display:flex;align-items:center;gap:6px;padding:10px 20px;background:var(--pap);border-top:1px solid var(--line);font-size:12px;line-height:16px;color:var(--m1)}
.ab-f a{color:var(--txt);font-weight:700;text-underline-offset:3px}
.nojs{position:fixed;left:50%;top:50%;z-index:70;transform:translate(-50%,-50%);width:min(520px,calc(100vw - 32px));padding:16px 18px;background:var(--wh);border:2px solid var(--ink);box-shadow:8px 8px 0 rgba(28,28,26,.25);font-size:13px;line-height:21px;color:var(--txt)}
.nojs p + p{margin-top:6px}
.nojs .nojs-t{font-size:15px;font-weight:700;line-height:20px}
@media (max-width:980px){
  .about{top:auto;bottom:0;left:0;right:0;width:100%;max-width:none;max-height:85dvh;margin:0;border:0;border-top:2px solid var(--ink);box-shadow:none}
  .ab-h{background:var(--wh);border-bottom:1px solid var(--ink)}
  .ab-h h2{padding-left:16px;color:var(--txt)}
  .ab-x{border-left-color:var(--line);color:var(--txt)}
  .ab-x:hover{background:var(--pap)}
  .about .ab-b{padding:14px 16px 18px}
  .ab-f{padding:10px 16px max(22px,env(safe-area-inset-bottom,0px))}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- short screens, landscape phones, tablets ---------- */
@media (max-width:980px){
  /* the 3D view takes a share of the screen's height (256 px on a tall phone, as before; less on a short one) */
  .viewport{flex-basis:clamp(120px,32dvh,256px);height:clamp(120px,32dvh,256px)}
  /* typing (the keyboard is up) or a short screen: the 3D view is a strip and the tab bar goes, so the field and its
     panel stay usable (ui/compact.ts) */
  .app.kb .viewport{flex-basis:48px;height:48px}
  .app.kb .notes,.app.kb #labels,.app.kb #tagLayer{display:none}
  .app.kb .tabbar{display:none}
}
/* tablets (portrait): a taller 3D view, and its view buttons */
@media (min-width:600px) and (max-width:980px) and (min-height:701px){
  .viewport{flex-basis:clamp(256px,42dvh,600px);height:clamp(256px,42dvh,600px)}
  .vseg{display:flex;height:30px;background:var(--wh);border:1px solid var(--ink)}
  .vseg button{padding-inline:10px;font-size:12px}
  .vseg button:first-child{border-left:0}
}
/* phones on their side: the 3D view (and the result above it) left, the inputs right, a slim tab bar under them */
@media (min-width:560px) and (max-width:980px) and (max-height:500px) and (orientation:landscape){
  .app{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
  .body{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,46%);grid-template-rows:auto minmax(0,1fr)}
  .sum-sp{grid-column:1;grid-row:1}
  .viewport,.app.kb .viewport{grid-column:1;grid-row:2;flex-basis:auto;height:auto;min-height:0}
  .cond{grid-column:2;grid-row:1 / 3;border-left:2px solid var(--ink)}
  .tabbar{height:calc(40px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px)}
  .tab{flex-direction:row;gap:6px}
  .tab svg{width:18px;height:18px}
  .app.kb .notes,.app.kb #labels,.app.kb #tagLayer{display:revert}
  /* 運賃 of a pallet 置き場所: one line here (the whole block in 詳しく), so the panel needs no scrolling */
  #vwBox > .vw-c,#vwBox > .vw-l,#vwBox > .vw-t{display:none}
  #vwBox > .vw-s{display:flex}
  #vwBox{padding-top:2px;padding-bottom:2px;line-height:15px}
  /* 詳しく as tall as the other sheets here, so the block and the sentence fit */
  .msg.as-sheet{max-height:85dvh}
}

/* a weight that leaves out boxes with no weight; a 入るだけ row that got nothing */
.uw{margin-left:4px;font-size:.8em;color:var(--warn)}
.zero0{font-family:var(--f-body);font-size:12px;font-weight:700;line-height:16px;color:var(--warn)}
.c-nm .zero0{margin-left:6px}
.zero0[hidden]{display:none}
/* phones: the result's one line — the short name may give way, 「×N本」 never does */
#mNeed{display:flex;min-width:0}
#mNeed .nm{min-width:0;overflow:hidden;text-overflow:ellipsis}
#mNeed .nn{flex:0 0 auto}
.ss-a.two{flex-direction:column;align-items:flex-start;justify-content:center;gap:0}
.ss-a.two .arr{display:none}
.ss-a.two b{line-height:16px}
.ss-a.two #mNeed{max-width:100%;font-size:12px;line-height:15px}
/* The plans (Paper「v27 保存③ 全パターン」; ui/plans.ts): the open plan's name and state in the header (phones: a row
   under it), the strip of a shared plan, the list (a dropdown on PC, a sheet on phones), its ⋯ menu, the one-time
   note. The app's own colours, borders and buttons (app.css); light only. */
:root{
  --dk-warn:#FF8A8F;      /* warn on black (このブラウザでは保存できません) */
}

/* ---------- header: the plan's name, 名前を付けて残す, the state ----------
   The buttons at the right keep their size; the plan's name gives way (…) */
.top-actions{flex-shrink:0}
.plh{position:relative;flex:0 1 auto;min-width:0;display:flex;align-items:center;gap:4px;height:48px;margin-left:18px;padding-right:14px;border-left:1px solid var(--dk-line)}
.plh[data-mode="unnamed"]{gap:6px;padding-right:12px}
.plh-t{position:relative;flex:0 1 auto;min-width:0;display:flex;align-items:center;gap:8px;height:48px;padding:0 10px 0 16px;color:#F2F1ED}
.plh-t:hover{background:#2B2B29}
.plh-lk{flex:0 0 auto;display:none;color:var(--dk-mut)}
.plh[data-mode="shared"] .plh-lk{display:block}
.plh-n{min-width:0;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:700;line-height:18px}
.plh[data-mode="unnamed"] .plh-n{font-weight:500;color:var(--off)}
.plh-dd{flex:0 0 auto;display:block;color:var(--dk-mut)}
/* the list open: the name is a white tab joined to it */
.plh-t[aria-expanded="true"]{z-index:22;align-self:flex-start;height:50px;padding-right:14px;background:var(--wh);color:var(--ink);box-shadow:inset 2px 0 0 var(--ink),inset -2px 0 0 var(--ink)}
.plh-t[aria-expanded="true"] .plh-n{color:var(--ink)}
.plh-t[aria-expanded="true"] .plh-dd,.plh-t[aria-expanded="true"] .plh-lk{color:var(--ink)}
.plh-keep{flex:0 0 auto;display:flex;align-items:center;height:48px;padding-inline:4px;font-size:13px;font-weight:700;line-height:16px;color:#F2F1ED;text-decoration:underline 1px;text-underline-offset:4px;white-space:nowrap}
.plh-keep:hover{color:var(--wh);text-decoration-thickness:2px}
.plh-st{flex:0 0 auto;display:flex;align-items:center;gap:5px;font-size:12px;line-height:16px;color:var(--dk-mut);white-space:nowrap}
.plh-st svg{flex:0 0 auto;display:none}
.plh-st[data-st="auto"] .i-ok,.plh-st[data-st="saved"] .i-ok,.plh-st[data-st="shared"] .i-no,.plh-st[data-st="fail"] .i-warn{display:block}
.plh-sts{display:none}
.plh-st[data-st="saved"]{color:#F2F1ED}
.plh-st[data-st="fail"]{font-weight:700;color:var(--dk-warn)}
/* 名前を付けて残す / 名前を変える: the name becomes a field */
.plh.editing{padding-inline:12px}
.plh.editing > :not(.plh-ed){display:none}
.plh-ed{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px}
.plh-ed input{flex:0 1 264px;width:264px;min-width:96px;height:32px;padding:0 8px;border:0;border-radius:0;background:var(--wh);box-shadow:inset 0 -2px 0 var(--or);font-size:14px;line-height:18px;color:var(--txt)}
.plh-ed input:focus{outline:none}
.plh-ed input::selection{background:#FFD3BD;color:var(--txt)}
.plh-ok{flex:0 0 auto;display:flex;align-items:center;justify-content:center;min-width:64px;height:32px;padding-inline:12px;background:var(--or);font-size:13px;font-weight:700;line-height:16px;color:var(--ink);white-space:nowrap}
.plh-ok:hover:not(:disabled){background:#FF7440}
.plh-ok:disabled{background:var(--con);color:var(--m3)}
.plh-no{flex:0 0 auto;height:32px;padding-inline:6px;font-size:13px;line-height:16px;color:#F2F1ED;white-space:nowrap}
.plh-no:hover{text-decoration:underline;text-underline-offset:3px}
/* 100 plans: under the field */
.plh-full{position:absolute;left:12px;top:calc(100% + 7px);z-index:30;padding:12px 14px 12px 12px;background:var(--wh);border:2px solid var(--ink);border-left:5px solid var(--warn);box-shadow:var(--sh);font-size:13px;font-weight:700;line-height:20px;color:var(--warn);white-space:nowrap}

/* ---------- a shared plan: the strip under the header ---------- */
.shbar{flex:0 0 auto;display:flex;align-items:center;gap:12px;min-height:44px;padding:7px 20px;background:var(--sel);border-bottom:1px solid var(--pal-line)}
.shbar-i{flex:0 0 auto;display:block;color:var(--best)}
.shbar-t{min-width:0;padding-right:8px;font-size:13.5px;font-weight:700;line-height:18px;color:var(--ink)}
.shbar .btn-or,.shbar .btn-ol{flex:0 0 auto;height:30px;padding-inline:14px;font-size:13px;line-height:16px}

/* ---------- the list ---------- */
.pd{position:fixed;z-index:20;width:420px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 60px);display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:6px 6px 0 rgba(28,28,26,.2)}
.pd > *{flex-shrink:0}
.pd-cur{display:flex;align-items:flex-end;gap:12px;padding:16px 18px}
.pd-ci{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:3px}
.pd-k{font-size:12px;line-height:16px;color:var(--m1)}
.pd-n{font-size:16px;font-weight:700;line-height:22px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pd-n.muted{font-weight:500;color:var(--m2)}
.pd-st{display:flex;align-items:center;gap:5px;font-size:12px;line-height:16px;color:var(--m1)}
.pd-st svg{flex:0 0 auto;display:block}
.pd-ca{flex:0 0 auto;display:flex;gap:6px}
.pd-b{display:flex;align-items:center;gap:6px;height:30px;padding-inline:12px;background:var(--wh);border:2px solid var(--ink);font-size:12.5px;font-weight:700;line-height:16px;color:var(--txt);white-space:nowrap}
.pd-b svg{flex:0 0 auto;display:block}
.pd-b:hover:not(:disabled){background:var(--pap)}
.pd-b:disabled{border-color:var(--con);background:var(--con);color:var(--m3)}
.pd-full{margin:0 18px 12px;padding:8px 10px;border-left:4px solid var(--warn);background:var(--pap);font-size:12px;font-weight:700;line-height:17px;color:var(--warn)}
.pd-lh{display:flex;align-items:baseline;gap:8px;margin-inline:18px;padding-bottom:8px;border-bottom:2px solid var(--ink)}
.pd-lh h3{font-size:14px;font-weight:700;line-height:18px;color:var(--ink)}
.pd-lh span{font-size:12px;line-height:16px;color:var(--m1)}
.pd-q{margin:8px 18px 0}
.pd-list{flex:0 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-inline:18px}
.pd-r{display:flex;align-items:center;border-bottom:1px solid var(--con)}
.pd-r:last-child{border-bottom:0}
.pd-r:not(.on):hover{background:var(--b-fill)}
.pd-r.on{background:var(--sel);box-shadow:inset 3px 0 0 var(--or)}
.pd-o{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:8px;height:56px;text-align:left;color:var(--txt)}
.pd-o:focus-visible{outline-offset:-2px}
.pd-ck{flex:0 0 22px;width:22px;display:flex;justify-content:center;color:var(--or)}
.pd-ck svg{display:block}
.pd-tx{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:3px}
.pd-nm{min-width:0;font-size:14px;font-weight:700;line-height:18px;color:var(--txt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pd-sm{min-width:0;font-size:12px;line-height:16px;color:var(--m1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pd-r.on .pd-sm{color:var(--m2)}
.pd-dt{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:84px;padding-right:8px;font-size:12px;line-height:16px;color:var(--m1);white-space:nowrap}
.pd-back{padding:0 6px;border:1px solid var(--pal-line);background:var(--sel);font-size:11px;font-weight:700;line-height:16px;color:var(--best)}
.pd-m{flex:0 0 28px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:var(--m1)}
.pd-m svg{display:block}
.pd-m:hover,.pd-m[aria-expanded="true"]{background:var(--con)}
.pd-m0{flex:0 0 28px}
/* the 名前のない計画: one muted row first */
.pd-r.slot{border-bottom:1px dashed var(--line)}
.pd-r.slot .pd-o{height:42px}
.pd-r.slot .pd-nm{flex:1 1 0;font-size:13px;font-weight:500;color:var(--m1)}
.pd-r.slot .pd-dt{color:var(--m3)}
.pd-none{padding:14px 0;font-size:12px;line-height:18px;color:var(--m1)}
/* a plan renamed in its row */
.pd-ed{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:8px;height:56px;padding-left:30px}
.pd-ed input{flex:1 1 0;min-width:0;height:32px;padding:0 8px;border:1px solid var(--b-chip);border-radius:0;background:var(--wh);box-shadow:inset 0 -2px 0 var(--or);font-size:14px;line-height:18px;color:var(--txt)}
.pd-ed input:focus{outline:none}
.pd-ed input::selection{background:#FFD3BD;color:var(--txt)}
.pd-eok{flex:0 0 auto;height:32px;padding-inline:12px;background:var(--or);font-size:13px;font-weight:700;line-height:16px;color:var(--ink)}
.pd-eok:disabled{background:var(--con);color:var(--m3)}
.pd-eno{flex:0 0 auto;height:32px;padding-inline:6px;font-size:13px;line-height:16px;color:var(--m2)}
/* ＋ 新しい計画, and its question when the 名前のない計画 has content (in the list, not a dialog) */
.pd-new{display:flex;padding:10px 18px 16px}
.pd-nb{flex:1 1 0;display:flex;align-items:center;justify-content:center;gap:8px;height:40px;border:1.5px dashed var(--b-dash);border-radius:10px;background:var(--wh);font-size:14px;font-weight:700;line-height:18px;color:var(--ink)}
.pd-nb svg{flex:0 0 auto;display:block}
.pd-nb:hover{background:var(--b-fill)}
.pd-ask{display:flex;flex-direction:column;gap:12px;padding:14px 18px 16px;background:var(--sel);border-top:1px solid var(--pal-line)}
.pd-ak{display:flex;align-items:center;gap:8px;font-size:12px;line-height:16px;color:var(--m1)}
.pd-ak svg{flex:0 0 auto;display:block}
.pd-ask p{font-size:13.5px;font-weight:700;line-height:20px;color:var(--txt)}
.pd-aa{display:flex;flex-wrap:wrap;gap:8px}
.pd-aa .btn-or,.pd-aa .btn-wo{flex:0 0 auto;height:36px;padding-inline:16px;font-size:13.5px}
.btn-wo{display:flex;align-items:center;justify-content:center;background:var(--wh);border:2px solid var(--warn);font-weight:700;line-height:18px;color:var(--warn);white-space:nowrap}
.btn-wo:hover{background:#FDF0F2}
/* ⋯ */
.pd-menu{position:fixed;z-index:30;width:160px;display:flex;flex-direction:column;background:var(--wh);border:2px solid var(--ink);box-shadow:4px 4px 0 rgba(28,28,26,.2)}
.pd-menu button{display:flex;align-items:center;height:38px;padding-inline:14px;border-bottom:1px solid var(--con);font-size:13px;line-height:16px;color:var(--txt);text-align:left;white-space:nowrap}
.pd-menu button:last-child{border-bottom:0}
.pd-menu button:hover:not(:disabled),.pd-menu button:focus-visible{outline:none;background:var(--sel);box-shadow:inset 3px 0 0 var(--or)}
.pd-menu button:disabled{color:var(--m3)}
.pd-menu .del{font-weight:700;color:var(--warn)}

/* ---------- the one-time note after the first name ---------- */
.pl-tip{position:fixed;z-index:35;width:392px;max-width:calc(100vw - 16px);display:flex;flex-direction:column;gap:12px;padding:14px 16px;background:var(--wh);border:2px solid var(--ink);box-shadow:var(--sh)}
.pl-tip::before{content:"";position:absolute;left:30px;top:-9px;width:14px;height:14px;background:var(--wh);border-left:2px solid var(--ink);border-top:2px solid var(--ink);transform:rotate(45deg)}
.pl-tip p{font-size:13px;line-height:21px;color:var(--txt)}
.pl-tip-a{display:flex;justify-content:flex-end}
.pl-tip .btn-ol{flex:0 0 auto;width:84px;height:30px;font-size:13px}

/* ---------- a note with 元に戻す ----------
   As wide as its words (up to the window less 16px each side), the phrases each on one line where they fit, the button
   after them or, when there is no room, on a line of its own (never a break inside a word) */
.toast.act{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;width:max-content}
.toast.act.show{pointer-events:auto}
.toast-m > span{display:inline-block}
.toast-a{font-weight:700;color:var(--or);text-decoration:underline 1px;text-underline-offset:3px;white-space:nowrap}
.toast-a:focus-visible{outline-offset:2px}
.toast:not(.show) .toast-a{visibility:hidden}

/* ---------- narrower PCs: the header keeps one line (Paper ⑪) ----------
   Under 1280px 「積荷リスト」 gives way first, then (under 1200px) the state is its mark only (its words in the title;
   storage failing keeps 「保存できません」);
   then (under 1130px) the buttons get tighter and (under 1100px) the tool's 積載シミュレーター goes. A long name is cut
   with … (the whole name in its title) */
@media (min-width:981px) and (max-width:1279px){
  .lay-l{display:none}
}
@media (min-width:981px) and (max-width:1199px){
  .plh-stt{display:none}
  .plh-st[data-st="fail"] .plh-sts{display:inline}
}
@media (min-width:981px) and (max-width:1129px){
  .tbtn{padding-inline:12px}
  .lay{padding-inline:12px}
}
@media (min-width:981px) and (max-width:1099px){
  .top h1 .b-sub{display:none}
  .plh{margin-left:12px}
}

/* ---------- tablets and phones (980px and under): the list as a sheet, the shared strip in two rows ---------- */
@media (max-width:980px){
  /* the words on one row (beside the mark), the two buttons on the next */
  .shbar{flex-wrap:wrap;gap:8px 10px;padding:8px 16px 10px}
  .shbar-t{flex:1 1 calc(100% - 26px);font-size:12.5px;line-height:17px;padding-right:0}
  .shbar-t span{font-weight:400}
  .shbar .btn-or,.shbar .btn-ol{flex:1 1 0;height:34px;padding-inline:10px;font-size:13px}
  .pd{left:0;right:0;top:auto;bottom:0;z-index:41;width:auto;max-width:none;max-height:85dvh;border:0;border-top:2px solid var(--ink);box-shadow:none;padding-bottom:max(12px,env(safe-area-inset-bottom,0px))}
  .pd .msg-sh{display:flex}
  .pd-cur{flex-direction:column;align-items:stretch;gap:12px;padding:14px 16px}
  .pd-ca .pd-b{height:36px;padding-inline:14px;font-size:13.5px}
  .pd-full{margin-inline:16px}
  .pd-lh{margin-inline:16px}
  .pd-q{margin-inline:16px}
  .pd-list{padding-inline:16px}
  .pd-new{padding:10px 16px 6px}
  .pd-ask{padding-inline:16px}
  .pd-m{flex-basis:40px;width:40px;height:40px}
  .pd-m0{flex-basis:40px}
  .pd-menu{z-index:42;width:200px}
  .pd-menu button{height:46px;font-size:14px}
  .pl-tip{z-index:42}
  .plh-ed input{font-size:16px}
}
/* ---------- tablets (561–980px; phones on their side too): the name in the header bar, as on PC — the PC-only
   buttons are gone there, so it has the room, and the inputs keep all their height ---------- */
@media (min-width:561px) and (max-width:980px){
  .top h1{flex:0 0 auto}
  .plh{flex:1 1 auto;height:44px;margin-left:12px}
  .plh-t,.plh-keep{height:44px}
  /* the list is a sheet here: the name stays as it is in the bar */
  .plh-t[aria-expanded="true"]{align-self:center;height:44px;padding-right:10px;background:none;box-shadow:none;color:#F2F1ED}
  .plh-t[aria-expanded="true"] .plh-n{color:#F2F1ED}
  .plh[data-mode="unnamed"] .plh-t[aria-expanded="true"] .plh-n{color:var(--off)}
  .plh-t[aria-expanded="true"] .plh-dd,.plh-t[aria-expanded="true"] .plh-lk{color:var(--dk-mut)}
}
@media (min-width:561px) and (max-width:767px){
  .top h1 .b-sub{display:none}
  .plh-st[data-st="fail"] .plh-stt{display:none}
  .plh-st[data-st="fail"] .plh-sts{display:inline}
}
/* ---------- phones (560px and under): the name on a row of its own under the header (Paper phone ①) ---------- */
@media (max-width:560px){
  .top{flex-wrap:wrap;height:auto;box-shadow:none}
  .top-actions{height:44px}
  .plh{order:5;flex:0 0 calc(100% + 16px);width:calc(100% + 16px);margin:0 0 0 -16px;height:40px;gap:10px;padding:0 16px;background:var(--wh);border-left:0;border-bottom:1px solid var(--line)}
  .plh[data-mode="unnamed"]{padding-right:16px}
  .plh-t{flex:1 1 0;height:40px;padding:0;color:var(--txt)}
  .plh-t:hover{background:none}
  .plh-n{max-width:none;color:var(--txt)}
  .plh[data-mode="unnamed"] .plh-n{color:var(--m2)}
  .plh-dd,.plh-lk{color:var(--ink)}
  .plh-t[aria-expanded="true"]{align-self:center;height:40px;padding-right:0;background:none;box-shadow:none}
  .plh-keep{height:40px;color:var(--txt)}
  .plh-keep:hover{color:var(--txt)}
  .plh-st{color:var(--m1)}
  .plh-st svg{color:var(--m3)}
  .plh-st[data-st="saved"]{color:var(--txt)}
  .plh-st[data-st="fail"],.plh-st[data-st="fail"] svg{color:var(--warn)}
  .plh.editing{padding-inline:12px}
  .plh-ed input{flex:1 1 0;width:auto;min-width:0;height:30px;border:1px solid var(--b-chip)}
  .plh-ok{height:30px;min-width:56px}
  .plh-no{height:30px;color:var(--m2)}
  .plh-full{left:12px;right:12px;white-space:normal}
  /* the notes under the plan's row, not over it */
  .toast{top:calc(env(safe-area-inset-top,0px) + 92px)}
}
@media (pointer:coarse){
  .pd-q input,.pd-ed input{font-size:16px}
}
.privacy{border-top:1px solid #ddd;padding-top:16px;margin-top:24px;font-size:13px;line-height:1.8}
.privacy h3{font-size:16px}
.privacy p{margin:10px 0}
