/* Demo 展示页共用样式。颜色、字体、边距变量来自 /css/style.css。
   手机分界和官网一致：max-width: 860px。 */

.demo-page { background: #fff; }

/* ---------- 页面骨架 ---------- */
.demo-hero { max-width: var(--page-max); margin: 0 auto; padding: 32px var(--pad-x) 36px; }
.demo-hero--list { padding-top: 32px; padding-bottom: 44px; }
.demo-hero h1 { margin-top: 6px; font-size: 38px; line-height: 1.35; font-weight: 700; letter-spacing: .01em; }
.demo-hero--list h1 { margin-top: 0; font-size: 40px; }
.demo-hero__eyebrow { margin-top: 2px; font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--blue); }
.demo-hero__lead { margin-top: 16px; max-width: 720px; font-size: 17px; line-height: 1.85; color: var(--muted); }
.demo-hero--list .demo-hero__lead { margin-top: 14px; max-width: 640px; }
.demo-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; color: var(--muted); text-decoration: none; }
.demo-back:hover { color: var(--navy); }

.demo-section { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--pad-x); }
.demo-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }

.demo-value { padding-top: 72px; padding-bottom: 56px; }
.demo-value h2 { margin-bottom: 24px; font-size: 24px; font-weight: 700; }
.demo-value__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.demo-value__card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.demo-value__no { font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: .08em; }
.demo-value__head { font-size: 17px; font-weight: 700; line-height: 1.55; }
.demo-value__body { font-size: 15px; line-height: 1.8; color: var(--muted); }

