/* ---- tokens.css ---- */
/* =====================================================================
   デザインの定義（色・文字・余白・角・影・動き）。色を直接書いてよいのはこのファイルだけ
   （tests/design-system.test.js が、ほかの v2 の CSS に色コードがあると落とす）。
   使い方は views/components/README.md。
   ===================================================================== */
:root {
  /* 色: 文字と面 */
  --ink: #17181B;          /* 本文・見出し */
  --ink-2: #55595A;        /* 補足・ラベル */
  --ink-3: #7E8380;        /* 入力欄の例・無効 */
  --paper: #F4F4F0;        /* 基本の地 */
  --paper-2: #ECEDE7;      /* 一段沈めた地（帯・表の見出し） */
  --surface: #FFFFFF;      /* 入力欄・浮く面 */
  --mist: #E5E6E0;         /* 写真の読み込み中の地 */
  --night: #0D100E;        /* 暗い帯・映画の地 */
  --on-dark: #ECECE6;
  --on-dark-2: #A7ACA5;
  --rule: rgba(23, 24, 27, .13);       /* 区切り線 */
  --rule-strong: rgba(23, 24, 27, .32);
  --rule-dark: rgba(236, 236, 230, .16);
  --scrim: rgba(13, 16, 14, .34);

  /* 色: 意味 */
  --moss: #4C6B5C;         /* 自然・成功・送料無料 */
  --moss-2: #3D5A4C;
  --dew: #BCD6BF;
  --dew-2: #E3EEE4;
  --nasu: #3B2E52;         /* 主な操作（入れる・確定する） */
  --nasu-2: #2A2140;
  --nasu-3: #EDE9F3;
  --star: #A8782A;         /* 評価 */
  --heart: #C2533B;        /* お気に入り */
  --warn: #9A4A2E;         /* 残りわずか・注意 */
  --warn-bg: #F6EAE2;
  --danger: #B3261E;       /* 誤り・削除 */
  --danger-bg: #FBEAE8;
  --info: #2F5D78;
  --info-bg: #E6EFF4;
  --amber: #7A4F00;        /* これからやること（準備中）。状態のチップ */
  --amber-bg: #FCEFC7;
  --focus: #4C6B5C;
  --glow: rgba(236, 196, 120, .55);
  --seed: #F3DFA8;         /* 光の種（想いのページの結） */

  /* 文字 */
  --f-min: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --f-sans: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  /* 業務の画面（出品者・管理）。端末に入っている読みやすいゴシック（読み込みなし。数字の幅もそろう） */
  --f-work: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: clamp(20px, 1.8vw, 24px);
  --fs-2xl: clamp(24px, 2.6vw, 34px);
  --fs-3xl: clamp(30px, 4vw, 52px);
  --fs-4xl: clamp(36px, 5.4vw, 76px);
  --lh: 1.9;
  --ls: .03em;

  /* 余白（4 の倍数） */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 140px;
  --g: max(clamp(16px, 4vw, 56px), env(safe-area-inset-left, 0px));   /* 画面の左右の余白 */
  --gr: max(clamp(16px, 4vw, 56px), env(safe-area-inset-right, 0px));
  --max: 1440px;
  --hd: 64px;              /* ヘッダーの高さ */

  /* 角・影 */
  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(13, 16, 14, .06), 0 2px 8px rgba(13, 16, 14, .05);
  --shadow-2: 0 24px 50px -22px rgba(13, 16, 14, .45);
  --shadow-3: 0 40px 80px -30px rgba(13, 16, 14, .5);

  /* 動き */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-1: .2s;
  --t-2: .4s;
  --t-3: .7s;

  /* 重なり */
  --z-sticky: 20;
  --z-header: 80;
  --z-drawer: 86;
  --z-dialog: 90;
  --z-toast: 96;

  color-scheme: light;
}

/* ---- base.css ---- */
/* 全体の基本: リセット・文字組み・レイアウトの道具。画面固有の見た目はここに書かない */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hd) + 16px); interpolate-size: allow-keywords; }
body.v2 {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--fs-md);
  line-height: var(--lh);
  letter-spacing: var(--ls);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
:where(.v2) :where(img, svg, video) { display: block; max-width: 100%; }
:where(.v2) :where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.v2) a { color: inherit; text-underline-offset: 4px; }
:where(.v2) :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
:where(.v2) :where(h1, h2, h3, h4) {
  margin: 0;
  font-family: var(--f-min);
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.5;
  font-feature-settings: "palt" 1;
  text-wrap: balance;
}
:where(.v2) p { margin: 0; text-wrap: pretty; word-break: auto-phrase; line-break: strict; }
:where(.v2) :where(ul, ol) { margin: 0; padding: 0; list-style: none; }
:where(.v2) table { border-collapse: collapse; }
:where(.v2) hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-6) 0; }

/* 道具 */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-left: var(--g); padding-right: var(--gr); }
.wrap--narrow { max-width: 880px; }
.wrap--form { max-width: 640px; }
.nb { display: inline-block; }
.tnum { font-variant-numeric: tabular-nums; }
.min { font-family: var(--f-min); }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.note { font-size: var(--fs-xs); color: var(--ink-2); letter-spacing: .06em; line-height: 1.8; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.skip-link { position: absolute; left: var(--s-3); top: -60px; z-index: 100; padding: var(--s-2) var(--s-4); background: var(--ink); color: var(--paper); text-decoration: none; }
.skip-link:focus { top: var(--s-3); }

/* 画面の上下の余白（ヘッダーの下から始まる画面） */
/* 中身の上下の余白。業務の画面も読みものも、最初の画面に中身が入るように控えめにする */
.page { padding-top: calc(var(--hd) + env(safe-area-inset-top, 0px) + clamp(20px, 2.6vw, 40px)); padding-bottom: clamp(64px, 6vw, 104px); }
.page--flush { padding-top: 0; }
.section + .section { margin-top: clamp(72px, 9vw, 128px); }

/* 一字ずつ現れる見出し（--r: 0〜1 を JS が流す。--n は字数） */
.split .ch { display: inline-block; --t: clamp(0, calc((var(--r, 1) * (var(--n, 10) + 6) - var(--i, 0)) / 6), 1); opacity: var(--t); transform: translateY(calc((1 - var(--t)) * .45em)); filter: blur(calc((1 - var(--t)) * 10px)); }
/* 画面に入ると下からふわっと現れる（data-reveal） */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity var(--t-3) var(--ease), transform var(--t-3) var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .split .ch { --t: 1; }
}

/* ---- components/button.css ---- */
/* ボタン・文字のリンク・丸い操作ボタン
   .btn（主な操作・なす色）/ .btn--line（線だけ）/ .btn--ghost（地なし）/ .btn--danger / .btn--light（暗い地の上）
   大きさ: .btn--sm / .btn--lg、幅いっぱい: .btn--block。押したあとの成功表示: .is-done */
.btn {
  --bg: var(--nasu);
  --fg: var(--surface);
  --bd: var(--nasu);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 46px;
  padding: 0 var(--s-5);
  border: 1px solid var(--bd);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  letter-spacing: .16em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: background-color var(--t-2) var(--ease), border-color var(--t-2) var(--ease), color var(--t-2) var(--ease), transform var(--t-1) var(--ease);
}
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .18) 50%, transparent 65%); transform: translateX(-120%); transition: transform 1s var(--ease); pointer-events: none; }
.btn:hover { --bg: var(--nasu-2); --bd: var(--nasu-2); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--line { --bg: transparent; --fg: var(--ink); --bd: var(--ink); }
.btn--line:hover { --bg: var(--ink); --fg: var(--paper); --bd: var(--ink); }
.btn--ghost { --bg: transparent; --fg: var(--ink); --bd: transparent; }
.btn--ghost:hover { --bg: rgba(23, 24, 27, .06); --bd: transparent; }
.btn--moss { --bg: var(--moss); --bd: var(--moss); }
.btn--moss:hover { --bg: var(--moss-2); --bd: var(--moss-2); }
.btn--danger { --bg: transparent; --fg: var(--danger); --bd: var(--danger); }
.btn--danger:hover { --bg: var(--danger); --fg: var(--surface); --bd: var(--danger); }
.btn--light { --bg: var(--on-dark); --fg: var(--night); --bd: var(--on-dark); }
.btn--light:hover { --bg: var(--surface); --bd: var(--surface); }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); font-size: 12px; letter-spacing: .12em; }
.btn--lg { min-height: 52px; padding: 0 var(--s-6); font-size: 15px; }
.btn--block { display: flex; width: 100%; }
.btn--pill { border-radius: var(--r-pill); }
.btn.is-done { --bg: var(--moss); --bd: var(--moss); }
.btn .ck { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-dasharray: 24; stroke-dashoffset: 24; animation: btn-draw .5s .1s var(--ease) forwards; }
@keyframes btn-draw { to { stroke-dashoffset: 0; } }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fg); border-right-color: transparent; animation: btn-spin .7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* 文字のリンク（線が伸びる） */
.lnk { display: inline-flex; align-items: center; gap: var(--s-3); padding: 10px 0; border: 0; background: none; font-size: var(--fs-sm); letter-spacing: .16em; text-decoration: none; white-space: nowrap; cursor: pointer; color: inherit; }
.lnk i { display: block; width: 40px; height: 1px; background: currentColor; transform-origin: left; transition: transform .6s var(--ease); }
.lnk:hover i { transform: scaleX(1.5); }
.lnk--back i { order: -1; transform-origin: right; }

/* 丸い操作ボタン（アイコンだけ） */
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; transition: background-color var(--t-1); }
.icon-btn:hover { background: rgba(23, 24, 27, .06); }
.icon-btn svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ボタンを並べる */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.actions--end { justify-content: flex-end; }

/* ---- components/form.css ---- */
/* 入力欄・選ぶ札・数量の操作
   .field > label.field__label + input.input + p.field__help / p.field__error
   誤り: .field.is-error（または input[aria-invalid="true"]）。必須: label の中に <span class="req">必須</span> */
.field { display: grid; gap: 6px; min-width: 0; }
.field + .field { margin-top: var(--s-4); }
.field__label { font-size: var(--fs-sm); letter-spacing: .08em; color: var(--ink); font-weight: 500; }
.field__label .req { margin-left: 8px; font-size: 10px; letter-spacing: .1em; color: var(--warn); font-weight: 400; }
.field__label .opt { margin-left: 8px; font-size: 10px; color: var(--ink-3); font-weight: 400; }
.field__help { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.7; }
.field__error { font-size: var(--fs-xs); color: var(--danger); line-height: 1.7; }
.field__error:empty { display: none; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--s-4); }
.field-row > .field + .field { margin-top: 0; }

.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface);
  font-size: 16px;   /* iPhone で拡大されない大きさ */
  line-height: 1.6;
  transition: border-color var(--t-1), box-shadow var(--t-1);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(76, 107, 92, .18); }
.textarea { min-height: 120px; resize: vertical; }
.select { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field.is-error .input, .field.is-error .select, .field.is-error .textarea, [aria-invalid="true"] { border-color: var(--danger); }
.input[readonly], .input:disabled { background: var(--paper-2); color: var(--ink-2); }
.input--sm, .select--sm { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.select--sm { padding-right: 34px; background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; }

/* チェック・ラジオ（素の input に付ける） */
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--fs-md); line-height: 1.6; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--nasu); flex: none; }

/* 選ぶ札（ラジオ・チェックを札で見せる）。中の input は見えなくなる */
.choices { display: grid; gap: 8px; }
.choices--2 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.choice { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--rule); background: transparent; cursor: pointer; transition: border-color var(--t-2) var(--ease), background-color var(--t-2) var(--ease); }
.choice:hover { border-color: var(--rule-strong); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--ink); background: rgba(255, 255, 255, .6); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.choice:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.choice::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--nasu); transform: scaleY(0); transition: transform var(--t-2) var(--ease); }
.choice:has(input:checked)::before { transform: scaleY(1); }
.choice__title { font-weight: 500; letter-spacing: .06em; }
.choice__aside { font-family: var(--f-min); font-size: var(--fs-lg); white-space: nowrap; }
.choice__desc { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.7; }

/* 数量の操作 */
.stepper { display: inline-flex; align-items: center; height: 46px; border: 1px solid var(--rule-strong); background: var(--surface); }
.stepper button { width: 42px; height: 100%; border: 0; background: transparent; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: rgba(23, 24, 27, .05); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper input, .stepper output { width: 44px; border: 0; background: transparent; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (pointer: coarse) { .stepper button { width: 44px; } }   /* 指で押す画面は 44px 以上 */
.stepper--sm { height: 36px; }
.stepper--sm button { width: 34px; font-size: 15px; }

/* 切り替え（オン・オフ） */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track { width: 44px; height: 26px; border-radius: 13px; background: var(--rule-strong); position: relative; transition: background-color var(--t-2) var(--ease); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); transition: transform var(--t-2) var(--spring); }
.switch input:checked + .switch__track { background: var(--moss); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 3px; }

/* 検索の入力 */
.search { display: flex; align-items: center; gap: 12px; height: 48px; border-bottom: 1px solid var(--ink); }
.search svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.4; fill: none; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; letter-spacing: .06em; }
.search input::placeholder { color: var(--ink-3); }
.search:focus-within { border-bottom-width: 2px; }