.demo-contact { padding-bottom: 88px; }
.demo-contact__box { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 48px 40px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.demo-contact__title { font-size: 26px; font-weight: 700; line-height: 1.5; }
.demo-contact__lead { max-width: 640px; margin-bottom: 12px; font-size: 16px; line-height: 1.85; color: var(--muted); }
.demo-contact__cta,
.demo-cta {
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  background: var(--blue); color: #fff; font-weight: 600; border-radius: 8px;
  box-shadow: 0 10px 24px -14px rgba(34, 80, 217, .6);
}
.demo-contact__cta.demo-cta { min-height: 52px; padding: 0 32px; font-size: 16px; }

/* ---------- これまで → AIを使うと ---------- */
.demo-compare { padding-bottom: 32px; }
.demo-compare__grid { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: stretch; }
.demo-compare__col { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.demo-compare__col--before { background: var(--bg); border-style: dashed; }
.demo-compare__col--after { border-color: var(--blue); box-shadow: 0 10px 24px -18px rgba(34, 80, 217, .5); }
.demo-compare__label { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.demo-compare__col--after .demo-compare__label { color: var(--blue); }
.demo-compare__list { display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.demo-compare__list li { counter-increment: step; display: flex; gap: 10px; font-size: 15px; line-height: 1.75; }
.demo-compare__list li::before { content: counter(step); flex: 0 0 24px; height: 24px; margin-top: 2px; border-radius: 50%; background: var(--border); color: var(--navy); font-size: 12px; font-weight: 700; line-height: 24px; text-align: center; }
.demo-compare__col--after .demo-compare__list li::before { background: var(--blue); color: #fff; }
.demo-compare__arrow { display: flex; align-items: center; justify-content: center; color: var(--blue); }

/* ---------- 一览页的卡片 ---------- */
.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-bottom: 96px; }
.demo-card { display: flex; flex-direction: column; text-decoration: none; color: var(--navy); background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.demo-card:hover, .demo-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 27, 45, .12); }
.demo-card__thumb { background: var(--bg); border-bottom: 1px solid var(--border); padding: 20px; }
.demo-card__thumb svg { display: block; width: 100%; height: auto; }
.demo-card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; }
.demo-card__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-card__tags span { font-size: 12px; font-weight: 600; line-height: 1.8; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 0 10px; border-radius: 999px; }
.demo-card__tags span:first-child { color: var(--blue); background: rgba(34, 80, 217, .1); border-color: transparent; }
.demo-card h2 { font-size: 19px; font-weight: 700; line-height: 1.5; }
.demo-card p { font-size: 15px; line-height: 1.8; color: var(--muted); }
.demo-card__more { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--blue); }

/* ---------- 动画区（Stage） ---------- */
.demo-stage { position: relative; display: flex; flex-direction: column; gap: 20px; line-height: 1.6; color: var(--navy); }

.demo-caption { display: flex; flex-direction: column; gap: 6px; }
.demo-caption__step { font-size: 13px; font-weight: 600; color: var(--blue); letter-spacing: .04em; }
.demo-caption__text { font-size: 20px; font-weight: 600; line-height: 1.55; min-height: 62px; }

.demo-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.demo-doc { flex: 1 1 280px; min-width: 0; padding: 18px 12px; }
.demo-system { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* 左：订单（用 HTML / CSS 画出来的纸，不是照片） */
.demo-paper {
  position: relative; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 18px 36px -18px rgba(15, 27, 45, .35); transform: rotate(-1.4deg);
  padding: 28px 26px 22px; font-size: 13px; line-height: 1.6; color: var(--navy);
}
.demo-paper__mark { position: absolute; left: 0; right: 0; top: 46%; text-align: center; font-size: 72px; font-weight: 700; letter-spacing: .1em; color: rgba(15, 27, 45, .045); transform: rotate(-18deg); pointer-events: none; }
.demo-paper__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.demo-paper__title { font-size: 24px; font-weight: 700; letter-spacing: .3em; }
.demo-paper__meta { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.demo-paper__meta span.k { color: var(--muted); }
.demo-paper__rule { height: 1px; background: var(--border); margin: 18px 0 6px; }
.demo-paper__row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, .6fr) minmax(0, .9fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.demo-paper__row--head { padding: 6px 0; color: var(--muted); font-size: 12px; }
.demo-paper__row--item { padding: 9px 0; border-top: 1px solid #eef0f4; }
.demo-paper__row--last { border-bottom: 1px solid #eef0f4; }
.demo-paper__row .n { text-align: right; }
.demo-paper__sum { margin: 14px 0 0 auto; width: 62%; min-width: 170px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.demo-paper__sum div { display: flex; justify-content: space-between; }
.demo-paper__sum .k { color: var(--muted); }
.demo-paper__sum .total { font-weight: 700; border-top: 1px solid var(--navy); padding-top: 4px; margin-top: 2px; }
.demo-paper__note { margin-top: 14px; font-size: 11px; color: var(--muted); }

/* 识别框：扫描后依次亮起 */
.pbox { display: inline-block; padding: 1px 3px; border-radius: 3px; outline: 2px solid transparent; outline-offset: 1px; transition: outline-color .2s, background-color .2s; }
.pbox.is-lit { outline-color: var(--blue); background: rgba(34, 80, 217, .10); }
.pbox.is-done { outline: 1px solid rgba(34, 80, 217, .35); }

.demo-scan { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--blue); box-shadow: 0 0 16px 2px rgba(34, 80, 217, .55); opacity: 0; pointer-events: none; }
.demo-scan::before { content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 96px; background: linear-gradient(to bottom, rgba(34, 80, 217, 0), rgba(34, 80, 217, .16)); }

/* 右：公司系统的录入画面 */
.demo-form { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: opacity .3s; }
.demo-form.is-dim { opacity: .6; }
.demo-form__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.demo-form__title { font-size: 16px; font-weight: 700; }
.demo-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-badge { background: rgba(34, 80, 217, .1); color: var(--blue); font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.demo-badge--dark { background: var(--navy); color: #fff; }
.demo-badge[hidden] { display: none; }
/* 占位但不显示，免得标注消失时下面的格子上移，飞行动画的落点就对不上 */
.demo-before { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); visibility: hidden; }
.demo-before.is-visible { visibility: visible; }
.demo-before::before { content: ""; display: inline-block; width: 18px; border-top: 2px dashed var(--muted); }

.demo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.demo-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.demo-field__label { font-size: 12px; color: var(--muted); }
.demo-table { display: flex; flex-direction: column; gap: 8px; }
.demo-table__row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, .7fr) minmax(0, .9fr) minmax(0, 1fr); gap: 8px; }
.demo-table__row--head { font-size: 12px; color: var(--muted); }
.demo-table__row--head .n { text-align: right; }

.demo-cell { position: relative; min-height: 40px; border-radius: 6px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; min-width: 0; background: var(--bg); border: 1px dashed #b8c0cd; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.demo-cell.n { justify-content: flex-end; }
.demo-cell.is-filled { background: #fff; border: 1px solid var(--border); }
.demo-cell.is-edit { border: 1px solid var(--blue); box-shadow: 0 0 0 3px rgba(34, 80, 217, .18); }
.demo-cell__text { min-width: 0; overflow-wrap: anywhere; }
.demo-cell.n .demo-cell__text { white-space: nowrap; overflow-wrap: normal; }
.demo-cell__edit { display: none; flex: 0 0 auto; }
.demo-cell.is-edit .demo-cell__edit { display: block; }

.demo-save-row { position: relative; display: flex; justify-content: flex-end; padding-top: 4px; }
.demo-save { min-height: 44px; padding: 0 22px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; opacity: .4; transition: opacity .2s, box-shadow .1s; cursor: default; }
.demo-save.is-ready { opacity: 1; }
.demo-save.is-press { box-shadow: inset 0 0 0 2px rgba(15, 27, 45, .25); }
.demo-cursor { position: absolute; right: 14px; bottom: -12px; opacity: 0; filter: drop-shadow(0 2px 3px rgba(15, 27, 45, .35)); pointer-events: none; }

.demo-list { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.demo-list__title { font-size: 14px; font-weight: 700; }
.demo-list__row { min-height: 46px; border-radius: 8px; padding: 0 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; border: 1px dashed #b8c0cd; background: var(--bg); transition: background-color .3s, border-color .3s; }
.demo-list__row.is-new { border: 1px solid var(--blue); background: rgba(34, 80, 217, .08); }
.demo-list__row.is-saved { border: 1px solid var(--border); background: #fff; }
.demo-list__row > * { opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; }
.demo-list__row.is-new > *, .demo-list__row.is-saved > * { opacity: 1; transform: none; }
.demo-list__date { font-variant-numeric: tabular-nums; }
.demo-list__vendor { min-width: 0; overflow-wrap: anywhere; }
.demo-list__lines { color: var(--muted); white-space: nowrap; }
.demo-list__saved { background: rgba(34, 80, 217, .1); color: var(--blue); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

.demo-cta { min-height: 48px; padding: 0 24px; font-size: 15px; opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
.demo-cta.is-shown { opacity: 1; visibility: visible; }

/* 飞行的小标签（位置由 JS 按时间算出来，所以暂停时会停在半空） */
.demo-fly { position: absolute; left: 0; top: 0; opacity: 0; z-index: 2; pointer-events: none; will-change: transform; background: var(--blue); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 13px; line-height: 1.5; white-space: nowrap; box-shadow: 0 8px 16px -6px rgba(34, 80, 217, .6); }

/* ---------- 控制条 ---------- */
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.demo-controls__main { flex: 1 1 300px; min-width: 0; display: flex; align-items: center; gap: 10px; }
.demo-toggle { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; }
.demo-progress { flex: 1 1 0; min-width: 0; display: flex; gap: 4px; }
.demo-seg { min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; }
.demo-seg__bar { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.demo-seg__fill { display: block; height: 100%; width: 0; background: var(--blue); }
.demo-replay { flex: 0 0 auto; min-height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: #fff; color: var(--navy); width: 44px; padding: 0; font-size: 14px; font-weight: 600; }
.demo-replay.is-pill { width: auto; padding: 0 16px; border: 2px solid var(--blue); color: var(--blue); }
.demo-replay__label { display: none; }
.demo-replay.is-pill .demo-replay__label { display: inline; }
.demo-lang { flex: 0 0 auto; display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.demo-lang button { min-height: 44px; padding: 0 16px; border: 0; background: #fff; color: var(--navy); font-size: 14px; font-weight: 500; }
.demo-lang button[aria-pressed="true"] { background: var(--navy); color: #fff; font-weight: 600; }
.demo-reduced-note { font-size: 13px; color: var(--muted); margin-top: -8px; }
.demo-reduced-note[hidden] { display: none; }

/* 常驻声明：サンプルデータを使用したデモです */
.demo-sample { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--navy); background: rgba(34, 80, 217, .07); border-radius: 8px; padding: 10px 14px; }
.demo-sample svg { flex: 0 0 auto; }
.demo-noscript { margin: 0 0 16px; color: var(--muted); }

/* ---------- 手机 ---------- */
@media (max-width: 860px) {
  .demo-hero { padding: 20px 20px 24px; }
  .demo-hero--list { padding: 28px 20px; }
  .demo-hero h1 { font-size: 26px; }
  .demo-hero--list h1 { font-size: 28px; }
  .demo-hero__lead { font-size: 15px; }
  .demo-section { padding: 0 20px; }
  .demo-panel { padding: 16px; }
  .demo-value { padding-top: 40px; padding-bottom: 40px; }
  .demo-value h2 { font-size: 20px; }
  .demo-value__grid { grid-template-columns: minmax(0, 1fr); }
  .demo-contact { padding-bottom: 48px; }
  .demo-contact__box { padding: 28px 16px; }
  .demo-contact__title { font-size: 20px; }
  .demo-contact__lead { font-size: 15px; }

  /* 对比：上下排列，箭头朝下 */
  .demo-compare { padding-bottom: 24px; }
  .demo-compare__grid { grid-template-columns: minmax(0, 1fr); }
  .demo-compare__col { padding: 18px 16px; }
  .demo-compare__arrow { height: 44px; }
  .demo-compare__arrow svg { transform: rotate(90deg); }
  .demo-contact__cta.demo-cta { width: 100%; }
  .demo-grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 56px; }

  /* 录入栏在手机上很窄：缩小内边距，日期和取引先改成上下排，明细列按内容宽度分配 */
  .demo-form { padding: 14px; }
  .demo-fields { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .demo-table__row { grid-template-columns: minmax(0, 1.5fr) minmax(0, .6fr) minmax(0, .85fr) minmax(0, 1.05fr); gap: 6px; }
  .demo-cell { padding: 0 6px; font-size: 13px; }
  /* 控制条：进度条单独占一行，播完出现「もう一度見る」时也不会被挤扁 */
  .demo-controls__main { flex-wrap: wrap; }
  .demo-progress { order: 3; flex: 1 1 100%; }
  .demo-list__row { padding-top: 8px; padding-bottom: 8px; row-gap: 4px; }
  .demo-list__date { order: 1; }
  .demo-list__saved { order: 2; margin-left: auto; }
  .demo-list__vendor { order: 3; flex: 1 1 100%; }
  .demo-list__lines { order: 4; flex: 1 1 100%; }
}

/* 系统设置了「减少动态效果」：不要动画，只切换状态 */
@media (prefers-reduced-motion: reduce) {
  .demo-page * { transition: none !important; }
}

/* ======================================================================
   Demo 2（注文から出荷まで、在庫を自動で更新）専用。ここから下は d2- で始まる名前だけ。
   Demo 1 のルールは書き換えていない。
   ====================================================================== */
.d2 {
  --d2-warn-bg: #fdeeed; --d2-warn-line: #f2c4c0; --d2-warn-chip: #f8d7d3; --d2-warn-text: #a3281d;
  --d2-low-bg: #fff3e2; --d2-low-line: #f1d3a6; --d2-low-chip: #ffe3bd; --d2-low-text: #7d4300;
  --d2-shift: translate(12px, 0);
}

.d2-cols { display: flex; gap: 24px; align-items: flex-start; }
.d2-doc { flex: 0 0 36%; min-width: 0; display: flex; flex-direction: column; }
.d2-sys { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; width: 100%; }

.d2 [hidden] { display: none !important; }

/* 左：订单（用 HTML / CSS 画的纸，不是照片） */
.d2-paperpad { padding: 10px 8px; box-sizing: border-box; }
.d2-paper {
  position: relative; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 14px 28px -16px rgba(15, 27, 45, .35); padding: 20px 18px 16px; font-size: 12px; line-height: 1.6;
  box-sizing: border-box; color: var(--navy); transform: rotate(-1.2deg); transition: transform .4s, opacity .4s;
}
.d2-paper.is-enter { transition: none; }
.d2-paper.is-pressed { transform: var(--d2-shift) rotate(-1.2deg); }
.d2-paper.is-saved { opacity: .55; }
.d2-paper__mark { position: absolute; left: 0; right: 0; top: 44%; text-align: center; font-size: 56px; font-weight: 700; letter-spacing: .1em; color: rgba(15, 27, 45, .045); transform: rotate(-18deg); pointer-events: none; }
.d2-paper__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.d2-paper__title { font-size: 20px; font-weight: 700; letter-spacing: .3em; }
.d2-paper__meta { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.d2-paper__meta .k { color: var(--muted); }
.d2-paper__rule { height: 1px; background: var(--border); margin: 12px 0 4px; }
.d2-paper__row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, .6fr) minmax(0, .9fr) minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid #eef0f4; align-items: center; font-size: 12px; }
.d2-paper__row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.d2-paper__row--head { padding: 4px 0; border-top: 0; color: var(--muted); font-size: 11px; }
.d2-paper__row:last-of-type { border-bottom: 1px solid #eef0f4; }
.d2-paper__row .n { text-align: right; }
.d2-paper__sum { margin: 10px 0 0 auto; width: 66%; min-width: 150px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.d2-paper__sum div { display: flex; justify-content: space-between; }
.d2-paper__sum .k { color: var(--muted); }
.d2-paper__sum .total { font-weight: 700; border-top: 1px solid var(--navy); padding-top: 3px; margin-top: 2px; }
.d2-paper__note { margin-top: 10px; font-size: 10px; color: var(--muted); }

/* ボタン・カード・小さな部品 */
.d2-actrow { position: relative; display: flex; justify-content: flex-end; padding-top: 16px; }
.d2-actrow--tight { padding-top: 4px; }
.d2-btn { min-height: 44px; padding: 0 22px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; cursor: default; transition: opacity .2s, background-color .2s, box-shadow .1s; }
.d2-btn.is-dim { opacity: .4; }
.d2-btn.is-press { box-shadow: inset 0 0 0 2px rgba(15, 27, 45, .25); }
.d2-btn--ghost { border: 2px solid var(--blue); background: #fff; color: var(--blue); padding: 0 18px; }
.d2-btn--ghost.is-active { background: rgba(34, 80, 217, .12); }
.d2-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; box-sizing: border-box; font-size: 14px; font-weight: 600; color: var(--blue); background: rgba(34, 80, 217, .1); padding: 0 16px; border-radius: 999px; }
.d2-btnwrap { position: relative; display: flex; }

.d2-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-sizing: border-box; transition: opacity .3s; }
.d2-card--thin { gap: 10px; padding: 16px 20px; }
.d2-card.is-dim { opacity: .7; }
.d2-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.d2-card__title { font-size: 16px; font-weight: 700; }
.d2-card__title--lg { font-size: 17px; }
.d2-card--thin .d2-card__title { font-size: 14px; }
.d2-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.d2-note { background: rgba(34, 80, 217, .1); color: var(--blue); font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.d2-btns { display: flex; flex-wrap: wrap; gap: 10px 12px; }

/* 出荷の一覧 */
.d2-order { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 64px; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; transition: background-color .3s, border-color .3s; }
.d2-order.is-checked { border-color: var(--blue); background: rgba(34, 80, 217, .06); }
.d2-check { flex: 0 0 auto; width: 24px; height: 24px; box-sizing: border-box; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid #8d97a8; transition: background-color .2s, border-color .2s; }
.d2-check svg { opacity: 0; transition: opacity .2s; }
.d2-check.is-on { background: var(--blue); border-color: var(--blue); }
.d2-check.is-on svg { opacity: 1; }
.d2-order__text { flex: 1 1 150px; min-width: 0; }
.d2-order__cust { font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.d2-order__meta { font-size: 12px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.d2-chip { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; line-height: 1.5; transition: opacity .3s; }
.d2-chip--ok { background: rgba(34, 80, 217, .12); color: var(--blue); }
.d2-chip--ng { background: var(--d2-warn-chip); color: var(--d2-warn-text); }

/* 在庫調整のフォーム */
.d2-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d2-field__label { font-size: 12px; color: var(--muted); }
.d2-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.d2-input { min-height: 44px; box-sizing: border-box; border-radius: 8px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; background: var(--bg); border: 1px dashed #b8c0cd; color: var(--muted); transition: background-color .2s, border-color .2s; }
.d2-input span { min-width: 0; overflow-wrap: anywhere; }
.d2-input.is-filled { background: #fff; border: 1px solid var(--border); color: var(--navy); }
.d2-input.is-readonly { background: var(--bg); border: 1px solid var(--border); color: var(--navy); justify-content: flex-end; }
.d2-input.is-focus { border: 1px dashed var(--blue); }
.d2-input--num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.d2-diff { border-radius: 8px; padding: 10px 12px; font-size: 15px; font-weight: 600; line-height: 1.55; box-sizing: border-box; background: rgba(34, 80, 217, .07); border: 1px solid rgba(34, 80, 217, .35); color: var(--navy); transition: opacity .3s; }
.d2-diff.is-hidden { visibility: hidden; opacity: 0; }

/* 右：在庫一覧 */
.d2-thead, .d2-row { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.5fr); gap: 8px; }
.d2-thead { padding: 0 12px; font-size: 12px; color: var(--muted); align-items: end; }
.d2-thead .n { text-align: right; padding-right: 10px; }
.d2-rows { display: flex; flex-direction: column; gap: 8px; }
.d2-row { align-items: center; padding: 6px 12px; box-sizing: border-box; border-radius: 10px; background: #fff; border: 1px solid var(--border); transition: background-color .3s, border-color .3s; }
.d2-row.is-low { background: var(--d2-low-bg); border-color: var(--d2-low-line); }
.d2-row.is-short { background: var(--d2-warn-bg); border-color: var(--d2-warn-line); }
.d2-row__name { font-size: 15px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.d2-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.d2-cell__label { display: none; font-size: 11px; line-height: 1.4; color: var(--muted); }
.d2-num { min-height: 56px; box-sizing: border-box; border-radius: 8px; padding: 0 10px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; font-variant-numeric: tabular-nums; transition: background-color .3s; }
.d2-line { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.d2-num .d2-val { font-size: 17px; font-weight: 500; }
.d2-num .d2-old, .d2-num svg, .d2-num .d2-delta { display: none; flex: 0 0 auto; }
.d2-num .d2-old { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(86, 97, 116, .6); }
.d2-num .d2-delta { font-size: 12px; font-weight: 700; line-height: 1.5; padding: 0 7px; border-radius: 999px; background: rgba(34, 80, 217, .2); color: #1b3fae; }
.d2-num .d2-delta.is-down { background: var(--navy); color: #fff; }
.d2-num.is-hl { background: rgba(34, 80, 217, .16); box-shadow: 0 0 0 2px var(--blue); }
.d2-num.is-hl-strong { background: rgba(34, 80, 217, .24); box-shadow: 0 0 0 3px var(--blue); }
.d2-num.is-hl .d2-val { font-size: 20px; font-weight: 700; }
.d2-num.is-hl .d2-old, .d2-num.is-hl svg { display: inline; }
.d2-num.is-hl .d2-delta { display: inline-block; }
.d2-num.is-fixed { outline: 1.5px dashed rgba(34, 80, 217, .6); outline-offset: -2px; }
.d2-row__status { display: flex; align-items: center; min-width: 0; }
.d2-statusbox { display: inline-flex; border-radius: 999px; transition: box-shadow .3s; }
.d2-statusbox.is-hl { box-shadow: 0 0 0 3px rgba(34, 80, 217, .55); }
.d2-badgest { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; line-height: 1.4; background: rgba(34, 80, 217, .08); color: var(--blue); }
.d2-badgest.is-low { background: var(--d2-low-chip); color: var(--d2-low-text); }
.d2-badgest.is-short { background: var(--d2-warn-chip); color: var(--d2-warn-text); font-weight: 700; }
.d2-warn { flex: 0 0 auto; }

/* 履歴 */
.d2-hist { min-height: 46px; box-sizing: border-box; border-radius: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 13px; border: 1px dashed #b8c0cd; background: var(--bg); color: var(--muted); transition: background-color .3s, border-color .3s; }
.d2-hist.is-new { border: 1px solid var(--blue); background: rgba(34, 80, 217, .08); color: var(--navy); }
.d2-hist.is-done { border: 1px solid var(--border); background: #fff; color: var(--navy); }
.d2-hist.is-new > span:first-child, .d2-hist.is-done > span:first-child { font-weight: 600; }
.d2-hist__prod { color: var(--muted); }

@media (max-width: 860px) {
  .d2 { --d2-shift: translate(0, 8px); }
  .d2-cols { flex-direction: column; gap: 12px; }
  .d2-doc { flex: 0 0 auto; width: 100%; }
  .d2-card { padding: 16px; }
  .d2-card--thin { padding: 14px 16px; }
  /* 在庫一覧は小さなカードに：商品名と状態が上、3つの数字が下（ラベル付き）。中国語の見出しが長くても溢れない */
  .d2-thead { display: none; }
  .d2-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; padding: 12px; }
  .d2-row__name { grid-column: 1 / span 2; grid-row: 1; }
  .d2-row__status { grid-column: 3; grid-row: 1; justify-content: flex-end; }
  .d2-cell { grid-row: 2; }
  .d2-cell__label { display: block; }
  .d2-num { padding: 0 6px; }
  .d2-line { gap: 4px; }
  .d2-two { gap: 8px; }
}

/* ======================================================================
   Demo 3（出荷の記録から、請求書を自動作成）専用。ここから下は d3- で始まる名前だけ。
   Demo 1・2 のルールは書き換えていない。
   ====================================================================== */
.d3 {
  --d3-red-bg: #fdeeed; --d3-red-line: #f2c4c0; --d3-red-text: #a3281d;
  --d3-yel-bg: #fff6d6; --d3-yel-line: #ecd37a; --d3-yel-text: #7a5a00;
}
.d3 [hidden] { display: none !important; }

.d3-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 32px; align-items: start; }
.d3-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 600px; }
.d3-right { min-width: 0; display: flex; justify-content: center; align-items: flex-start; }

/* 左：カード */
.d3-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; }
.d3-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d3-card__title { font-size: 16px; font-weight: 700; }
.d3-card__sub { font-size: 12px; color: var(--muted); }
.d3-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.d3-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d3-field__label { font-size: 12px; color: var(--muted); }
.d3-selwrap { position: relative; }
.d3-select { min-height: 44px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; background: #fff; color: #8a93a3; }
.d3-select.is-sel { border-color: var(--blue); color: var(--navy); }
.d3-select span { min-width: 0; overflow-wrap: anywhere; }

/* 出荷の行 */
.d3-ship { display: grid; grid-template-columns: 3.8em minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-height: 44px; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.d3-ship.is-hl { border-color: var(--blue); background: rgba(34, 80, 217, .10); }
.d3-ship__date, .d3-ship__qty { font-size: 13px; color: var(--muted); white-space: nowrap; }
.d3-ship__name { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.d3-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.6; border-radius: 999px; white-space: nowrap; }
.d3-chip--billed { padding: 1px 8px; background: rgba(34, 80, 217, .1); color: var(--blue); }
.d3-chip--open { padding: 0 8px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); }

/* 確認が必要な行が2件ありますの合図 */
.d3-flag { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.d3-dots { display: flex; gap: 4px; flex: 0 0 auto; }
.d3-dot { width: 10px; height: 10px; border-radius: 50%; }
.d3-dot--red { background: #a3281d; }
.d3-dot--yel { background: #c9a227; }

/* ボタン */
.d3-btnwrap { position: relative; align-self: flex-start; display: flex; }
.d3-btn { min-height: 44px; padding: 0 20px; border-radius: 8px; border: 0; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; cursor: default; }
.d3-btn.is-press { background: #1a40b0; transform: scale(.97); }
.d3-btn--icon { display: flex; align-items: center; gap: 8px; }
.d3-btn--tall { min-height: 48px; box-shadow: 0 10px 24px -14px rgba(34, 80, 217, .6); }
.d3-btn--icon.is-done { border: 1px solid var(--border); background: var(--bg); color: var(--muted); box-shadow: none; }
.d3-btn--dark { background: var(--navy); }
.d3-btn--dark.is-press { background: #000; }
.d3-btn--ghost { border: 1px solid var(--muted); background: #fff; color: var(--navy); padding: 0 16px; font-size: 14px; }
.d3-btn--outline { display: flex; align-items: center; gap: 8px; min-height: 48px; border: 2px solid var(--blue); background: #fff; color: var(--blue); }
.d3-btn--outline.is-press { background: rgba(34, 80, 217, .14); }
.d3-btn--wide { min-height: 48px; width: 100%; box-shadow: 0 10px 24px -14px rgba(34, 80, 217, .6); }
.d3-btn--wide[aria-disabled="true"] { border: 1px solid var(--border); background: #e6e9ef; color: #8a93a3; box-shadow: none; }
.d3-btn__ico { display: inline-flex; }
.d3-ico { flex: 0 0 auto; }

/* 第 3 ステップ：確認が必要な行 */
.d3-remain { font-size: 13px; font-weight: 700; padding: 1px 10px; border-radius: 999px; background: var(--d3-red-bg); color: var(--d3-red-text); }
.d3-remain.is-ok { background: rgba(34, 80, 217, .1); color: var(--blue); }
.d3-case { border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; background: #fff; border: 1px solid var(--border); }
.d3-case.is-red.is-open { background: var(--d3-red-bg); border-color: var(--d3-red-line); }
.d3-case.is-yel.is-open { background: var(--d3-yel-bg); border-color: var(--d3-yel-line); }
.d3-case__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d3-case__name { font-size: 15px; font-weight: 700; }
.d3-case__meta { font-size: 13px; color: var(--muted); }
.d3-case__msg { font-size: 15px; font-weight: 700; }
.d3-case.is-red .d3-case__msg { color: var(--d3-red-text); }
.d3-case.is-yel .d3-case__msg { color: var(--d3-yel-text); }
.d3-case__note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.d3-case__ctl { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; }
.d3-input { width: 110px; min-height: 44px; box-sizing: border-box; border: 1px solid #c9a09b; border-radius: 6px; background: #fff; padding: 0 10px; display: flex; align-items: center; font-size: 14px; color: #8a93a3; }
.d3-input.is-typed { border-color: var(--blue); color: var(--navy); }
.d3-checkwrap { align-self: center; }
.d3-checkrow { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 600; }
.d3-checkbox { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; box-sizing: border-box; border-radius: 5px; border: 2px solid var(--muted); background: #fff; color: #fff; }
.d3-checkbox svg { opacity: 0; }
.d3-checkbox.is-on { border-color: var(--blue); background: var(--blue); }
.d3-checkbox.is-on svg { opacity: 1; }

/* 第 4 ステップ：発行とPDF */
.d3-pdfdone { display: flex; align-items: center; gap: 10px; font-size: 15px; background: rgba(34, 80, 217, .08); border-radius: 8px; padding: 10px 14px; }
.d3-pdfdone__text { display: flex; flex-direction: column; min-width: 0; }
.d3-pdfdone__title { font-weight: 700; }
.d3-pdfdone__file { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

/* 右：請求書（A4 縮小版）。寸法は cqw（入れ物の幅の％）なので、手機でも全体が縮むだけ */
.d3-invbox { container-type: inline-size; width: 100%; max-width: 560px; }
.d3-inv { background: #fff; border: 1px solid var(--border); border-radius: .8cqw; box-shadow: 0 18px 36px -18px rgba(15, 27, 45, .35); aspect-ratio: 1 / 1.414; padding: 6cqw 6cqw 4.5cqw; box-sizing: border-box; display: flex; flex-direction: column; font-size: 2.6cqw; line-height: 1.5; color: var(--navy); position: relative; }
.d3-inv__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2cqw; }
.d3-inv__titlebox { display: flex; align-items: center; gap: 2.4cqw; flex-wrap: wrap; }
.d3-inv__title { font-size: 6.4cqw; font-weight: 700; letter-spacing: .3em; line-height: 1.3; }
.d3-genpill { font-size: 2.2cqw; font-weight: 600; color: var(--blue); background: rgba(34, 80, 217, .1); border-radius: 999px; padding: .2cqw 1.8cqw; line-height: 1.5; opacity: 0; }
.d3-stamp { font-size: 2.4cqw; font-weight: 700; color: var(--blue); border: .35cqw solid var(--blue); border-radius: .8cqw; padding: .1cqw 1.6cqw; line-height: 1.5; letter-spacing: .1em; transform: rotate(-4deg); opacity: 0; }
.d3-inv__head { display: flex; flex-direction: column; width: 50%; flex: 0 0 auto; }
.d3-inv__addr { margin-top: 3cqw; }
.d3-inv__issuer { margin-top: 3cqw; margin-left: auto; width: 64%; }
.d3-inv__table { margin-top: 3.4cqw; }
.d3-ihead { display: grid; grid-template-columns: 17% minmax(0, 1fr) 9% 17% 19%; gap: 1.2cqw; align-items: end; padding: 0 1cqw 1cqw; border-bottom: 1px solid var(--navy); font-size: 2.2cqw; color: var(--muted); line-height: 1.35; }
.d3-ihead .n, .d3-irow .n { text-align: right; }
.d3-irow { display: grid; grid-template-columns: 17% minmax(0, 1fr) 9% 17% 19%; gap: 1.2cqw; align-items: center; padding: 1.5cqw 1cqw; border-bottom: 1px solid #eef0f4; position: relative; border-radius: .6cqw; opacity: 0; }
.d3-irow.is-red-flag { background: var(--d3-red-bg); box-shadow: inset 0 0 0 .3cqw #a3281d; }
.d3-irow.is-yel-flag { background: var(--d3-yel-bg); box-shadow: inset 0 0 0 .3cqw #c9a227; }
.d3-irow.is-blue { background: rgba(34, 80, 217, .10); }
.d3-nw { white-space: nowrap; }
.d3-iname { min-width: 0; overflow-wrap: anywhere; }
.d3-price { border-radius: .6cqw; }
.d3-price.is-hl { background: rgba(34, 80, 217, .16); box-shadow: 0 0 0 .6cqw rgba(34, 80, 217, .16); }
.d3-price.is-dash { border: .3cqw dashed #a3281d; }
.d3-amt.is-fix { font-weight: 700; color: var(--blue); }
.d3-ptag { position: absolute; right: 21%; top: -1.9cqw; z-index: 2; white-space: nowrap; font-size: 2cqw; line-height: 1.5; font-weight: 600; color: #fff; background: var(--blue); padding: .1cqw 1.4cqw; border-radius: 999px; opacity: 0; }
.d3-otag { position: absolute; right: 1cqw; top: -2.1cqw; z-index: 2; white-space: nowrap; font-size: 2cqw; line-height: 1.5; font-weight: 600; color: var(--d3-yel-text); background: var(--d3-yel-bg); border: .25cqw solid #c9a227; padding: 0 1.4cqw; border-radius: 999px; opacity: 0; }
.d3-inv__tots { margin-top: 2.4cqw; margin-left: auto; width: 62%; position: relative; display: flex; flex-direction: column; gap: .4cqw; }
.d3-recalc { position: absolute; right: calc(100% + 2cqw); top: .8cqw; white-space: nowrap; font-size: 2.2cqw; font-weight: 600; color: #fff; background: var(--blue); border-radius: 999px; padding: .2cqw 1.8cqw; line-height: 1.5; opacity: 0; }
.d3-tot { display: flex; justify-content: space-between; gap: 2cqw; padding: .8cqw 1cqw; border-radius: .6cqw; opacity: 0; }
.d3-tot__l { color: var(--muted); }
.d3-tot__v { font-variant-numeric: tabular-nums; }
.d3-tot.is-hl { background: rgba(34, 80, 217, .16); }
.d3-tot.is-big { font-weight: 700; font-size: 3cqw; border-top: 1px solid var(--navy); }
.d3-tot.is-big .d3-tot__l { color: var(--navy); }
.d3-pending { height: 3.4cqw; text-align: right; font-size: 2.1cqw; line-height: 1.5; color: var(--muted); opacity: 0; }
.d3-inv__pay { margin-top: 2.4cqw; }
.d3-inv__foot { margin-top: auto; padding-top: 2cqw; border-top: 1px solid #eef0f4; font-size: 2.3cqw; line-height: 1.55; color: var(--muted); }

/* 請求書の「場所」：骨組みの線 → 本物の内容 */
.d3-slot { position: relative; }
.d3-sk { position: absolute; top: 50%; height: 1.6cqw; margin-top: -.8cqw; border-radius: 1cqw; background: #eef0f4; }
.d3-sk.is-end { right: 0; }
.d3-sk.is-start { left: 0; }
.d3-real { position: absolute; inset: 0; display: flex; align-items: center; gap: 2cqw; white-space: nowrap; opacity: 0; }
.d3-real.is-end { justify-content: flex-end; }
.d3-real.is-start { justify-content: flex-start; }
.d3-k { color: var(--muted); }
.d3-slot--bold .d3-real { font-weight: 700; }
.d3-slot--addr .d3-real { font-size: 3.4cqw; font-weight: 700; border-bottom: 1px solid var(--navy); }
.d3-slot--wrap .d3-real { white-space: normal; align-items: flex-start; flex-wrap: wrap; gap: 0 2cqw; }

@media (max-width: 860px) {
  .d3-cols { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .d3-right { width: 100%; }
  .d3-left { min-height: 560px; }
  .d3-two { grid-template-columns: minmax(0, 1fr); }
  .d3-ship { grid-template-columns: minmax(0, 1fr) auto auto; }
  .d3-ship__date { display: none; }
}

/* ---------- 次のデモ動画（各デモページの末尾） ---------- */
.demo-back--list { margin-left: 20px; }
.demo-hero .demo-back { vertical-align: top; }
.demo-next { padding-bottom: 24px; }
.demo-next__box { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: clamp(24px, 4vw, 40px) clamp(18px, 4vw, 40px); }
.demo-next__prog { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 20px; }
.demo-next__pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; padding: 3px 12px 3px 4px;
  border-radius: 999px; background: #fff; color: #7a869a; border: 1px solid var(--border);
}
.demo-next__pn { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #e3e8f0; color: var(--muted); font-size: 12px; }
.demo-next__pill.is-done { color: var(--muted-2); }
.demo-next__pill.is-done .demo-next__pn, .demo-next__pill.is-current .demo-next__pn { background: var(--blue); color: #fff; }
.demo-next__pill.is-current { background: #eef3ff; color: #1b3fae; border-color: var(--blue); }
.demo-next__main {
  display: flex; align-items: center; gap: 20px; min-height: 104px; padding: 20px 28px; background: var(--blue); color: #fff;
  border-radius: 10px; text-decoration: none; transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.demo-next__main:hover, .demo-next__main:focus-visible { background: #1b3fae; transform: translateY(-3px); box-shadow: 0 18px 32px -18px rgba(34, 80, 217, 0.6); }
.demo-next__main:focus-visible, .demo-next__sub:focus-visible, .demo-next__cta:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.demo-next__main-text { flex: 1; min-width: 0; }
.demo-next__main-cap { display: block; font-size: 14px; font-weight: 500; opacity: 0.9; }
.demo-next__main-title { display: block; font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; line-height: 1.5; }
.demo-next__circ { flex: none; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--blue); transition: transform 0.2s ease; }
.demo-next__main:hover .demo-next__circ { transform: translateX(4px); }
.demo-next__note { font-size: 14px; line-height: 1.9; color: var(--muted); margin: 14px 0 0; }
.demo-next__last-title { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; line-height: 1.5; margin-bottom: 6px; }
.demo-next__last-lead { font-size: 15px; line-height: 1.95; color: var(--muted-2); margin: 0 0 20px; }
.demo-next__btns { display: flex; flex-wrap: wrap; gap: 14px; }
.demo-next__sub, .demo-next__cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 28px; border-radius: 4px;
  font-size: 16px; font-weight: 600; text-decoration: none;
}
.demo-next__sub { border: 1.5px solid var(--blue); background: #fff; color: var(--blue); }
.demo-next__sub:hover { background: #eef3ff; color: #1b3fae; }
.demo-next__cta { background: var(--blue); color: #fff; }
.demo-next__cta:hover { background: #1b3fae; }

@media (max-width: 860px) {
  .demo-back--list { margin-left: 12px; }
  .demo-next__main { padding: 18px; gap: 14px; }
  .demo-next__circ { width: 44px; height: 44px; }
  .demo-next__btns { flex-direction: column; }
  .demo-next__sub, .demo-next__cta { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-next__main, .demo-next__circ { transition: none !important; }
  .demo-next__main:hover, .demo-next__main:hover .demo-next__circ { transform: none; }
}

/* ======================================================================
   見やすさの調整（2026-11）：ステージ内の文字を大きく、用語の説明、ステップ切替の合図、
   手機で再生バーを画面下に固定。上のルールより後ろに置いて上書きしている。
   ====================================================================== */

/* ---------- ページ上部：戻るリンク＋大見出し 1 つ ---------- */
.demo-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.demo-hero h1 { margin-top: 4px; }
.demo-hero__lead { margin-top: 12px; }

/* ---------- 説明文：ステップ切替の合図 ---------- */
.demo-caption { border-radius: 10px; padding: 12px 14px; margin: 0 -14px; }
.demo-caption__step { align-self: flex-start; font-size: 14px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 999px; padding: 2px 12px; line-height: 1.6; letter-spacing: .04em; }
.demo-caption__text { font-size: 22px; min-height: 0; }
.demo-caption.is-flash { animation: demo-flash 1.4s ease-out; }
.demo-caption.is-flash .demo-caption__step { animation: demo-pop .5s ease-out; }
@keyframes demo-flash { 0% { background: rgba(34, 80, 217, .22); } 100% { background: rgba(34, 80, 217, 0); } }
@keyframes demo-pop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.demo-seg.is-now .demo-seg__bar { height: 10px; border-radius: 5px; }

/* ---------- 再生バーは画面の下に貼り付け ---------- */
[data-demo="controls"] { position: sticky; bottom: 0; z-index: 20; margin: 0 -8px; padding: 8px; background: linear-gradient(to bottom, rgba(247, 248, 250, 0), var(--bg) 18%); }
.demo-controls { box-shadow: 0 -4px 18px -8px rgba(15, 27, 45, .25), 0 2px 8px -4px rgba(15, 27, 45, .15); }

/* ---------- 用語のかんたん説明 ---------- */
.demo-gloss { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.demo-gloss__title { font-size: 14px; font-weight: 700; color: var(--blue); letter-spacing: .04em; }
.demo-gloss dl { display: flex; flex-direction: column; gap: 8px; }
.demo-gloss dl > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 4px 12px; }
.demo-gloss dt { font-size: 15px; font-weight: 700; line-height: 1.6; }
.demo-gloss dd { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted-2); }
.demo-hint { font-size: 15px; font-weight: 600; line-height: 1.6; padding: 10px 14px; border-radius: 8px; background: #fdeeed; border: 1px solid #f2c4c0; color: #a3281d; }
.demo-hint[hidden] { display: none; }

/* ---------- Demo 1 ---------- */
.demo-paper { font-size: 15px; }
.demo-paper__title { font-size: 26px; }
.demo-paper__row--head { font-size: 14px; }
.demo-paper__sum { font-size: 15px; }
.demo-paper__note { font-size: 13px; }
.demo-form__title { font-size: 18px; }
.demo-badge { font-size: 15px; }
.demo-before { font-size: 15px; font-weight: 600; }
.demo-before::before { display: none; }
.demo-field__label, .demo-table__row--head { font-size: 14px; }
.demo-cell { font-size: 16px; min-height: 44px; }
.demo-save { font-size: 16px; }
.demo-list__title { font-size: 16px; }
.demo-list__row { font-size: 15px; }
.demo-list__saved { font-size: 14px; }
.demo-fly { font-size: 16px; }

/* ---------- Demo 2 ---------- */
.d2-doc { flex: 0 0 38%; }
.d2-paper { font-size: 14px; }
.d2-paper__row { font-size: 14px; }
.d2-paper__row--head { font-size: 13px; }
.d2-paper__sum { font-size: 14px; }
.d2-paper__note { font-size: 12px; }
.d2-paper__title { font-size: 22px; }
.d2-btn { font-size: 16px; }
.d2-pill { font-size: 15px; }
.d2-card__title { font-size: 17px; }
.d2-card--thin .d2-card__title { font-size: 16px; }
.d2-count { font-size: 15px; }
.d2-note { font-size: 14px; }
.d2-order__meta { font-size: 14px; }
.d2-order__cust { font-size: 16px; }
.d2-chip { font-size: 14px; }
.d2-field__label, .d2-thead { font-size: 14px; }
.d2-input { font-size: 16px; }
.d2-diff { font-size: 16px; }
.d2-row__name { font-size: 16px; }
.d2-num .d2-val { font-size: 20px; }
.d2-num.is-hl .d2-val { font-size: 24px; }
.d2-num .d2-old { font-size: 14px; }
.d2-num .d2-delta { font-size: 14px; }
.d2-num { min-height: 62px; }
.d2-badgest { font-size: 14px; }
.d2-hist { font-size: 15px; }

/* ---------- Demo 3 ---------- */
.d3-card__title { font-size: 17px; }
.d3-card__sub, .d3-field__label { font-size: 14px; }
.d3-select { font-size: 16px; }
.d3-ship__date, .d3-ship__qty { font-size: 14px; }
.d3-ship__name { font-size: 16px; }
.d3-chip { font-size: 14px; }
.d3-flag { font-size: 16px; }
.d3-btn { font-size: 16px; }
.d3-btn--ghost { font-size: 15px; }
.d3-case__name, .d3-case__msg { font-size: 16px; }
.d3-case__meta, .d3-case__note { font-size: 14px; }
.d3-input { font-size: 16px; }
.d3-checkrow { font-size: 15px; }
.d3-remain { font-size: 14px; }
.d3-pdfdone { font-size: 16px; }
.d3-pdfdone__file { font-size: 14px; }
.d3-right { flex-direction: column; align-items: stretch; gap: 12px; }
.d3-invbox, .d3-right .demo-gloss { margin-inline: auto; }
.d3-right .demo-gloss { width: 100%; max-width: 560px; }
.d3-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; width: 100%; max-width: 560px; margin-inline: auto; font-size: 14px; font-weight: 600; line-height: 1.6; min-height: 3.4em; opacity: 0; }
.d3-legend__item { display: inline-flex; align-items: center; gap: 8px; }
.d3-dot { flex: 0 0 auto; }
.d3-inv { font-size: 2.7cqw; }
.d3-ihead { font-size: 2.5cqw; }
.d3-genpill, .d3-recalc { font-size: 2.5cqw; }
.d3-stamp { font-size: 2.6cqw; }
.d3-ptag, .d3-otag { font-size: 2.4cqw; top: -2.5cqw; }
.d3-pending { font-size: 2.5cqw; height: 3.8cqw; }
.d3-inv__foot { font-size: 2.5cqw; }

/* ---------- 手機 ---------- */
@media (max-width: 860px) {
  .d3-card__head { flex-wrap: wrap; }
  .d3-card__title { white-space: nowrap; }
  .demo-panel { padding: 12px; }
  .demo-stage { gap: 14px; }
  .demo-caption { margin: 0 -6px; padding: 10px 8px; }
  .demo-caption__text { font-size: 18px; }
  [data-demo="controls"] { margin: 0 -4px; padding: 6px 4px; }
  .demo-controls { padding: 4px 8px; gap: 4px 12px; }
  .demo-controls__main { flex-wrap: nowrap; gap: 8px; }
  .demo-progress { order: 0; flex: 1 1 0; }
  .demo-lang button { padding: 0 12px; }
  .demo-crumbs { gap: 0 12px; }
  .demo-gloss dl > div { display: block; }
  .demo-gloss dt { font-size: 15px; }

  /* Demo 1 */
  .demo-doc { padding: 8px 4px; }
  .demo-paper { padding: 20px 14px 16px; font-size: 14px; }
  .demo-paper__title { font-size: 22px; }
  .demo-paper__row { gap: 4px; }
  .demo-paper__row--head { font-size: 13px; }
  .demo-paper__sum { font-size: 14px; }
  .demo-form { padding: 12px; gap: 10px; }
  .demo-table { gap: 6px; }
  .demo-table__row { grid-template-columns: minmax(0, 1.5fr) minmax(0, .5fr) minmax(0, .75fr) minmax(0, .9fr); gap: 4px; }
  .demo-cell { padding: 0 4px; font-size: 14px; min-height: 40px; }
  .demo-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .demo-field__label, .demo-table__row--head { font-size: 13px; }
  .demo-fly { font-size: 14px; }
  .demo-list__row { font-size: 14px; }

  /* Demo 2 */
  .d2-doc { flex: 0 0 auto; }
  .d2-paperpad { padding: 6px 4px; }
  .d2-paper { padding: 14px 12px 12px; }
  .d2-paper__row { gap: 4px; }
  .d2-cell__label { font-size: 13px; }
  .d2-row { padding: 10px; gap: 8px 4px; }
  .d2-num .d2-val { font-size: 20px; }
  .d2-num.is-hl .d2-val { font-size: 22px; }
  .d2-num .d2-old { font-size: 13px; }
  .d2-card { padding: 14px; }

  /* Demo 3 */
  .d3-left { min-height: 0; gap: 10px; }
  .d3-cols { gap: 14px; }
  .d3-card { padding: 14px; }
  .d3-legend { min-height: 0; font-size: 13px; }
  .d3-inv { aspect-ratio: auto; font-size: 4.1cqw; padding: 5cqw 4.5cqw 4cqw; gap: 0; }
  .d3-inv__top { flex-direction: column; gap: 1.5cqw; }
  .d3-inv__title { font-size: 7.6cqw; }
  .d3-genpill { font-size: 3.6cqw; padding: .2cqw 2.4cqw; }
  .d3-stamp { font-size: 3.8cqw; border-width: .5cqw; padding: .1cqw 2cqw; }
  .d3-inv__head { width: 100%; }
  .d3-inv__addr { margin-top: 2cqw; }
  .d3-slot--addr .d3-real { font-size: 4.8cqw; }
  .d3-inv__issuer { width: 100%; margin: 2cqw 0 0; }
  .d3-slot[data-slot="no"], .d3-slot[data-slot="date"], .d3-slot[data-slot="p1"] { height: 6.6cqw !important; }
  .d3-slot[data-slot="addr"] { height: 9cqw !important; }
  .d3-slot[data-slot="i1"], .d3-slot[data-slot="i4"] { height: 6cqw !important; }
  .d3-slot[data-slot="i2"], .d3-slot[data-slot="i3"] { display: none; }
  .d3-slot[data-slot="p2"] { height: 11cqw !important; }
  .d3-sk { height: 2.4cqw; margin-top: -1.2cqw; }
  .d3-inv__table { margin-top: 3cqw; }
  .d3-ihead, .d3-irow { grid-template-columns: minmax(0, 1fr) 11% 20% 23%; gap: 1.5cqw; }
  .d3-ihead { font-size: 3.7cqw; }
  .d3-ihead span:first-child, .d3-irow > .d3-nw { display: none; }
  .d3-irow { padding: 2.2cqw 1cqw; }
  .d3-ptag, .d3-otag { font-size: 3.5cqw; top: -3.8cqw; }
  .d3-ptag { right: 22%; }
  .d3-inv__tots { width: 100%; margin-top: 3cqw; }
  .d3-recalc { font-size: 3.6cqw; right: 0; top: -5cqw; }
  .d3-tot { padding: 1.2cqw 1cqw; }
  .d3-tot.is-big { font-size: 4.8cqw; }
  .d3-pending { font-size: 3.6cqw; height: 5.4cqw; text-align: left; }
  .d3-inv__pay { margin-top: 3cqw; }
  .d3-inv__foot { font-size: 3.5cqw; margin-top: 3cqw; padding-top: 2cqw; }
}

/* 動きを減らす設定：合図のアニメーションは出さない */
@media (prefers-reduced-motion: reduce) {
  .demo-caption.is-flash, .demo-caption.is-flash .demo-caption__step { animation: none; }
}

@media (max-width: 860px) {
  /* Demo 3：手机上的小标签至少 14px */
  .d3-ptag, .d3-otag { font-size: 4.2cqw; }
  .d3-ptag { top: -5cqw; right: 22%; }
  .d3-otag { position: static; grid-column: 1 / -1; justify-self: end; margin-top: 1cqw; }
}

/* 手機の請求書：すべて 14px 以上（請求書の入れ物は幅 約 307px → 4.6cqw ≒ 14px） */
@media (max-width: 860px) {
  .d3-inv { font-size: 4.6cqw; }
  .d3-ihead, .d3-ptag, .d3-otag, .d3-recalc, .d3-pending, .d3-inv__foot, .d3-genpill, .d3-stamp { font-size: 4.6cqw; }
  .d3-ptag { top: -5.6cqw; }
  .d3-ihead { grid-template-columns: minmax(0, 1fr) 12% 21% 24%; }
  .d3-irow { grid-template-columns: minmax(0, 1fr) 12% 21% 24%; }
  .d3-recalc { top: -6.5cqw; }
  .d3-pending { height: auto; min-height: 6.4cqw; line-height: 1.4; }
  .d3-tot.is-big { font-size: 5cqw; }
  .d3-slot--addr .d3-real { font-size: 5cqw; }
  .d3-slot[data-slot="no"], .d3-slot[data-slot="date"], .d3-slot[data-slot="p1"] { height: 7cqw !important; }
  .d3-slot[data-slot="i1"], .d3-slot[data-slot="i4"] { height: 6.6cqw !important; }
  .d3-slot[data-slot="p2"] { height: 14cqw !important; }
}