/* フォームのまとまり（見出しつき） */
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset + .fieldset { margin-top: var(--s-6); padding-top: var(--s-6); border-top: 1px solid var(--rule); }
.fieldset__title { display: flex; align-items: baseline; gap: 14px; margin-bottom: var(--s-4); font-family: var(--f-min); font-size: var(--fs-xl); font-weight: 600; letter-spacing: .1em; }
.fieldset__title small { font-family: var(--f-sans); font-size: var(--fs-sm); font-weight: 400; color: var(--ink-2); letter-spacing: .06em; }

/* ---- components/chip.css ---- */
/* 絞り込みの札（.chip）・切り替え（.seg）・状態の札（.badge）・知らせの帯（.alert） */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--r-pill); background: transparent; font-size: 12px; letter-spacing: .08em; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--t-2), color var(--t-2), border-color var(--t-2); }
.chip:hover { border-color: var(--rule-strong); }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip[aria-current="page"], .chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .x { font-size: 14px; line-height: 1; opacity: .7; }

.seg { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.seg > * { height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 19px; background: transparent; font-size: var(--fs-sm); letter-spacing: .08em; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; transition: border-color var(--t-2), color var(--t-2); }
.seg > [aria-pressed="true"], .seg > [aria-current="page"], .seg > .is-on { border-color: var(--ink); color: var(--ink); }

/* 状態の札 */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; font-size: 10px; line-height: 1.8; letter-spacing: .12em; white-space: nowrap; border: 1px solid var(--rule-strong); color: var(--ink-2); background: transparent; }
.badge--fill { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.badge--moss { background: var(--moss); border-color: var(--moss); color: var(--surface); }
.badge--nasu { background: var(--nasu); border-color: var(--nasu); color: var(--surface); }
.badge--warn { color: var(--warn); border-color: currentColor; background: var(--surface); }
.badge--danger { color: var(--danger); border-color: currentColor; }
.badge--glass { background: rgba(244, 244, 240, .86); border-color: transparent; color: var(--ink); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* 状態のチップ: <span class="st st--amber">受け取り準備中</span>。色のついた面と点と太い字で、ひと目で分かるようにする。
   tone（amber=これからやる・info=進んでいる・moss=済んだ・danger=確かめる・mute=止まった・nasu=知らせ）は services/tradeStatus.js が決める。
   中に .dot を入れる書き方（<span class="st"><span class="dot dot--moss"></span>届いた</span>）も、点の色に合わせて同じ面になる */
.st { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px 2px 8px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--paper-2); color: var(--ink-2); font-size: 13px; font-weight: 700; line-height: 1.4; letter-spacing: 0; white-space: nowrap; vertical-align: middle; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.st > .dot { background: currentColor; }
.st--amber { background: var(--amber-bg); color: var(--amber); }
.st--info { background: var(--info-bg); color: var(--info); }
.st--moss { background: var(--dew-2); color: var(--moss-2); }
.st--danger { background: var(--danger-bg); color: var(--danger); }
.st--nasu { background: var(--nasu-3); color: var(--nasu); }
.st--mute { border-color: var(--rule); background: transparent; color: var(--ink-2); }
.st--mute::before { opacity: .5; }
/* 古い書き方（中に .dot）。:has を知らないブラウザでも上の色が捨てられないよう、決まりを分けて書く */
.st:has(> .dot)::before { display: none; }
.st:has(> .dot--warn) { background: var(--amber-bg); color: var(--amber); }
.st:has(> .dot--info) { background: var(--info-bg); color: var(--info); }
.st:has(> .dot--moss) { background: var(--dew-2); color: var(--moss-2); }
.st:has(> .dot--danger) { background: var(--danger-bg); color: var(--danger); }
.st:has(> .dot--nasu) { background: var(--nasu-3); color: var(--nasu); }
.st:has(> .dot:not([class*="dot--"])) { border-color: var(--rule); background: transparent; color: var(--ink-2); }
.sts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot--moss { background: var(--moss); }
.dot--nasu { background: var(--nasu); }
.dot--warn { background: var(--warn); }
.dot--danger { background: var(--danger); }
.dot--info { background: var(--info); }

/* 知らせの帯（ページの中） */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-left: 3px solid var(--ink-2); background: var(--paper-2); font-size: var(--fs-sm); line-height: 1.8; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.alert--ok { border-color: var(--moss); background: var(--dew-2); }
.alert--warn { border-color: var(--warn); background: var(--warn-bg); }
.alert--error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.alert--info { border-color: var(--info); background: var(--info-bg); }
.alert b { font-weight: 700; }

/* ---- components/page.css ---- */
/* 画面の頭・パンくず・節の見出し・空のとき・ページ送り・星・価格・カートの帯 */
.ph-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 32px; margin-bottom: clamp(20px, 2.4vw, 36px); }
.ph-head h1 { font-size: clamp(26px, 2.8vw, 38px); letter-spacing: .12em; line-height: 1.35; }
.ph-head p { margin-top: 8px; font-size: var(--fs-sm); letter-spacing: .1em; color: var(--ink-2); }
.ph-head__aside { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.ph-head--tool h1 { font-size: var(--fs-2xl); letter-spacing: .1em; }
@media (max-width: 899px) { .ph-head { grid-template-columns: minmax(0, 1fr); } }
/* 章の番号（壱・弐・参 + 線 + 章の名前）。画面によって pages/*.css で大きさを変えてよい */
.chno { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 12px; letter-spacing: .3em; color: var(--ink-2); }
.chno b { font-family: var(--f-min); font-weight: 600; font-size: clamp(34px, 3vw, 46px); line-height: 1; letter-spacing: 0; color: var(--ink); }
.chno i { display: block; width: 44px; height: 1px; background: currentColor; opacity: .5; }
.eyebrow { display: flex; align-items: center; gap: 14px; font-size: 11px; letter-spacing: .3em; color: var(--ink-2); }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: currentColor; }

.crumb { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--s-5); font-size: 12px; letter-spacing: .12em; color: var(--ink-2); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb li + li::before { content: "/"; margin-right: 10px; opacity: .6; }

.sh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; margin-bottom: clamp(20px, 2.4vw, 32px); }
.sh h2 { font-size: var(--fs-2xl); letter-spacing: .1em; }
.sh p { font-size: 12px; letter-spacing: .1em; color: var(--ink-2); }
.sh .sh__aside { margin-left: auto; }

.empty { padding: var(--s-7) 0 var(--s-5); text-align: center; }
.empty__mark { width: 56px; height: 56px; margin: 0 auto var(--s-4); stroke: var(--ink-3); fill: none; stroke-width: 1.1; }
.empty h2, .empty h3 { font-size: var(--fs-xl); letter-spacing: .08em; }
.empty p { margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-2); line-height: 2; }
.empty .actions { justify-content: center; margin-top: var(--s-5); }

.pager { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: var(--s-6); }
.pager a, .pager span { min-width: 44px; height: 44px; padding: 0 8px; display: inline-grid; place-items: center; font-size: 14px; text-decoration: none; border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.pager a:hover { border-color: var(--rule-strong); }
.pager [aria-current="page"] { border-color: var(--ink); }
.pager .gap { border: 0; color: var(--ink-3); }

.stars { display: inline-flex; gap: 1px; color: var(--star); }
.stars svg { width: 12px; height: 12px; fill: currentColor; }
.stars svg.off { fill: var(--rule); }
.stars--lg svg { width: 18px; height: 18px; }

.price { font-family: var(--f-min); font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.price small { font-family: var(--f-sans); font-size: .6em; font-weight: 400; color: var(--ink-2); margin-left: 4px; }

/* 開け閉めする説明（details） */
.acc { border-top: 1px solid var(--rule); }
.acc:last-of-type { border-bottom: 1px solid var(--rule); }
.acc summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; cursor: pointer; list-style: none; font-size: 14px; letter-spacing: .1em; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary i { position: relative; width: 12px; height: 12px; flex: none; }
.acc summary i::before, .acc summary i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; transition: transform .45s var(--ease); }
.acc summary i::after { transform: rotate(90deg); }
.acc[open] summary i::after { transform: rotate(0); }
.acc::details-content { block-size: 0; overflow: hidden; transition: block-size .5s var(--ease), content-visibility .5s allow-discrete; }
.acc[open]::details-content { block-size: auto; }
.acc__in { padding-bottom: 14px; font-size: 14px; line-height: 2.05; color: var(--ink-2); }

/* 読み込み中の地 */
.skel { background: linear-gradient(90deg, var(--mist) 25%, var(--paper-2) 50%, var(--mist) 75%); background-size: 200% 100%; animation: skel 1.4s ease infinite; }
@keyframes skel { to { background-position: -200% 0; } }

/* カートの帯（売り場・商品詳細の下に浮かぶ。送料無料までの残りもわかる） */
.cartbar { position: fixed; z-index: 75; right: max(24px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(500px, calc(100vw - 48px)); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: var(--r-pill); background: rgba(23, 24, 27, .9); color: var(--surface); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow-2); text-decoration: none; transform: translateY(160%); visibility: hidden; transition: transform .7s var(--spring), visibility 0s linear .7s; }
.cartbar.is-on { transform: none; visibility: visible; transition: transform .7s var(--spring), visibility 0s; }
.cartbar.bump { animation: cartbar-bump .5s var(--spring); }
@keyframes cartbar-bump { 40% { transform: translateY(-6px) scale(1.02); } }
.cartbar__th { display: flex; flex: none; }
.cartbar__th img { width: 34px; height: 34px; margin-left: -12px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; background: var(--ink-2); }
.cartbar__th img:first-child { margin-left: 0; }
.cartbar__tx { flex: 1; min-width: 0; font-size: 11px; line-height: 1.5; color: rgba(255, 255, 255, .75); }
.cartbar__tx b { margin-left: 4px; font-family: var(--f-min); font-size: 17px; font-weight: 600; color: var(--surface); }
.cartbar__go { flex: none; height: 44px; padding: 0 18px; border-radius: var(--r-pill); display: inline-flex; align-items: center; background: var(--surface); color: var(--ink); font-size: 13px; letter-spacing: .1em; }
@media (max-width: 899px) { .cartbar { left: 50%; right: auto; width: calc(100vw - 24px); transform: translate(-50%, 160%); } .cartbar.is-on { transform: translate(-50%, 0); } }
body.has-cartbar main { padding-bottom: 84px; }

/* ---- components/product-card.css ---- */
/* 商品カード（views/components/product-card.ejs）と、文字で並べる一覧の行（product-row.ejs）
   選ぶ（規格）・比べる（価格・1個あたり）・入れる（＋ → その場で数量の操作）をカードの上で終える */
.pc { position: relative; min-width: 0; display: flex; flex-direction: column; }
.pc-fig { position: relative; transform: perspective(900px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)); transition: transform .6s var(--ease); }
.pc-ph { display: block; position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--mist); }
.pc-ph img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: saturate(.9) contrast(1.03); transition: opacity .8s var(--ease), transform 1.6s var(--ease), filter 1.2s var(--ease); }
.pc-ph .i2 { opacity: 0; }
.pc-ph.is-empty::after { content: "写真の準備中"; position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-xs); letter-spacing: .2em; color: var(--ink-3); }
.pc-fig::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .26), transparent 46%); opacity: 0; transition: opacity .5s; }
@media (hover: hover) {
  .pc:hover .pc-ph .i2 { opacity: 1; }
  .pc:hover .pc-ph img { transform: scale(1.05); filter: saturate(1) contrast(1.04); }
  .pc:hover .pc-fig::after { opacity: 1; }
}
.pc.is-soldout .pc-ph img { filter: grayscale(.8) brightness(.9); }
.pc-bdg { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }

/* お気に入り */
.fav { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; color: var(--surface); cursor: pointer; }
.fav svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.6; fill: rgba(0, 0, 0, .08); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .4)); transition: fill .3s, stroke .3s; }
.fav[aria-pressed="true"] svg { fill: var(--heart); stroke: var(--heart); }
.fav.pop svg { animation: fav-pop .55s var(--spring); }
.fav.pop::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid var(--heart); animation: fav-ring .6s var(--ease) forwards; }
.fav--line { position: static; width: 46px; height: 46px; border: 1px solid var(--rule-strong); border-radius: 0; color: var(--ink); flex: none; }
.fav--line svg { filter: none; fill: transparent; }
.fav--line[aria-pressed="true"] svg { fill: var(--heart); }
@keyframes fav-pop { 30% { transform: scale(1.4); } 60% { transform: scale(.88); } 100% { transform: scale(1); } }
@keyframes fav-ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }

/* 入れる → 数量の操作に伸びる */
.cta { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 22px; overflow: hidden; color: var(--ink); background: rgba(244, 244, 240, .92); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .45); transition: width .55s var(--spring), background-color .35s var(--ease), color .35s; }
.cta.has { width: 126px; background: var(--nasu); color: var(--surface); }
.cta--inline { position: relative; right: auto; bottom: auto; flex: none; box-shadow: none; border: 1px solid var(--rule); background: transparent; }
.cta--inline.has { border-color: var(--nasu); }
.cta-add { position: absolute; right: 0; top: 0; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; transition: opacity .2s, transform .4s var(--spring); }
.cta-add svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.cta-add:active { transform: scale(.85); }
.cta-stp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; opacity: 0; pointer-events: none; transition: opacity .2s; }
.cta.has .cta-add { opacity: 0; pointer-events: none; }
.cta.has .cta-stp { opacity: 1; pointer-events: auto; transition: opacity .3s .18s; }
.cta-stp button { width: 42px; height: 44px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
.cta-stp output { min-width: 28px; text-align: center; font-size: 14px; font-weight: 700; }
.cta.is-off { display: none; }

.pc-meta { display: block; padding-top: 14px; text-decoration: none; }
.pc-mk { display: block; font-size: var(--fs-xs); letter-spacing: .14em; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-nm { margin-top: 2px; font-size: 18px; line-height: 1.5; letter-spacing: .08em; }
.pc-rt { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--fs-xs); color: var(--ink-2); }
.pc-pr { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-top: 10px; }
.pc-pr b { font-family: var(--f-min); font-weight: 600; font-size: 19px; letter-spacing: .02em; }
.pc-pr small { font-size: var(--fs-xs); color: var(--ink-2); }
.pc-pr em { font-style: normal; font-size: 10px; letter-spacing: .06em; color: var(--moss); border: 1px solid currentColor; padding: 0 6px; line-height: 1.7; }
.pc-low { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: var(--fs-xs); color: var(--warn); }

/* 規格の切り替え（すべる印つき） */
.vchips { position: relative; display: flex; gap: 2px; margin-top: 10px; padding: 3px; width: max-content; max-width: 100%; border-radius: var(--r-pill); background: var(--mist); overflow-x: auto; scrollbar-width: none; }
.vchips::-webkit-scrollbar { display: none; }
.vchips button { position: relative; z-index: 1; height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: transparent; font-size: 12px; color: var(--ink-2); white-space: nowrap; cursor: pointer; transition: color .3s; }
.vchips button[aria-checked="true"] { color: var(--ink); font-weight: 500; }
.vchips button:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.vchips .ind { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: var(--iw, 0px); border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 1px 5px rgba(0, 0, 0, .1); transform: translateX(var(--ix, 3px)); transition: transform .5s var(--ease), width .5s var(--ease); }

.pc--cmp .pc-nm { font-size: 15px; }
.pc--cmp .pc-pr b { font-size: 16px; }
@media (max-width: 899px) {
  .pc-nm { font-size: 15px; }
  .pc-pr b { font-size: 16px; }
  .vchips button { padding: 0 10px; font-size: 11px; }
}

/* 文字で並べる一覧の行 */
.prow { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 6px 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.prow__ph { width: 72px; aspect-ratio: 1; overflow: hidden; background: var(--mist); }
.prow__ph img { width: 100%; height: 100%; object-fit: cover; }
.prow h3 { font-size: 16px; letter-spacing: .08em; }
.prow h3 a { text-decoration: none; }
.prow__pr { font-family: var(--f-min); font-size: 17px; text-align: right; white-space: nowrap; }
.prow__pr small { display: block; font-family: var(--f-sans); font-size: 10px; color: var(--ink-2); }
@media (max-width: 899px) {
  .prow { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 4px 12px; }
  .prow__ph { width: 60px; }
  .prow__pr { grid-column: 2; grid-row: 2; text-align: left; }
  .prow .cta { grid-column: 3; grid-row: 1 / span 2; }
}

/* 並べ方 */
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px clamp(14px, 2vw, 28px); }
@media (min-width: 1101px) { .pgrid--stagger > .pc:nth-child(4n+2), .pgrid--stagger > .pc:nth-child(4n+4) { translate: 0 28px; } }
@media (max-width: 1100px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 899px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; } }
.rail { display: flex; gap: clamp(14px, 2vw, 30px); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: var(--g); padding: 0 var(--gr) 6px var(--g); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 clamp(200px, 18vw, 270px); scroll-snap-align: start; }
.rail--sm > * { flex-basis: clamp(160px, 14vw, 210px); }
@media (max-width: 899px) { .rail > * { flex-basis: 64vw; } .rail--sm > * { flex-basis: 44vw; } }

/* ---- components/table.css ---- */
/* 業務の一覧（表）。カードを並べず、表と区切り線で整理する
   .tbl（表）/ .tbl-wrap（横に流れる箱）/ スマホで1件ずつ縦に積む: .tbl--stack（td に data-label）
   .tbl--stack に .tbl--flow を足すと、行が低くなり、スマホでは「項目 値」を1行に流す（1件の高さを抑える。業務の一覧向け）
   上の操作の帯: .tbl-bar（検索・絞り込み・一括操作） */
.tbl-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--ink); }
.tbl { width: 100%; font-size: 14px; line-height: 1.6; }
.tbl th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; background: var(--paper-2); border-bottom: 1px solid var(--rule-strong); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .12em; color: var(--ink-2); text-align: left; white-space: nowrap; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl tbody tr { transition: background-color var(--t-1); }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .55); }
.tbl tbody tr.is-selected { background: var(--nasu-3); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .nowrap { white-space: nowrap; }
.tbl .tbl__main { font-weight: 500; text-decoration: none; }
.tbl .tbl__main:hover { text-decoration: underline; }
.tbl .tbl__sub { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.tbl .tbl__check { width: 44px; }
.tbl a.tbl__row-link::after { content: ""; position: absolute; inset: 0; }
.tbl tr:has(.tbl__row-link) { position: relative; cursor: pointer; }
.tbl-empty { padding: var(--s-8) var(--s-4); text-align: center; color: var(--ink-2); }

.tbl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-4) 0; }
.tbl-bar .search { height: 44px; min-width: min(320px, 100%); flex: 1; }
.tbl-bar__count { font-size: var(--fs-sm); color: var(--ink-2); letter-spacing: .08em; }
.bulk { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--s-3); width: max-content; max-width: 100%; margin: var(--s-4) auto 0; padding: 8px 8px 8px 20px; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); box-shadow: var(--shadow-2); transform: translateY(140%); opacity: 0; transition: transform var(--t-3) var(--spring), opacity var(--t-2); }
.bulk.is-on { transform: none; opacity: 1; }
.bulk .btn { min-height: 40px; border-radius: var(--r-pill); }

/* 項目と値を並べる（詳細画面） */
.dl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); border-top: 1px solid var(--rule); }
.dl > dt, .dl > dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.dl > dt { padding-right: var(--s-5); font-size: var(--fs-sm); color: var(--ink-2); letter-spacing: .08em; }
.dl > dd { font-size: var(--fs-md); min-width: 0; overflow-wrap: anywhere; }

@media (min-width: 761px) { .tbl--flow td { padding-block: 10px; } }
@media (max-width: 760px) {
  .tbl--stack thead { display: none; }
  .tbl--stack, .tbl--stack tbody, .tbl--stack tr, .tbl--stack td { display: block; width: 100%; }
  .tbl--stack tr { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .tbl--stack td { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border: 0; text-align: right; }
  .tbl--stack td::before { content: attr(data-label); color: var(--ink-2); font-size: var(--fs-xs); letter-spacing: .1em; text-align: left; flex: none; }
  .tbl--stack td[data-label=""]::before { display: none; }
  .tbl--stack td.tbl__lead { display: block; text-align: left; font-size: 15px; }
  .tbl--stack td.tbl__lead::before { display: none; }
  .tbl--flow tr { padding: 12px 0; }
  .tbl--flow td.tbl__lead { margin-bottom: 2px; }
  .tbl--flow td:not(.tbl__lead) { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 2px 6px; width: auto; max-width: 100%; margin-right: 16px; padding: 2px 0; text-align: left; }
  .tbl--flow td:not(.tbl__lead) > .tbl__sub { flex-basis: auto; margin-top: 0; text-align: left; }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .dl > dt { padding-bottom: 0; border-bottom: 0; }
  .dl > dd { padding-top: 4px; }
}

/* ---- components/dialog.css ---- */
/* 重なる画面: <dialog class="dlg">（中央の窓）/ <dialog class="dlg dlg--sheet">（横から・スマホは下から出る引き出し）
   開け閉めは public/js/v2/ui.js の UI.dialog（ブラウザ標準の dialog を使う）。確認は UI.confirm、知らせは UI.toast */
.dlg { width: min(560px, calc(100vw - 32px)); max-height: min(86svh, 900px); padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-3); opacity: 0; transform: translateY(16px) scale(.98); transition: opacity var(--t-2) var(--ease), transform var(--t-2) var(--ease), overlay var(--t-2) allow-discrete, display var(--t-2) allow-discrete; }
.dlg[open] { opacity: 1; transform: none; }
@starting-style { .dlg[open] { opacity: 0; transform: translateY(16px) scale(.98); } }
.dlg::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; transition: opacity var(--t-2), overlay var(--t-2) allow-discrete, display var(--t-2) allow-discrete; }
.dlg[open]::backdrop { opacity: 1; }
@starting-style { .dlg[open]::backdrop { opacity: 0; } }
.dlg__hd { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 18px 20px 14px 28px; border-bottom: 1px solid var(--rule); }
.dlg__hd h2 { font-size: var(--fs-xl); letter-spacing: .12em; }
.dlg__bd { padding: 24px 28px; overflow-y: auto; overscroll-behavior: contain; }
.dlg__ft { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-3); padding: 16px 28px 24px; border-top: 1px solid var(--rule); }
.dlg__ft .btn { min-width: 120px; }
.dlg--confirm { width: min(440px, calc(100vw - 32px)); }
.dlg--confirm .dlg__bd { font-size: var(--fs-md); line-height: 1.9; }

.dlg--sheet { margin: 0 0 0 auto; width: min(460px, 100vw); height: 100svh; max-height: none; flex-direction: column; transform: translateX(102%); background: rgba(244, 244, 240, .94); -webkit-backdrop-filter: blur(26px) saturate(1.3); backdrop-filter: blur(26px) saturate(1.3); transition: transform var(--t-3) var(--ease), opacity var(--t-2), overlay var(--t-3) allow-discrete, display var(--t-3) allow-discrete; }
.dlg--sheet[open] { display: flex; transform: none; opacity: 1; }
@starting-style { .dlg--sheet[open] { transform: translateX(102%); } }
.dlg--sheet .dlg__bd { flex: 1; }
@media (max-width: 899px) {
  .dlg--sheet { margin: auto 0 0; width: 100vw; max-width: none; height: auto; max-height: 90svh; border-radius: 18px 18px 0 0; transform: translateY(102%); }
  @starting-style { .dlg--sheet[open] { transform: translateY(102%); } }
  .dlg--sheet::before { content: ""; display: block; width: 36px; height: 4px; margin: 10px auto 0; border-radius: 2px; background: var(--rule-strong); flex: none; }
}

/* 知らせ（画面上部に出て、元に戻すこともできる） */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; top: calc(var(--hd) + env(safe-area-inset-top, 0px) + 12px); display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 24px); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: var(--r-pill); background: rgba(23, 24, 27, .92); color: var(--paper); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow-2); font-size: var(--fs-sm); line-height: 1.5; pointer-events: auto; animation: toast-in .5s var(--spring); }
.toast.is-out { animation: toast-out .35s var(--ease) forwards; }
.toast__img { width: 34px; height: 34px; margin-left: -8px; border-radius: 50%; object-fit: cover; flex: none; }
.toast__ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }
.toast--ok .toast__ic { color: var(--dew); }
.toast--error { background: var(--danger); }
.toast button { flex: none; padding: 6px 10px; border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, .12); color: inherit; font-size: 12px; cursor: pointer; }
.toast button:hover { background: rgba(255, 255, 255, .22); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---- components/work.css ---- */
/* 業務の画面（出品者 .seller-shell・管理 .admin-shell）の土台: 文字・左右の組み・メニュー（views/components/work-nav.ejs）。
   畑でスマホを片手に見ても読めることを先にする。公開側の明朝・広い字間・小さな字をやめ、端末のゴシックで太さと大きさで差をつける。
   PC（1000px 以上）は左にメニューの列。スマホは画面の下のタブ（親指で届く所）。 */
.seller-shell, .admin-shell {
  --f-min: var(--f-work);   /* 画面ごとの CSS が明朝を指していても、業務の画面ではゴシックになる */
  --f-sans: var(--f-work);
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 19px;
  --fs-2xl: 22px;
  --fs-3xl: 26px;
  --lh: 1.6;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--s-5);
  font-family: var(--f-work);
  font-size: var(--fs-md);
  line-height: var(--lh);
  font-feature-settings: normal;
}
/* 字間は画面ごとの CSS に広い値が散らばっているので、業務の画面ではここでまとめて詰める */
.seller-shell *, .admin-shell * { letter-spacing: normal !important; }   /* 画面ごとの CSS から字間を消し終えたら外す */
.seller-shell :where(h1, h2, h3, h4), .admin-shell :where(h1, h2, h3, h4) { font-weight: 700; line-height: 1.4; }
.seller-shell .ph-head h1, .admin-shell .ph-head h1 { font-size: clamp(22px, 2.2vw, 28px); }
.seller-shell .ph-head p, .admin-shell .ph-head p { font-size: var(--fs-sm); line-height: 1.6; }
.seller-shell .sh h2, .admin-shell .sh h2 { font-size: var(--fs-xl); }
.seller-shell .tbl th, .admin-shell .tbl th { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.seller-shell .tbl, .admin-shell .tbl { font-size: 14px; }
.seller-shell .tbl__main, .admin-shell .tbl__main { font-weight: 700; }
.seller-shell .price, .admin-shell .price { font-weight: 700; }
.seller-shell__main, .admin-shell__main { min-width: 0; }

/* PC の左の列 */
.wnav { display: none; }
.wnav__h { padding-bottom: var(--s-2); font-size: 12px; font-weight: 700; color: var(--ink-3); }
.wnav__list { display: grid; border-top: 1px solid var(--rule); }
.wnav a { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--rule); border-left: 3px solid transparent; font-size: 15px; color: var(--ink-2); text-decoration: none; transition: background-color var(--t-1), color var(--t-1); }
.wnav a .ic { flex: none; }
.wnav a:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.wnav a[aria-current="page"] { border-left-color: var(--nasu); background: var(--surface); color: var(--ink); font-weight: 700; }
.wnav a[aria-current="page"] .ic { color: var(--nasu); }

/* スマホの下のタブ */
.wtab { position: fixed; z-index: calc(var(--z-drawer) - 1);   /* メニューの引き出し（.drw）より下 */
  left: 0; right: 0; bottom: 0; display: flex; align-items: stretch; padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px)); background: var(--surface); border-top: 1px solid var(--rule-strong); box-shadow: 0 -6px 20px -14px var(--scrim); }
.wtab__a, .wtab__more { flex: 1 1 0; min-width: 0; }
.wtab__a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 60px; font-size: 11px; font-weight: 700; color: var(--ink-2); text-decoration: none; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.wtab__a::-webkit-details-marker { display: none; }
.wtab__a span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wtab__a[aria-current="page"], .wtab__more[open] > .wtab__a { color: var(--nasu); }
.wtab__a[aria-current="page"] .ic { stroke-width: 2; }
.wtab__plus { display: grid; place-items: center; width: 40px; height: 32px; border-radius: var(--r-pill); background: var(--nasu); color: var(--surface); }
.wtab__a--primary { color: var(--nasu); }
.wtab__more { position: relative; }
.wtab__sheet { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(300px, calc(100vw - 16px)); padding: 6px 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.wtab__sheet a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 18px; font-size: 16px; color: var(--ink); text-decoration: none; }
.wtab__sheet li + li a { border-top: 1px solid var(--rule); }
.wtab__sheet a[aria-current="page"] { color: var(--nasu); font-weight: 700; }

@media (max-width: 999px) {
  /* 下のタブに隠れないだけ空ける。一括操作の帯や画面の下に貼り付く操作もタブの上に出す */
  .seller-shell, .admin-shell { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .seller-shell .bulk, .admin-shell .bulk { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body:has(.wtab) .ft { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  /* 画面の下に保存・登録の帯が貼り付く入力の画面は、タブを隠して帯を親指の所に置く（Shopify の編集画面と同じ考え方） */
  body:has(:is(.savebar, .mo-bar, .pf-bar, .tool-form__foot, .ss-save, .dc-bar)) .wtab { display: none; }
  body:has(:is(.savebar, .mo-bar, .pf-bar, .tool-form__foot, .ss-save, .dc-bar)) :is(.seller-shell, .admin-shell) { padding-bottom: var(--s-5); }
  body:has(:is(.savebar, .mo-bar, .pf-bar, .tool-form__foot, .ss-save, .dc-bar)) .ft { padding-bottom: 0; }
  .seller-shell .ph-head, .admin-shell .ph-head { margin-bottom: var(--s-4); }
}
@media (min-width: 1000px) {
  .seller-shell, .admin-shell { grid-template-columns: 200px minmax(0, 1fr); column-gap: clamp(32px, 4vw, 56px); align-items: start; }
  .wnav { display: block; position: sticky; top: calc(var(--hd) + 24px); min-width: 0; }
  .wtab { display: none; }
}

/* ---- components/header.css ---- */
/* ヘッダー（views/partials/v2/header.ejs）・メニューの引き出し・検索の重ね
   ヘッダーの見え方は body の data-header と JS（shell.js）が決める:
   glass（すりガラス・既定）/ bare（透明。暗い写真の上で始まる画面）/ dark（暗い帯の上で文字を明るく） */
.hd { position: fixed; z-index: var(--z-header); top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: var(--hd); color: var(--ink); border-bottom: 1px solid transparent; background: transparent; transition: color .5s var(--ease), background-color .5s var(--ease), border-color .5s var(--ease), opacity .5s var(--ease); }
.hd.is-glass { background: rgba(244, 244, 240, .74); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); border-bottom-color: var(--rule); }
.hd.is-dark { color: var(--on-dark); }
.hd.is-dark.is-glass { background: rgba(13, 16, 14, .4); border-bottom-color: var(--rule-dark); }
body.v2::before { content: ""; position: fixed; z-index: calc(var(--z-header) + 1); inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--band, var(--paper)); }
.hd-in { height: 100%; max-width: var(--max); margin-inline: auto; padding-left: var(--g); padding-right: var(--gr); display: flex; align-items: center; gap: clamp(10px, 3vw, 44px); }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; white-space: nowrap; }
.brand b { font-family: var(--f-min); font-weight: 600; font-size: 19px; letter-spacing: .18em; }
.brand small { font-size: 10px; letter-spacing: .24em; opacity: .7; }
.hd-nav { display: flex; gap: 30px; font-size: var(--fs-sm); letter-spacing: .14em; }
.hd-nav a { position: relative; padding: 8px 0; text-decoration: none; }
.hd-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease); }
.hd-nav a:hover::after, .hd-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.hd-sp { flex: 1; }
.hd-acts { display: flex; align-items: center; gap: 2px; margin-right: -10px; }
.hd .icon-btn:hover { background: rgba(128, 128, 128, .14); }
.hd-cnt { position: absolute; top: 5px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--nasu); color: var(--surface); font-size: 10px; line-height: 17px; text-align: center; font-weight: 700; transition: transform .4s var(--spring); }
.hd-cnt:empty, .hd-cnt[data-n="0"] { display: none; }
.hd.is-dark .hd-cnt { background: var(--on-dark); color: var(--night); }
.hd-cnt.bump { transform: scale(1.45); }
.hd-dot { position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--heart); }
.hd-user { font-size: 12px; letter-spacing: .1em; text-decoration: none; padding: 8px 10px; white-space: nowrap; }
@media (max-width: 899px) { .hd-nav, .brand small, .hd-user, .hd .only-pc { display: none !important; } }
@media (min-width: 900px) { .hd .only-sp { display: none !important; } }

/* 戻る（トップ以外の画面。行き先は utils/backNavigation.js が決める） */
.hd-back { margin-left: -12px; margin-right: -8px; }
@media (max-width: 899px) { .hd-back + .brand b { font-size: 16px; } }

/* メニューの引き出し */
.drw { position: fixed; z-index: var(--z-drawer); inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) min(420px, 100%); visibility: hidden; transition: visibility 0s linear var(--t-3); }
.drw.is-open { visibility: visible; transition: visibility 0s; }
.drw__scrim { border: 0; padding: 0; background: var(--scrim); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; transition: opacity var(--t-3) var(--ease); cursor: pointer; }
.drw.is-open .drw__scrim { opacity: 1; }
.drw__panel { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: calc(env(safe-area-inset-top, 0px) + 12px) max(24px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) 28px; background: var(--night); color: var(--on-dark); transform: translateX(100%); transition: transform var(--t-3) var(--ease); }
.drw.is-open .drw__panel { transform: none; }
.drw__top { display: flex; align-items: center; justify-content: space-between; margin-right: -10px; }
.drw__user { margin-top: var(--s-4); padding-bottom: var(--s-4); border-bottom: 1px solid var(--rule-dark); font-size: var(--fs-sm); color: var(--on-dark-2); }
.drw__user b { display: block; font-family: var(--f-min); font-size: var(--fs-xl); color: var(--on-dark); letter-spacing: .1em; font-weight: 600; }
.drw__main a { display: block; padding: 12px 0; font-family: var(--f-min); font-weight: 600; font-size: 24px; letter-spacing: .14em; text-decoration: none; border-bottom: 1px solid var(--rule-dark); }
.drw__group { margin-top: var(--s-6); }
.drw__group h3 { margin-bottom: 6px; font-family: var(--f-sans); font-size: 10px; font-weight: 500; letter-spacing: .3em; color: var(--on-dark-2); }
.drw__group a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: var(--fs-md); text-decoration: none; letter-spacing: .08em; border-bottom: 1px solid var(--rule-dark); }
.drw__group a:hover { color: var(--surface); }
.drw__group .badge { color: var(--on-dark); border-color: var(--rule-dark); }
.drw__foot { margin-top: auto; padding-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3); }
.drw__foot form { margin: 0; }
.drw .btn--line { --fg: var(--on-dark); --bd: var(--on-dark-2); }
.drw .btn--line:hover { --bg: var(--on-dark); --fg: var(--night); }

/* 検索の重ね */
.so { position: fixed; z-index: var(--z-dialog); inset: 0; overflow-y: auto; background: rgba(244, 244, 240, .9); -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3); opacity: 0; visibility: hidden; transition: opacity var(--t-2) var(--ease), visibility 0s linear var(--t-2); }
.so.is-active { opacity: 1; visibility: visible; transition: opacity var(--t-2) var(--ease), visibility 0s; }
.so-in { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); padding-bottom: 80px; }
.so-top { display: flex; justify-content: flex-end; margin-right: -10px; }
.so form { margin-top: clamp(12px, 5vw, 64px); }
.so .search { height: 72px; }
.so .search input { font-family: var(--f-min); font-size: clamp(18px, 2.4vw, 28px); }
.so-h { margin-top: var(--s-6); font-size: 11px; letter-spacing: .24em; color: var(--ink-2); }
.so-words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.so-res { margin-top: var(--s-5); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 4px 32px; }
.so-res a { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.so-res a.is-active, .so-res a:hover { background: rgba(23, 24, 27, .04); }
.so-res .ph { width: 56px; aspect-ratio: 1; overflow: hidden; background: var(--mist); }
.so-res .ph img { width: 100%; height: 100%; object-fit: cover; }
.so-res b { font-family: var(--f-min); font-weight: 600; font-size: 16px; letter-spacing: .08em; }
.so-res b mark { background: transparent; color: var(--nasu); }
.so-res small { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.so-res .kind { font-size: 10px; letter-spacing: .14em; color: var(--ink-3); }

/* ---- components/footer.css ---- */
/* フッター（views/partials/v2/footer.ejs）。読み進めると「セッツマルシェ」の大きな字が左から満ちる（--ff） */
.ft { position: relative; overflow: hidden; background: var(--night); color: var(--on-dark-2); }
.ft-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 24px; padding-block: clamp(90px, 10vw, 140px) 40px; font-size: var(--fs-sm); letter-spacing: .08em; }
.ft-about { grid-column: 1 / span 4; line-height: 2.1; }
.ft-about b { display: block; margin-bottom: 14px; font-family: var(--f-min); font-weight: 600; font-size: 18px; letter-spacing: .18em; color: var(--on-dark); }
.ft-col { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; }
.ft-about + .ft-col { grid-column: 7 / span 2; }
.ft-col h3 { margin-bottom: 4px; font-family: var(--f-sans); font-size: 10px; font-weight: 500; letter-spacing: .3em; color: var(--on-dark-2); opacity: .7; }
.ft-col a { color: var(--on-dark-2); text-decoration: none; transition: color .3s; }
.ft-col a:hover { color: var(--on-dark); }
.ft-word { margin: 20px 0 0 -.04em; font-family: var(--f-min); font-weight: 600; font-size: 13.4vw; line-height: .9; letter-spacing: -.01em; white-space: nowrap; user-select: none; color: transparent; -webkit-text-fill-color: transparent; background: linear-gradient(90deg, rgba(236, 236, 230, .9) calc(var(--ff, 0) * 100%), transparent calc(var(--ff, 0) * 100%)); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 1px rgba(236, 236, 230, .16); }
.ft-bot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-block: 24px max(28px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule-dark); font-size: 11px; letter-spacing: .1em; }
.ft-bot a { color: inherit; text-decoration: none; }
.ft-bot a:hover { color: var(--on-dark); }
.ft-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
@media (max-width: 899px) {
  .ft-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ft-about { grid-column: 1 / -1; }
  .ft-col, .ft-about + .ft-col { grid-column: span 1; }
}
/* 業務画面では大きな字を出さず、細い帯だけにする */
.ft--compact .ft-top, .ft--compact .ft-word { display: none; }
.ft--compact { background: transparent; color: var(--ink-2); border-top: 1px solid var(--rule); }
.ft--compact .ft-bot { border-top: 0; }
.ft--compact .ft-bot a:hover { color: var(--ink); }
