/* ==========================================================================
   components.css — 共通コンポーネント
   仕様は DESIGN.md 「4. コンポーネント仕様」を参照。
   ========================================================================== */

/* --- 4.4 ボタン -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  height: var(--h-btn);
  /* 普通の大きさのボタンは、字が 0.8〜1px 上に寄って見えるので、上に 2px 足して中身を 1px 下げる
     （整数の px なので丸めでずれない。.btn--sm / .btn--lg は余白を上書きするので効かない） */
  padding: calc(var(--sp-hair) * 2) var(--sp-4) 0;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

/* リンクで作ったボタン・カード・タブは、ホバーで下線を出さない（base.css の a:hover を打ち消す）。
   下線は文章の中のリンクとパンくずだけ */
.btn:hover,
.kpi--link:hover,
.tabs__item:hover {
  text-decoration: none;
}

.btn:disabled,
.btn.is-disabled {
  background: var(--c-bg-sub);
  border-color: var(--c-border);
  color: var(--c-text-sub);
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary:disabled,
.btn-primary.is-disabled {
  background: var(--c-bg-sub);
  border-color: var(--c-border);
  color: var(--c-text-sub);
}

/* ボタンの中にアイコンを置くとき。アイコン（16px）と字の大きさの組み合わせで、字の見た目の真ん中との差が
   変わるので、大きさごとに合わせる（2 倍の画面で測って 0.5px 以内） */
.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  transform: translateY(calc(var(--sp-hair) * -1));
}

.btn--sm svg {
  transform: translateY(calc(var(--sp-hair) / 2));
}

.btn--lg svg,
.formfoot .btn svg {
  transform: none;
}

/* 主ボタンは濃い焦茶。銅（--c-brand）だと地に対して薄く見える */
.btn-primary {
  background: var(--c-brand-dark);
  border-color: var(--c-brand-dark);
  color: var(--c-text-inv);
}

.btn-primary:not(:disabled):hover {
  background: var(--c-header-bg);
  border-color: var(--c-header-bg);
}

.btn-secondary {
  background: var(--c-bg);
  border-color: var(--c-border-strong);
  color: var(--c-text);
}

.btn-secondary:not(:disabled):hover {
  background: var(--c-bg-sub);
}

.btn-danger {
  background: var(--c-st-ng);
  border-color: var(--c-st-ng);
  color: var(--c-text-inv);
}

.btn-danger:not(:disabled):hover {
  filter: brightness(0.92);
}

.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--c-brand);
  font-weight: 400;
}

.btn-ghost:not(:disabled):hover {
  background: var(--c-brand-pale);
}

.btn--sm {
  height: var(--h-btn-sm);
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
}

/* 稟議の「承認」「承認依頼」など、その画面の主役になる操作に使う */
.btn--lg {
  height: var(--h-btn-lg);
  padding: 0 var(--sp-5);
  font-size: var(--fs-lg);
  min-width: 108px;
}

.btn--block {
  width: 100%;
}

/* --- 4.6 ステータスバッジ ---------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px var(--sp-2);
  border-radius: var(--r-sm);
  border: 1px solid;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--none     { color: var(--c-st-none);     background: var(--c-st-none-bg);     border-color: var(--c-st-none); }
.badge--skip     { color: var(--c-st-skip);     background: var(--c-st-skip-bg);     border-color: var(--c-st-skip); }
.badge--draft    { color: var(--c-st-draft);    background: var(--c-st-draft-bg);    border-color: var(--c-st-draft); }
.badge--progress { color: var(--c-st-progress); background: var(--c-st-progress-bg); border-color: var(--c-st-progress); }
.badge--ok       { color: var(--c-st-ok);       background: var(--c-st-ok-bg);       border-color: var(--c-st-ok); }
.badge--ng       { color: var(--c-st-ng);       background: var(--c-st-ng-bg);       border-color: var(--c-st-ng); }
.badge--ai       { color: var(--c-st-ai);       background: var(--c-st-ai-bg);       border-color: var(--c-st-ai); }

/* --- 4.3 データテーブル ------------------------------------------------ */
.dtable {
  width: 100%;
  font-size: var(--fs-sm);
  line-height: var(--lh-table);
  background: var(--c-bg);
}

.dtable th,
.dtable td {
  border: 1px solid var(--c-border);
  padding: var(--sp-1) var(--sp-2);
  height: var(--h-row);
  vertical-align: middle;
}

.dtable thead th {
  background: var(--c-th-bg);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.dtable thead th.is-sortable {
  cursor: pointer;
  user-select: none;
}

/* 並べ替えの矢印は線の SVG（tokens.css の --icon-sort*）を mask にして色を付ける。
   並べていない列は上下の山形を --c-text-sub、並べた列は向きの矢印を銅に */
.dtable thead th.is-sortable::after {
  content: "";
  display: inline-block;
  width: var(--sz-sorticon);
  height: var(--sz-sorticon);
  margin-left: var(--sp-1);
  vertical-align: middle;
  background-color: var(--c-text-sub);
  -webkit-mask: var(--icon-sort) center / contain no-repeat;
  mask: var(--icon-sort) center / contain no-repeat;
}

.dtable thead th.is-asc::after,
.dtable thead th.is-desc::after {
  background-color: var(--c-brand);
}

.dtable thead th.is-asc::after {
  -webkit-mask-image: var(--icon-sort-asc);
  mask-image: var(--icon-sort-asc);
}

.dtable thead th.is-desc::after {
  -webkit-mask-image: var(--icon-sort-desc);
  mask-image: var(--icon-sort-desc);
}

/* 長い表の見出しを止める。.dtable__scroll の中ではその枠の上端に止まる。
   border-collapse: collapse のままだと、罫線が見出しと一緒に動かず、上端の
   罫線の隙間から下の行の文字が透ける。罫線をセルに持たせるため separate に
   して、線が 2 重にならないよう右と下だけに引く（左端と上端は別に足す）。 */
.dtable--sticky {
  border-collapse: separate;
  border-spacing: 0;
}

.dtable--sticky th,
.dtable--sticky td {
  border-width: 0 1px 1px 0;
}

.dtable--sticky tr > :first-child {
  border-left-width: 1px;
}

.dtable--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--c-th-bg);
  border-top-width: 1px;
}

/* 行の状態の地（状態の意味でだけ使う）。ホバーと is-selected の地が勝つよう、
   それらより前に書く。 */
.dtable tbody tr.is-st-draft    { background: var(--c-st-draft-bg); }
.dtable tbody tr.is-st-progress { background: var(--c-st-progress-bg); }
.dtable tbody tr.is-st-ok       { background: var(--c-st-ok-bg); }
.dtable tbody tr.is-st-ng       { background: var(--c-st-ng-bg); }
.dtable tbody tr.is-st-skip     { background: var(--c-st-skip-bg); }

.dtable tbody tr:hover {
  background: var(--c-row-hover);
}

/* 行の左端の帯（is-priority-*、is-mark-*）は付けない。状態は地の色（is-st-*）とバッジで示す */

.dtable tbody tr.is-selected {
  background: var(--c-brand-pale);
}

.dtable tbody tr.is-clickable {
  cursor: pointer;
}

/* セルの中の 2 段目（補足の小さな文字） */
.cell-sub {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
  font-weight: 400;
}

/* 数字の列: 右寄せ、桁揃え、折り返さない */
.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* thead th（text-align: left）の上でも右寄せにするため、詳細度を残す */
.dtable .num {
  text-align: right;
  white-space: nowrap;
}

.dtable__empty {
  padding: var(--sp-6);
  text-align: center;
  color: var(--c-text-mute);
  font-size: var(--fs-sm);
}

/* 集計行 / 合計行 */
.dtable tr.is-total > * {
  background: var(--c-th-bg);
  font-weight: 600;
}

.dtable tr.is-subtotal > * {
  background: var(--c-bg-sub);
  font-weight: 600;
}

.dtable__scroll {
  max-height: 520px;
  overflow: auto;
}

/* 回答一覧は、枠の高さを画面に収めて枠の中で縦にも送る。表の下の横スクロールバーが画面の中に出る
   （100 件でも一番下まで行かずに横に送れる）。見出しの行は .dtable--sticky で枠の上に止まる。
   ここは JS が無いときの上限。response-table.js が、開いた位置から画面の下までの高さに合わせ直す */
.dtable__scroll:has(> .response-table) {
  max-height: calc(100dvh - var(--h-header) - var(--h-table-gap));
}

/* 年度の予算の表（74 行）も、画面の下まで使う。引くのは、ページの見出し・欄の見出し・下の余白 */
.dtable__scroll:has(> .plbudget) {
  max-height: calc(100dvh - var(--h-header) - 126px);
}

/* --- 4.1 定義テーブル型フォーム（最重要） ------------------------------- */
.deftable {
  width: 100%;
  font-size: var(--fs-sm);
  background: var(--c-bg);
}

.deftable th {
  width: var(--w-deflabel);
  padding: var(--sp-2);
  background: var(--c-th-bg);
  border: 1px solid var(--c-border);
  font-weight: 600;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.deftable td {
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  vertical-align: middle;
}

.deftable th.req::before {
  content: "*";
  color: var(--c-st-ng);
  margin-right: 2px;
  font-weight: 700;
}

.deftable td.is-readonly {
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
}

/* 稟議書の「記」の帯 */
.deftable .noticeband {
  background: var(--c-bg-sub);
  text-align: center;
  font-size: var(--fs-sm);
  padding: var(--sp-2);
}

.deftable .noticeband b {
  display: block;
  margin-top: var(--sp-1);
  letter-spacing: 0.5em;
}

/* セクション見出し行 */
.deftable .sectionrow > * {
  background: var(--c-border-light);
  font-weight: 600;
  text-align: center;
  padding: var(--sp-1) var(--sp-2);
}

/* --- フォーム部品 ------------------------------------------------------ */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0 var(--sp-2);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  height: var(--h-input);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
}

.textarea {
  height: auto;
  min-height: 60px;
  padding: var(--sp-1) var(--sp-2);
  line-height: 1.5;
  resize: vertical;
}

.input--num { width: 8rem; max-width: 100%; text-align: right; }
.input--code { width: 6rem; max-width: 100%; }
.select--auto { width: auto; max-width: 100%; }
.input--sm { width: 120px; }
.input--md { width: 200px; }
.input--short { width: 16rem; max-width: 100%; }
.input--date { width: 10rem; max-width: 100%; }
.input--wide { width: 100%; max-width: 36rem; }
.input--amount { width: 12rem; max-width: 100%; text-align: right; }
.select--wide { width: 100%; max-width: 24rem; }

.select {
  height: var(--h-input);
  padding-right: var(--sp-1);
}

/* textarea + 文字数カウンタ（HRMOSらしさの核） */
.charfield {
  position: relative;
}

.charfield .counter {
  position: absolute;
  /* textarea 右下のリサイズグリップに重ならない位置に置く */
  right: 16px;
  bottom: 3px;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
  background: var(--c-bg);
  padding: 0 2px;
  pointer-events: none;
}

.charfield .textarea {
  padding-bottom: 14px;
}

.charfield.is-over .counter {
  color: var(--c-st-ng);
  font-weight: 600;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-right: var(--sp-3);
  font-size: var(--fs-sm);
}

.checkline input {
  margin: 0;
}

.ringi-circulation__quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.ringi-circulation__list {
  max-height: 22rem;
  overflow-y: auto;
  margin-top: var(--sp-2);
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}

.ringi-circulation__list .checkline {
  margin-right: 0;
}

.ringi-circulation__node {
  margin: var(--sp-1) 0;
}

.ringi-circulation__node .ringi-circulation__node {
  margin-left: var(--sp-3);
}

.ringi-circulation__node > summary {
  cursor: pointer;
  font-weight: 600;
}

.ringi-circulation__members {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: var(--sp-1) 0 var(--sp-1) var(--sp-3);
}

.fieldrow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* 縦に積むフォームは、画面の横いっぱいに広げない（DESIGN §4.10） */
.fieldrow--stack {
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-1);
  max-width: var(--w-form-max);
}

.fieldrow--stack > label,
.fieldrow--stack > .fieldrow__label > label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-sub);
}

/* 欄の見出しと「?」。説明は欄の下に書かず、吹き出しに入れる */
.fieldrow__label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.checkline > .helptip {
  margin-left: calc(var(--sp-2) * -1 + var(--sp-1));
}

/* 積んだセレクトは選択肢の幅にする（select--wide を付けたものは除く） */
.fieldrow--stack > .select:not(.select--wide) {
  align-self: flex-start;
  width: auto;
  min-width: var(--w-select-min);
  max-width: 100%;
}

/* 幅の段階を付けた入力欄は、積んでも伸ばさない */
.fieldrow--stack > .input[class*="input--"] {
  align-self: flex-start;
}

/* deftable の値のセルの入力欄も、上限の幅で止める */
.deftable td > .input:not([class*="input--"]),
.deftable td > .textarea,
.deftable td > .charfield {
  max-width: var(--w-form-max);
}

/* 短い欄を横に並べる格子。中は fieldrow--stack を並べる */
.formgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--w-formgrid-col), max-content));
  gap: var(--sp-3) var(--sp-4);
  align-items: end;
}

.formgrid > .fieldrow--stack + .fieldrow--stack {
  margin-top: 0;
}

/* 格子の中で、1 行を占める欄（名前など） */
.formgrid > .formgrid__wide {
  grid-column: 1 / -1;
}

/* 条件の欄のように、短いセレクト・数値だけが続くところは、列の幅をそろえず中身の幅で詰めて並べる
   （格子の列にすると、狭い欄の右に列の余りが空く）。1 行を占める欄は行を分ける */
.formgrid--pack {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
}

.formgrid--pack > .formgrid__wide {
  flex-basis: 100%;
  max-width: none;
}

.formgrid + .formgrid,
.formgrid + .formactions {
  margin-top: var(--sp-3);
}

.ringi-form {
  width: 100%;
}

.panel--ai-response .panel__head {
  background: var(--c-brand-soft, #f0f6ff);
}

.ai-response__label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-text-sub);
}

.ai-response__sublabel {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-sub);
}

.ai-response__text {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-md);
  font-weight: 600;
}

.ai-response__list {
  margin: var(--sp-1) 0 0;
  padding-left: 1.25rem;
}

.ai-response__raw {
  margin: var(--sp-2) 0 0;
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub, #f8f8f8);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-xs);
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.ringi-sheet {
  border-collapse: collapse;
}

.ringi-sheet tr:first-child th,
.ringi-sheet tr:first-child td {
  border-top: 0;
}

.ringi-sheet .input,
.ringi-sheet .select,
.ringi-sheet .textarea {
  max-width: none;
}

.ringi-sheet__inline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.ringi-sheet__hint {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-sheet__count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-2);
}

/* 明細: 件名・申請金額の表と、残りの表の間に、パネルの幅いっぱいで置く */
.ringi-sheet__lines {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  border-left: 1px solid var(--c-border);
  border-right: 1px solid var(--c-border);
  background: var(--c-bg);
}

.ringi-sheet--rest tr:first-child th,
.ringi-sheet--rest tr:first-child td {
  border-top: 1px solid var(--c-border);
}

.ringi-sheet__lines .note {
  margin: var(--sp-2) 0;
}

.ringi-lines__head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.ringi-lines__title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
}

.ringi-lines__opt {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-lines th,
.ringi-lines td {
  padding: var(--sp-1);
}

.ringi-lines .input,
.ringi-lines .select {
  width: 100%;
  max-width: none;
}

/* 列の幅。入力欄に最小幅を持たせ、狭い画面では .dtable__scroll の中で横に送る */
.ringi-lines td:first-child .input { min-width: 9rem; }
.ringi-lines td:nth-child(2) { width: 4.5rem; }
.ringi-lines td:nth-child(2) .input { min-width: 3.5rem; }
.ringi-lines td:nth-child(3),
.ringi-lines td:nth-child(4) { width: 7.5rem; }
.ringi-lines td:nth-child(3) .input,
.ringi-lines td:nth-child(4) .input { min-width: 6.5rem; }
.ringi-lines td:nth-child(5) { width: 11rem; }
.ringi-lines td:nth-child(5) .select { min-width: var(--w-line-expense-min); }
.ringi-lines td:last-child { width: 1%; white-space: nowrap; }

.ringi-lines__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.ringi-lines__total {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ringi-lines__total.is-warn { color: var(--c-st-ng); }

.ringi-lines__diff {
  margin-left: var(--sp-2);
}

/* .btn の display が hidden 属性に勝たないようにする（合計が合えば「入れる」を隠す） */
.ringi-lines__foot [hidden] { display: none; }

/* 1280px 以上では、フォームの右に要約の列を置く。それより狭い画面では出さない */
.ringi-summary {
  display: none;
}

@media (min-width: 1280px) {
  .ringi-form__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--w-formside);
    gap: var(--sp-4);
    align-items: start;
  }

  /* 右の列（要約と決裁ルートの予告）をまとめて止める。画面より高ければ列の中で送る */
  .ringi-form__side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    max-height: 100vh;
    overflow-y: auto;
  }

  .ringi-summary {
    display: block;
    background: var(--c-bg);
    border: 1px solid var(--c-border);   /* 上端の銅の太い線は付けない（詳細の要約の帯と同じ） */
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
  }
}

/* --- 稟議の編集を、稟議詳細と同じ「紙」の形に（DESIGN.md 4.44） ----------------------
   紙と右の列の幅・寄せ方は詳細（.fusen-desk）と同じ。紙は白い 1 枚で、右上の角を折り返す。
   欄は表の罫線で囲まず、欄の名前を淡い札にして上に置き、その下に入力を幅いっぱいに置く。
   欄どうしは、詳細と同じ点線で区切る。明細の表だけは表のまま */
@media (min-width: 1100px) {
  .ringi-form--paper .ringi-form__layout {
    display: grid;
    grid-template-columns: minmax(0, var(--w-fusen-paper)) var(--w-fusen);
    column-gap: var(--sp-5);
    justify-content: center;
    align-items: start;
  }

  .ringi-form--paper .ringi-form__side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    max-height: 100vh;
    overflow-y: auto;
  }

  .ringi-form--paper .ringi-summary {
    display: block;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
  }
}

.ringi-form--paper .ringi-form__main {
  position: relative;
  border-top-right-radius: 0;
}

/* たたき台をフォームに入れたあと、フォームの紙を下からせり上げ、右の列を少し遅れて出す */
.ringi-form.is-entering .ringi-form__main {
  animation: ringi-paper-in var(--dur-paper) cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.ringi-form.is-entering .ringi-form__side {
  animation: fusen-in var(--dur-rise) cubic-bezier(0.2, 0.7, 0.2, 1) 280ms both;
  --fusen-from: var(--dist-rise) 0;
}

@media (prefers-reduced-motion: reduce) {
  .ringi-form.is-entering .ringi-form__main,
  .ringi-form.is-entering .ringi-form__side { animation: none; }
}

/* 右上の折り返しは、詳細の紙の規則（.ringi-detail--simple .ringi-detail__main::before）を共有する */

/* 紙の頭（「稟議書」と起案支援のボタン）は、灰の帯にせず白い紙のまま。折り返しのぶん右を空ける */
.ringi-form--paper .ringi-form__main > .panel__head {
  padding-right: calc(var(--sp-3) + var(--sp-6));   /* 折り返しの角（34px）にボタンが掛からないように */
  border-bottom: 1px solid var(--c-border-light);
  background: none;   /* 紙の白に任せる（地を塗ると、左上の角丸に四角い角がはみ出す） */
}

/* 欄の表を、札と入力の縦の並びにする */
.ringi-form--paper .ringi-sheet,
.ringi-form--paper .ringi-sheet > tbody,
.ringi-form--paper .ringi-sheet tr,
.ringi-form--paper .ringi-sheet th,
.ringi-form--paper .ringi-sheet td {
  display: block;
  width: auto;
}

.ringi-form--paper .ringi-sheet {
  padding: 0 var(--sp-5);
  background: none;   /* 地は紙（パネル）の白に任せる。表に地を塗ると、紙の下の角丸の上に四角い角がはみ出す */
}

/* 紙の最後の欄の下には区切りの点線を引かず、紙の下に余白をとる */
.ringi-form--paper .ringi-sheet--rest tr:last-child {
  padding-bottom: var(--sp-5);
  background: none;
}

.ringi-form--paper .ringi-sheet tr {
  padding: var(--sp-3) 0;
  background: radial-gradient(circle, var(--c-border-light) 1px, transparent 1.4px) left bottom / 7px 4px repeat-x;
}

.ringi-form--paper .ringi-sheet td,
.ringi-form--paper .ringi-sheet tr:first-child td,
.ringi-form--paper .ringi-sheet--rest tr:first-child td {
  padding: 0;
  border: 0;
  background: none;
}

/* 札（th）は罫線だけ消す。地と余白は札の規則に任せる */
.ringi-form--paper .ringi-sheet th,
.ringi-form--paper .ringi-sheet tr:first-child th,
.ringi-form--paper .ringi-sheet--rest tr:first-child th {
  border: 0;
}

/* 欄の名前は、詳細の紙と同じ淡い札（.ringi-detail--simple .ringi-read__row dt の規則を共有する） */
.ringi-form--paper .ringi-sheet th {
  justify-self: start;
}

/* 札の中の「?」（欄の説明）。札の字のすぐ右に、上下の中央をそろえて置く */
.ringi-form--paper .ringi-sheet th:has(> .helptip) {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.ringi-form--paper .ringi-sheet th .helptip__btn {
  color: var(--c-brand-dark);
  opacity: 0.6;
}

.ringi-form--paper .ringi-sheet th .helptip__btn svg {
  transform: none;
}

/* 吹き出しの字は、札の字（小さな太字・字間）を受け継がない */
.ringi-form--paper .ringi-sheet th .helptip__bubble {
  letter-spacing: normal;
  text-align: left;
}

/* 「記」の帯と、節の見出しの行は、札を立てず紙の中の小見出しにする */
.ringi-form--paper .ringi-sheet td.noticeband,
.ringi-form--paper .ringi-sheet .sectionrow > * {
  padding: var(--sp-2) 0;
  background: none;
  text-align: center;
  color: var(--c-text-sub);
}

/* 明細は、紙の中に左右の線なしで置く */
.ringi-form--paper .ringi-sheet__lines {
  padding: var(--sp-3) var(--sp-5);
  border-left: 0;
  border-right: 0;
  background: radial-gradient(circle, var(--c-border-light) 1px, transparent 1.4px) left bottom / 7px 4px repeat-x;
}

.ringi-form--paper .ringi-forecast-slot[data-ringi-forecast-slot="narrow"] {
  border-left: 0;
  border-right: 0;
}

/* 選ぶ欄は、紙の幅いっぱいに伸ばさず、中身（いちばん長い選択肢）の幅にする。
   長く伸ばすと、短い言葉（「振込」）に大きな箱が付いて圧迫感が出る */
.ringi-form--paper .ringi-sheet .select {
  width: fit-content;
  min-width: var(--w-select-min);
  max-width: min(100%, var(--w-select-drop-max));
}

/* 同じ欄に選ぶ欄を 2 つ以上並べるとき（関連部署、施策・行事）は、縦に積まず横に並べる */
.selectrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

/* 文章を書く欄は、紙の幅いっぱいに */
.ringi-form--paper .ringi-sheet td > .textarea,
.ringi-form--paper .ringi-sheet td > .charfield {
  max-width: none;
}

.ringi-form--paper .ringi-sheet .charfield,
.ringi-form--paper .ringi-sheet .textarea {
  width: 100%;
}

/* 起案支援の結果とチェックも、紙の左右の余白にそろえる */
.ringi-form--paper .ringi-ai-summary,
.ringi-form--paper .ringi-ai-rubric {
  padding-left: var(--sp-5);
  padding-right: var(--sp-5);
}

/* 条件付き決裁の指示事項（GLIQ-316）。右の列の幅に収まるよう、表にせず 1 件ずつ縦に並べる */
.ringi-instr {
  display: grid;
  margin: var(--sp-2) 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}

.ringi-instr__item {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
}

.ringi-instr__item + .ringi-instr__item {
  border-top: 1px solid var(--c-border-light);
}

.ringi-instr__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}

.ringi-instr__body {
  font-size: var(--fs-sm);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ringi-instr__top .badge {
  flex: none;
}

.ringi-instr__meta {
  margin: 0;
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.ringi-instr__late {
  color: var(--c-st-ng);
  font-weight: 700;
}

/* 済んだものは薄く */
.ringi-instr__item.is-done .ringi-instr__body {
  color: var(--c-text-sub);
  font-weight: 400;
}

.ringi-instr__item form {
  margin-top: var(--sp-1);
}

.ringi-instr__item form .btn {
  width: 100%;
  justify-content: center;
}

/* 決裁ルートの予告（DESIGN.md 4.2）。欄は 1 つで、ringi-forecast.js が置き場を移す */
.ringi-forecast {
  margin: 0;
  font-size: var(--fs-sm);
}

.ringi-forecast-slot:empty {
  display: none;
}

/* 狭い画面: 明細の下。明細と同じ左右の線の中に置く */
.ringi-forecast-slot[data-ringi-forecast-slot="narrow"] {
  padding: 0 var(--sp-3) var(--sp-3);
  border-left: 1px solid var(--c-border);
  border-right: 1px solid var(--c-border);
  background: var(--c-bg);
}

/* JS が無い狭い画面では、右の列がフォームの下に来る */
@media (max-width: 1279px) {
  .ringi-form__side > .ringi-forecast-slot:not(:empty) {
    margin-top: var(--sp-4);
  }
}

.ringi-forecast .panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);   /* ほかの欄の見出しと同じ。「?」は .panel__head > .helptip の負の余白で字の 4px 右に寄る */
}

/* 「?」は見出しの字のすぐ右（ほかの欄の見出しと同じ）。保存前などの状態だけを右端へ寄せる。
   前は両端寄せ（space-between）で、「?」が見出しと状態のあいだの真ん中に浮いていた */
.ringi-forecast__status {
  margin-left: auto;
}

.ringi-forecast__status {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-sub);
}

.ringi-forecast__template {
  margin: 0 0 var(--sp-2);
  font-weight: 600;
}

.ringi-forecast__label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-sub);
}

/* 列の幅に段を等分する（詳細の承認欄の 84px の段幅を外す。.route th より後に効くよう 2 クラスで指す）。
   右の列（232px）でも 4〜5 段が横に送らずに収まる */
.route.ringi-forecast__stamps th {
  width: auto;
  padding: 2px;
  overflow-wrap: anywhere;
}

/* 飛ばす段の理由（「起案者本人のため」など）。「不要」と同じ薄い色 */
.ringi-forecast__stamps td.is-skip .route__name,
.ringi-forecast__reason {
  color: var(--c-st-skip);
}

.ringi-forecast__reason {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ringi-forecast__guide {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-forecast__issues {
  margin-top: var(--sp-2);
}

.ringi-forecast__issues ul {
  margin: var(--sp-1) 0 0;
  padding-left: 1.2em;
}

.ringi-forecast__foot {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

/* 専決で終われば要らない段（まだ決まっていない）。「不要」より薄く、点線で囲う */
.route td.is-maybe {
  color: var(--c-text-mute);
  background: var(--c-bg-sub);
  border-style: dashed;
}

.route td.is-maybe .route__name,
.route td.is-maybe .ringi-forecast__reason {
  color: var(--c-text-mute);
}

/* 専決の段の印（予告の承認者の下） */
.ringi-forecast__final {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-ink);
}

/* 専決の印（承認欄）。承認と同じ緑で、枠を二重にする */
.stamp--final {
  border-style: double;
  border-width: 3px;
}

/* 付け替え前のルート（承認欄の下）。今のルートと混ぜず、全体を薄く */
.ringi-superseded {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--c-border);
  opacity: 0.7;
}

.ringi-superseded__title {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-sub);
}

.ringi-superseded__sub {
  font-weight: 400;
}

.stamp--old {
  border-color: var(--c-st-none);
  color: var(--c-st-none);
}

/* 決裁ルートの付け替えの欄（管理者の操作） */
.ringi-reassign__panel {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
}

.ringi-reassign__current {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
}

.ringi-reassign__preview {
  margin: var(--sp-2) 0;
}

.ringi-reassign__preview.is-loading {
  opacity: 0.5;
}

.ringi-reassign__confirm {
  margin: var(--sp-2) 0;
  font-size: var(--fs-sm);
}

.ringi-summary__head {
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-th-bg);
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
}

.ringi-summary__amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--sp-2);
  padding: var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
}

.ringi-summary__label {
  flex: 1 0 100%;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-summary__yen {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ringi-summary__yen b {
  font-size: var(--fs-2xl);
  font-weight: 700;
}

.ringi-summary__note {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-summary__list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-3);
  margin: 0;
  padding: var(--sp-3);
}

.ringi-summary__list dt {
  color: var(--c-text-sub);
  white-space: nowrap;
}

.ringi-summary__list dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.ringi-summary__warn {
  display: block;
  color: var(--c-st-ng);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.ringi-summary__none {
  color: var(--c-text-mute);
}

/* 操作帯の左の「申請に足りないもの」。必須の欠けは赤のバッジ、揃えば緑の文字 */
.ringi-missing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  font-size: var(--fs-sm);   /* 帯の左端に置く（前は「詳細」「削除」の後ろで、縦線で区切っていた） */
  min-width: 0;
}

.ringi-missing__label {
  font-weight: 600;
  color: var(--c-st-ng);
}

.ringi-missing__ok {
  font-weight: 600;
  color: var(--c-st-ok);
}

.ringi-missing__ok::before {
  content: "\2713\00a0";
}

/* 焦茶の地の下の帯（formfoot(dark=True)）。アンケートの設定の保存の帯（.survey-savebar）と同じ見た目を、
   ほかの画面でも使えるようにしたもの。主ボタンは白地に焦茶の字、ほかのボタンは透明の地に白い枠 */
.formfoot.formfoot--dark {
  background: var(--c-header-bg);
  border-top-color: var(--c-header-bg);
  color: var(--c-text-inv);
}

.formfoot--dark .btn-primary {
  background: var(--c-bg);
  border-color: var(--c-bg);
  color: var(--c-header-bg);
}

.formfoot--dark .btn-primary:not(:disabled):hover {
  background: var(--c-brand-pale);
  border-color: var(--c-brand-pale);
}

.formfoot--dark .btn-secondary {
  background: transparent;
  border-color: var(--c-on-dark-stroke);
  color: var(--c-text-inv);
}

.formfoot--dark .btn-secondary:not(:disabled):hover {
  background: var(--c-on-dark-fill-hover);
}

.formfoot--dark .btn-ghost {
  color: var(--c-on-dark-sub);
}

.formfoot--dark .btn-ghost:not(:disabled):hover {
  background: var(--c-on-dark-fill);
  color: var(--c-text-inv);
}

.formfoot--dark .savechip { color: var(--c-on-dark-sub); }

/* 稟議の「申請に足りないもの」: 区切りの線と字を、焦茶の上で読める色に。足りないもののバッジは淡い地のまま */
.formfoot--dark .ringi-missing__label { color: var(--c-text-inv); }
.formfoot--dark .ringi-missing__ok { color: var(--c-st-ok-bg); }

/* 欄の下にまとめて並べる開け閉め（承認欄の「ハンコと段ごとの記録を見る」「管理者の操作」）。
   幅いっぱいの行にして、上に細い線、字は左・「く」の字は右の端にそろえる */
/* 行の高さは上下の余白（--sp-3）で決め、字を線と線のまん中に置く。行と行のあいだに外の余白は足さない
   （.ringi-fold の margin より強く打ち消す）。最後の行は欄の下の余白を食って、上と同じ余白で終える */
.ringi-fold.ringi-fold--row { margin: 0; border-top: 1px solid var(--c-border); }
.ringi-fold.ringi-fold--row:first-of-type { margin-top: var(--sp-4); }
.ringi-fold.ringi-fold--row:last-child { margin-bottom: calc(-1 * var(--sp-3)); }
.ringi-fold--row > .ringi-fold__head { justify-content: space-between; padding: var(--sp-3) 0; line-height: 1.4; }
/* この行の太字の横では「く」の字の墨が 1px 下に出るので上げる（4 倍の画面で、字と印の墨の上下の真ん中を測った） */
.ringi-fold--row > .ringi-fold__head .ringi-fold__chev { top: -1px; }
.ringi-fold--row[open] > .ringi-fold__head { color: var(--c-text); }
/* 開いた中身の下にも、見出しの上下と同じ余白をとってから次の行の線を引く */
.ringi-fold.ringi-fold--row[open] { padding-bottom: var(--sp-3); }
.ringi-fold--row .ringi-ops__actions { justify-content: flex-start; margin: 0; }

/* 稟議詳細。小難しい情報は、押したら開く「く」の字の行にたたむ */
.ringi-fold {
  margin: var(--sp-3) 0 0;
}

.ringi-fold__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-sub);
  cursor: pointer;
  list-style: none;
}

.ringi-fold__head::-webkit-details-marker { display: none; }
.ringi-fold__head:hover { color: var(--c-text); }

.ringi-fold__chev {
  flex: none;
  width: 18px;
  height: 18px;
  position: relative;
  transition: transform var(--dur-slide) ease-in-out;
}

.ringi-fold[open] > .ringi-fold__head .ringi-fold__chev { transform: rotate(180deg); }

/* AI サマリーの欄（details）。見出しを押すと閉じ・開く。右に「閉じる／開く」と山形 */
.aisum__head {
  cursor: pointer;
  list-style: none;
}

.aisum__head::-webkit-details-marker { display: none; }

.aisum__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--c-text-sub);
}

.aisum__head:hover .aisum__toggle { color: var(--c-text); }
.aisum[open] .aisum__open,
.aisum:not([open]) .aisum__close { display: none; }
.aisum[open] > .aisum__head .ringi-fold__chev { transform: rotate(180deg); }

/* 閉じたときは見出しの下の線を消し、角を丸める */
.aisum:not([open]) > .aisum__head {
  border-bottom: 0;
  border-radius: var(--r-md-inner);
}

/* --- 稟議詳細: 読んで、ボタンを押すだけに見せる ------------------- */

/* 金額を大きく、誰がいつ申請したかを 1 行の文で */
.ringi-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
  margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border-light);   /* 本文のカードの先頭。下の本文と線で分ける */
}

.ringi-lead__yen {
  font-size: var(--fs-md);
  color: var(--c-text-sub);
}

.ringi-lead__yen b {
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.ringi-lead__who { color: var(--c-text-sub); }

.ringi-lead__sub {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

/* 業者と実施時期。金額の行の下に、1 行で小さく添える */
.ringi-lead__deal {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--c-text);
}

.ringi-lead__key {
  margin-right: var(--sp-2);
  color: var(--c-text-mute);
}

/* 本文の下（やり取り・回覧など）は、たたんだ行が並ぶだけなので箱にしない */
.ringi-detail--simple .ringi-detail__more {
  border: 0;
  background: transparent;
}

.ringi-detail--simple .ringi-detail__more > .panel__body { padding: 0 var(--sp-1); }
.ringi-detail--simple .ringi-detail__more .ringi-talk { margin-top: 0; padding-top: 0; }

/* 本文のカードの中の AI サマリー: 箱にせず、淡い地の 1 枚で要点だけ。要点の一覧と作り直しは「全部見る」で出す */
.ringi-simple-sum { margin: 0 0 var(--sp-4); }
.ringi-simple-sum--end { margin: var(--sp-4) 0 0; }
.ringi-simple-sum--end:empty { display: none; }

.ringi-simple-sum .aisum {
  margin: 0 0 var(--sp-2);
  border: 0;
  border-radius: var(--r-md);
  background: var(--c-depth-1);
}

.ringi-simple-sum .aisum > .aisum__head {
  padding: var(--sp-2) var(--sp-3) 0;
  border: 0;
  background: none;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-simple-sum .aisum > .panel__body { padding: var(--sp-1) var(--sp-3) var(--sp-3); }

/* 閉じたときは、見出しの上下の余白をそろえる（開いたときの下の余白は本文が持つ） */
.ringi-simple-sum .aisum:not([open]) > .aisum__head { padding-bottom: var(--sp-2); }

.ringi-simple-sum .aisum:not(.is-full) .aisum__points,
.ringi-simple-sum .aisum:not(.is-full) .aisum__regen { display: none; }

.aisum__all { display: none; }

.ringi-simple-sum .aisum:not(.is-full) .aisum__all {
  display: inline-block;
  margin-top: var(--sp-1);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-brand);
  cursor: pointer;
}

/* AI 仮審査などのたたんだ行も、サマリーのすぐ下に */
.ringi-simple-sum .ringi-fold { margin-top: 0; }

/* 本文のカードは紙に見せる。右上の角を三角に折り返す（ドッグイヤー）。影は使わず（§0-2）、
   切り取った側は地の色、折り返した側は少し濃い地と細い線で描く */
.ringi-detail--simple .ringi-detail__main {
  position: relative;
  border-top-right-radius: 0;
}

.ringi-detail--simple .ringi-detail__main::before,
.ringi-form--paper .ringi-form__main::before,
.panel--paper::before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-left: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  border-bottom-left-radius: 4px;
  background: linear-gradient(to bottom left,
    var(--c-bg-sub) 0 calc(50% - 0.6px),
    var(--c-border) calc(50% - 0.6px) calc(50% + 0.6px),
    var(--c-th-bg) calc(50% + 0.6px));
  pointer-events: none;
}

/* 画面を開いたとき、紙を机に差し出すように、本文のカードだけ下からせり上げて出す。
   保存のあとの差し替え（softRefresh）では .main に td-shown が付いているので、もう動かさない */
.main:not(.td-shown) .ringi-detail--simple .ringi-detail__main,
.main:not(.td-shown) .panel--paper {
  animation: ringi-paper-in var(--dur-paper) cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes ringi-paper-in {
  from { opacity: 0; transform: translateY(var(--dist-paper)); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .main:not(.td-shown) .ringi-detail--simple .ringi-detail__main,
  .main:not(.td-shown) .panel--paper { animation: none; }
}

/* 入力の欄を、稟議詳細と同じ紙に見せる（panel(..., paper=True)）。右上の折り返しは上の規則を共有。
   頭は灰の帯にせず白い紙のまま、欄の名前は淡い札、欄と欄のあいだは点線 */
.panel--paper {
  position: relative;
  border-top-right-radius: 0;
}

.panel--paper > .panel__head {
  padding-right: calc(var(--sp-3) + var(--sp-6));   /* 折り返しの角にかからないように */
  border-bottom: 1px solid var(--c-border-light);
  background: none;
}

.panel--paper > .panel__body {
  padding: var(--sp-2) var(--sp-5) var(--sp-5);
}

.panel--paper .fieldrow--stack {
  padding: var(--sp-3) 0;
  background: radial-gradient(circle, var(--c-border-light) 1px, transparent 1.4px) left bottom / 7px 4px repeat-x;
}

.panel--paper .fieldrow--stack + .fieldrow--stack,
.panel--paper .vdetail__pair {
  margin-top: 0;
}

.panel--paper .fieldrow--stack > label,
.panel--paper .fieldrow__label > label {
  align-self: flex-start;
  margin-bottom: 0;
}

.panel--paper .formactions {
  margin-top: var(--sp-4);
}

/* 紙の最後の欄の下には点線を引かない */
.panel--paper .fieldrow--stack:last-child {
  background: none;
}

/* 本文は白い 1 枚の紙に。中の余白を広めにとる */
.ringi-detail--simple .ringi-detail__main > .panel__body { padding: var(--sp-5); }

/* --- 付箋で見る（試作 ?ui=fusen） -------------------------------------------
   紙（本文）は誰が見ても同じ。右の列（サイドバー）の先頭に、見る人宛ての付箋風の吹き出しを
   1 つだけ出し、その下に承認欄と、回覧・やり取りを置く（いつもの詳細の右の列と同じ部品）。
   広い画面では吹き出しの左の口が紙を指す。狭い画面は 1 列で、吹き出し → 紙 → 承認欄・回覧の順。
   傾けない。影は使わない（§0-2） */
.fusen-desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--sp-3);
}

.fusen-desk__side { display: contents; }

.fusen-desk > .fusen-desk__paper { order: 2; }

.fusen-desk__side > .fusen { order: 1; }

.fusen-desk__side > .panel { order: 3; }

@media (min-width: 1100px) {
  /* 紙は読みやすい幅（--w-fusen-paper）までにとどめ、紙と右の列をまとめて中央に寄せる */
  .fusen-desk {
    grid-template-columns: minmax(0, var(--w-fusen-paper)) var(--w-fusen);
    column-gap: var(--sp-5);
    justify-content: center;
    align-items: start;
  }
  /* 右の列は、紙を下へ読み進めても画面の上に止めておく（いつもの詳細の右の列と同じ）。
     画面より高ければ列の中で送る。送る箱の外は切れるので、吹き出しの左の口のぶんだけ
     左に内側の余白をとり、同じだけ外へずらして位置は変えない */
  .fusen-desk__side {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: var(--sp-3);
    max-height: calc(100dvh - var(--h-header) - var(--sp-3) * 2);
    overflow-y: auto;
    scrollbar-width: thin;
    margin-left: calc(-1 * var(--sp-3));
    padding-left: var(--sp-3);
  }
  .fusen-desk > .fusen-desk__paper { grid-column: 1; grid-row: 1; }
  .fusen-desk__side > .panel { margin: 0; }
  /* 口は左。左上の札より下から紙を指す（左と下に縁のある四角を、角が左を向くよう回す） */
  .fusen-desk__side > .fusen::before {
    top: calc(var(--sp-6) + var(--sp-3));
    left: calc(var(--fusen-tail) / -2 - 1px);
    border-width: 0 0 1px 1px;
  }
  .fusen-desk__side > .fusen { --fusen-from: calc(-1 * var(--dist-rise)) 0; }
}

.fusen {
  --fusen-tail: 12px;
  --fusen-from: 0 calc(-1 * var(--dist-rise));
  position: relative;
  /* 上は左上の札（高さ約 28px）のぶんと、その下の少しの間だけあける */
  padding: calc(28px + var(--sp-3)) var(--sp-4) var(--sp-4);
  border: 1px solid var(--c-fusen-line);
  border-radius: var(--r-md);
  background: var(--c-fusen-bg);
}

/* 吹き出しの口。地の色の小さな四角に 2 辺だけ縁を付け、45 度回して角を外へ出す。
   四角の半分は吹き出しの内側に入り、そこの縁を地の色で覆うので、口と吹き出しの縁がつながる。
   狭い画面は下向き（紙が下にある）。広い画面は左向き（上の @media） */
.fusen::before {
  content: "";
  position: absolute;
  top: calc(100% - var(--fusen-tail) / 2 - 1px);
  left: var(--sp-6);
  width: var(--fusen-tail);
  height: var(--fusen-tail);
  border: solid var(--c-fusen-line);
  border-width: 0 1px 1px 0;
  background: var(--c-fusen-bg);
  rotate: 45deg;
  pointer-events: none;
}

.main:not(.td-shown) .fusen {
  animation: fusen-in var(--dur-rise) cubic-bezier(0.2, 0.7, 0.2, 1) 280ms both;
}

/* 紙がせり上がったあと、紙の側から吹き出しがすっと出る */
@keyframes fusen-in {
  from { opacity: 0; translate: var(--fusen-from); }
  to   { opacity: 1; translate: none; }
}

/* 見出し（あなたの番です、など）は、吹き出しの左上の角に付けた札にする。
   角の丸みを吹き出しに合わせ、右下だけ丸める。色は状態の色（自分の承認の番は赤で目立たせる、
   差戻しも赤、申請前は橙、審査中は青） */
.fusen__title {
  position: absolute;
  top: -1px;
  left: -1px;
  margin: 0;
  padding: 5px 14px;
  border-radius: var(--r-md) 0 var(--r-md) 0;
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.fusen--approve .fusen__title,
.fusen--returned .fusen__title { background: var(--c-st-ng); }

.fusen--draft .fusen__title { background: var(--c-st-draft); }

.fusen--waiting .fusen__title { background: var(--c-st-progress); }

.fusen__line { margin: 0 0 var(--sp-1); }

.fusen__lead {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: var(--sp-3) 0 var(--sp-2);
  color: var(--c-text);
  font-size: var(--fs-md);
  font-weight: 700;
}

/* 見る所の虫めがね（字の大きさに合わせ、字と同じ濃さ）。そのまま並べると墨が字より約 2px 下に寄るので
   （4 倍の画面で、印と字の墨の上下の真ん中を測った）、その分だけ上げる */
.fusen__lead-icon { width: 16px; height: 16px; flex: none; transform: translateY(-2px); }

/* 見る所の札の下に来る最初のものは、上の間を足さない */
.fusen__title + .fusen__pointbox > .fusen__lead { margin-top: 0; }

/* 見る所の一覧は、白い紙の小さな枠にまとめる。行のあいだは細い線 */
.fusen__points {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--c-fusen-line);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  overflow: hidden;
}

.fusen__points > li + li { border-top: 1px solid var(--c-fusen-line); }

.fusen__point {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--c-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-press) ease-in-out;
}

.fusen__text { flex: 1; }

/* 押せることを示す右向きの印。乗せると右へ少し動く */
.fusen__go {
  flex: none;
  width: 18px;
  height: 18px;
  position: relative;
  top: -1px;
  color: var(--c-text-sub);
  transition: translate var(--dur-press) ease-in-out;
}

/* 乗せたときは薄い灰の地、示しているときは少し濃い地（下線は付けない） */
.fusen__point:hover { background: var(--c-row-hover); }

.fusen__point.is-on { background: var(--c-th-bg); }

.fusen__point:hover .fusen__go { translate: 3px 0; }

/* 気になる点の札。紙の上の赤い印とは別に、言葉で「注意」と出す */
.fusen__tag {
  flex: none;
  /* 札と右の矢印は、字の墨より約 0.9px 下に出るので 1px 上げる（4 倍の画面で測った） */
  position: relative;
  top: -1px;
  padding: 0 var(--sp-2);
  border-radius: 999px;
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
  font-size: var(--fs-xs);
  line-height: 1.8;
}

.fusen__point.is-on { font-weight: 700; }

.fusen__point.is-on .fusen__go { color: var(--c-text); }

.fusen__form { margin-top: var(--sp-3); }

/* 見る所と、承認の操作のあいだに細い線を引いて分ける */
.fusen__pointbox + .fusen__form {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-fusen-line);
}

.fusen__stamp { margin-top: var(--sp-3); }

.fusen__stamp > .btn { width: 100%; justify-content: center; }

/* 線のすぐ下に来るときは、上の間を線の余白だけにする */
.fusen__form > .fusen__stamp:first-child { margin-top: 0; }

.fusen__other { margin-top: var(--sp-3); }

/* 承認ボタンの下の、横に並んだ 2 つの開け閉め（コメント・指示事項 ｜ 承認しないとき）。
   どちらも同じ幅で真ん中に字を置き、あいだに細い縦線。開いた中身はその下に幅いっぱいで出る */
.fusen__more {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  margin-top: var(--sp-2);
}

.fusen__more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: var(--h-btn);
  padding: 0 var(--sp-2);
  border: 0;
  background: none;
  color: var(--c-text-sub);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.fusen__more-btn + .fusen__more-btn { border-left: 1px solid var(--c-fusen-line); }
.fusen__more-btn:hover, .fusen__more-btn[aria-expanded="true"] { color: var(--c-text); }
.fusen__more-btn .ringi-fold__chev { transition: transform var(--dur-slide) ease-in-out; }
.fusen__more-btn[aria-expanded="true"] .ringi-fold__chev { transform: rotate(180deg); }

/* 見出しは上の 2 つのボタンが持つので、details の summary は見せない（開け閉めは summary を押して行う） */
.ringi-fold--bare { margin-top: 0; }
.ringi-fold--bare > .ringi-fold__head { display: none; }
.ringi-fold--bare[open] { margin-top: var(--sp-2); }
.fusen__other.ringi-fold--bare { margin-top: 0; }
.fusen__other.ringi-fold--bare[open] { margin-top: var(--sp-2); }

.fusen__links { margin: var(--sp-2) 0; }

.fusen__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.fusen__route {
  margin: var(--sp-3) 0 0;
  padding-left: 1.4em;
  font-size: var(--fs-sm);
}

.fusen__route > .is-done,
.fusen__route > .is-skip { color: var(--c-text-mute); }

.fusen__route > .is-now { font-weight: 700; }

/* 紙の側の見る所の札。見出し（欄の名前・たたんだ欄の見出し・金額）の横に、ringi-fusen.js が付ける。
   気になる点は「注意」（赤い字の淡い地）、ただ読む所は「見る」（灰の地）。押すと吹き出しの行と一緒に選ぶ */
.fusen-mark {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0 var(--sp-2);
  padding: 0 var(--sp-2);
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--c-st-none-bg);
  color: var(--c-text-sub);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.8;
  vertical-align: middle;
  cursor: pointer;
  transition: border-color var(--dur-press) ease-in-out;
}

.fusen-mark.is-flag {
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
}

.fusen-mark:hover,
.fusen-mark.is-on { border-color: currentColor; }

/* 見る所を押したとき: その所だけ濃く、紙のほかを薄くする */
.fusen-desk__paper :is(.ringi-lead, .ringi-simple-sum, .ringi-read__row, .ringi-fold, .ringi-read__missing, .sectionhead, #ringi-attachments) {
  transition: opacity var(--dur-slide) ease-in-out;
}

.fusen-desk.is-focusing .fusen-desk__paper :is(.ringi-lead, .ringi-simple-sum, .ringi-read__row, .ringi-fold, .ringi-read__missing, .sectionhead, #ringi-attachments):not(.is-fusen-focus):not(:has(.is-fusen-focus)):not(.is-fusen-focus *) {
  opacity: 0.28;
}

@media (prefers-reduced-motion: reduce) {
  .main:not(.td-shown) .fusen { animation: none; }
}

/* 本文の長い欄は 3 行で切り、「続きを読む」で開く（app.js の wireClamp） */
.ringi-detail--simple [data-clamp]:not([data-clamp-open]) {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-more {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-brand);
  cursor: pointer;
}

/* 承認欄: 段を線でつないだ丸の列。下に肩書と名前 */
.routesteps {
  display: flex;
  margin: 0;
  padding: var(--sp-2) 0 0;
  list-style: none;
}

.routesteps__step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

/* 前の段とのあいだの線。丸の中心から中心まで、丸の下を通す */
.routesteps__step + .routesteps__step::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--c-border);
}

.routesteps__step.is-done + .routesteps__step::before { background: var(--c-brand-dark); }

.routesteps__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: transparent;   /* 白で塗ると、線が丸の手前で切れて見える。線は小さな点の中心まで通す */
}

.routesteps__dot svg { width: 13px; height: 13px; }

.routesteps__step.is-wait .routesteps__dot::after,
.routesteps__step.is-skip .routesteps__dot::after,
.routesteps__step.is-now .routesteps__dot::after {
  content: "";
  border-radius: 50%;
}

.routesteps__step.is-wait .routesteps__dot::after {
  width: 9px;
  height: 9px;
  background: var(--c-border);
}

.routesteps__step.is-skip .routesteps__dot::after {
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: var(--c-st-skip);
}

.routesteps__step.is-done .routesteps__dot {
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
}

.routesteps__step.is-ng .routesteps__dot {
  background: var(--c-st-ng);
  color: var(--c-text-inv);
}

/* いまの段: 濃い点から輪が広がる（問いから作るの進み具合と同じ動き） */
.routesteps__step.is-now .routesteps__dot::after {
  width: 11px;
  height: 11px;
  background: var(--c-brand-dark);
  animation: qsteps-breathe 2.4s ease-in-out infinite, qsteps-ripple 2.4s ease-out infinite;
}

.routesteps__title {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.routesteps__name {
  max-width: 100%;
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routesteps__step.is-wait .routesteps__name,
.routesteps__step.is-skip .routesteps__name { color: var(--c-text-mute); font-weight: 400; }

@media (prefers-reduced-motion: reduce) {
  .routesteps__step.is-now .routesteps__dot::after { animation: none; }
}

/* 見出しの「…」メニュー（複製・模範例にする）。開くと右寄せで下に出す */
.pagemenu {
  position: relative;
}

.pagemenu__btn {
  list-style: none;
}

/* 開くのは下に重なるメニューなので、高さのスライドはさせない（中身を切らない） */
.pagemenu::details-content {
  block-size: auto;
  overflow: visible;
  transition: opacity var(--dur-slide) ease-in-out, content-visibility var(--dur-slide) allow-discrete;
}

.pagemenu__btn::-webkit-details-marker { display: none; }
.pagemenu__btn svg { width: 16px; height: 16px; }

.pagemenu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  display: grid;
  gap: var(--sp-1);
  min-width: 10rem;
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  box-shadow: var(--shadow-pop);   /* ドロップダウンは影の例外（§0-2） */
}

.pagemenu__list .btn { width: 100%; justify-content: flex-start; }

/* やり取り: 最新の 2 件だけ出し、「すべて見る」で残りを出す */
.ringi-talk:has([data-talk-all]) .ringi-talk__list:not(.is-all) > li:not(:nth-last-child(-n+2)) {
  display: none;
}

.ringi-talk__all {
  margin: var(--sp-1) 0 var(--sp-2);
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-brand);
  cursor: pointer;
}

/* --- 稟議詳細 ------------------------------------------------------------ */
/* 要約の帯。項目を罫線で区切って横に並べ、入りきらなければ折り返す */
.ringi-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--w-fact-min), 1fr));
  margin-bottom: var(--sp-4);
  background: var(--c-bg);
  border: 1px solid var(--c-border);   /* 上端の銅の太い線は付けない（飾りに見える） */
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  overflow: hidden;
}

.ringi-facts__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  border-right: 1px solid var(--c-border-light);
  border-bottom: 1px solid var(--c-border-light);
  margin: 0 -1px -1px 0;
}

.ringi-facts__item--amount {
  background: var(--c-brand-pale);
}

.ringi-facts__label {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-facts__value {
  overflow-wrap: anywhere;
}

.ringi-facts__line {
  display: block;
}

.ringi-facts__yen {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ringi-facts__yen b {
  font-size: var(--fs-2xl);
  font-weight: 700;
}

/* 1280px 以上は 2 列。右の列は上に承認欄と操作、下に承認ルートと履歴。
   左の本文は 2 行ぶんにまたがり、余った高さは下の行（1fr）が受ける */
.ringi-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--sp-4);
}

/* 狭い画面は 1 列で、読む本文 → 操作と承認欄 → そのほか（回覧・やり取り・AI）→ 承認ルート。
   1280px 以上は、右の列に操作と承認欄、その下に承認ルート。左の本文は右の 2 行にまたがり、
   余った高さは 2 行目（1fr）が受けるので、承認ルートは操作のすぐ下に付く（DESIGN.md 4.35） */
@media (min-width: 1280px) {
  .ringi-detail {
    grid-template-columns: minmax(0, 1fr) var(--w-detailside);
    grid-template-rows: auto 1fr auto;
    align-items: start;
  }

  .ringi-detail__main {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .ringi-detail__act {
    grid-column: 2;
    grid-row: 1;
  }

  .ringi-detail__route {
    grid-column: 2;
    grid-row: 2;
  }

  .ringi-detail__more {
    grid-column: 1;
    grid-row: 3;
  }
}

/* 稟議詳細: 右の列（承認の操作と承認欄）は、本文を下へ読み進めても画面の上に止めておく。
   列は 3 行ぶんにまたがらせ、その高さの中で止める。画面より高ければ列の中で送る */
@media (min-width: 1280px) {
  .ringi-detail--simple .ringi-detail__act {
    position: sticky;
    top: var(--sp-3);
    grid-row: 1 / span 3;
    max-height: calc(100dvh - var(--h-header) - var(--sp-3) * 2);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

/* AI サマリーの先頭の、協議事項と予算措置（GLIQ-301）。欄の名前を小さく左に、文を右に */
.ringi-ai-lead {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);   /* 左の帯は付けない（DESIGN.md §0-6）。淡い地だけで囲む */
  background: var(--c-st-ai-bg);
}

.ringi-ai-lead > div {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-1) 0;
}

.ringi-ai-lead dt {
  flex: 0 0 auto;
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.ringi-ai-lead dd {
  margin: 0;
}

.ringi-ai-weak ul {
  margin: var(--sp-1) 0 0;
}

/* 申請のプレビュー（GLIQ-310）。フォームの上に重ねる。本文は詳細と同じ部品 */
.ringi-preview__lead {
  margin: 0 0 var(--sp-2);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

.ringi-preview__missing {
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-st-draft);
  border-radius: var(--r-md);
  background: var(--c-st-draft-bg);
  color: var(--c-st-draft-ink);
  font-size: var(--fs-sm);
}

.ringi-preview__subject {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: 700;
}

.ringi-preview__type {
  margin-left: var(--sp-2);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  font-weight: 400;
}

/* 狭い画面では、プレビューを全面に出す */
@media (max-width: 767px) {
  .modal.modal--preview {
    padding: 0;
  }

  .modal.modal--preview > .modal__box {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* 読む順の本文（GLIQ-309）。欄の名前は小さく上に、文は読める行長で下に置く。
   表の枠で囲まない（稟議書の体裁は印刷のほうで持つ） */
.ringi-read {
  margin: 0 0 var(--sp-2);
}

.ringi-read__row {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border);
}

/* 欄の名前（起案理由、費用効果…）が、そのまま見出しになる */
.ringi-read__row dt {
  margin-bottom: var(--sp-1);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.ringi-read__row dd {
  margin: 0;
  max-width: var(--w-read);
  white-space: pre-line;
  line-height: 1.8;
}

/* 稟議詳細では、欄の名前を小さなラベル（淡い地のピル）にし、欄どうしの線はやめて間で区切る */
/* 欄どうしは、薄い丸い点を並べた線で区切る（点は radial-gradient で丸く描く） */
.ringi-detail--simple .ringi-read__row {
  padding: var(--sp-3) 0;
  border-bottom: 0;
  background: radial-gradient(circle, var(--c-border-light) 1px, transparent 1.4px) left bottom / 7px 4px repeat-x;
}

.ringi-detail--simple .ringi-read__row dt,
.ringi-form--paper .ringi-sheet th,
.panel--paper .fieldrow--stack > label,
.panel--paper .fieldrow__label > label {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--c-depth-2);
  color: var(--c-brand-dark);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ringi-read__files {
  margin: 0 0 var(--sp-2);
  padding-left: var(--sp-4);
}

/* 空の欄は並べず、節の最後に 1 行で言う */
.ringi-read__missing {
  margin: var(--sp-1) 0 var(--sp-2);
  color: var(--c-text-mute);
  font-size: var(--fs-sm);
}

/* 申請の情報（費目、費用負担部署、番号など）。上の要約の帯と同じ部品を、本文の下で使う */
.ringi-facts--info {
  margin-top: var(--sp-4);
  margin-bottom: 0;
}

.ringi-detail-lines tfoot th,
.ringi-detail-lines tfoot td {
  background: var(--c-th-bg);
  font-weight: 600;
}

.ringi-detail-lines__warn {
  color: var(--c-st-ng);
  font-size: var(--fs-xs);
}

/* 承認の操作。承認 / 差戻しのタブは radio と :checked で切り替える（JS 不要） */
.ringi-ops__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ringi-ops__tabs {
  display: flex;
  border-bottom: 1px solid var(--c-border);
}

.ringi-ops__tab {
  flex: 1 1 0;
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  font-weight: 600;
  color: var(--c-text-sub);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

#ringi-op-approve:checked ~ .ringi-ops__tabs .ringi-ops__tab--approve {
  color: var(--c-st-ok);
  border-bottom-color: var(--c-st-ok);
  background: var(--c-st-ok-bg);
}

#ringi-op-return:checked ~ .ringi-ops__tabs .ringi-ops__tab--return,
#ringi-op-reject:checked ~ .ringi-ops__tabs .ringi-ops__tab--reject {
  color: var(--c-st-ng);
  border-bottom-color: var(--c-st-ng);
  background: var(--c-st-ng-bg);
}

/* 選んでいないタブの欄は隠す。否決のタブは、否決を使う設定のときだけある（GLIQ-60） */
#ringi-op-approve:checked ~ .ringi-ops__pane--return,
#ringi-op-approve:checked ~ .ringi-ops__pane--reject,
#ringi-op-return:checked ~ .ringi-ops__pane--approve,
#ringi-op-return:checked ~ .ringi-ops__pane--reject,
#ringi-op-reject:checked ~ .ringi-ops__pane--approve,
#ringi-op-reject:checked ~ .ringi-ops__pane--return {
  display: none;
}

.ringi-ops__actions {
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--sp-3);
}

.ringi-ops__actions form {
  display: contents;
}

/* 削除・内容を直して承認など、主でない操作（ghost）は左に寄せる */
.ringi-ops__actions .btn-ghost {
  margin-right: auto;
}

.ringi-ops__pane .fieldrow--stack .textarea {
  width: 100%;
}

/* 実行金額の変更（審査中と決裁完了）。明細の下に、金額・コメント・保存を小さな 1 行で並べ、狭い画面では折り返す */
.ringi-execution {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
}

.ringi-execution .fieldrow {
  flex-wrap: nowrap;
}

.ringi-execution .fieldrow > label {
  color: var(--c-text-sub);
  white-space: nowrap;
}

/* 伸ばすのはコメントの欄だけ（実行金額は金額の幅 .input--amount のまま） */
.ringi-execution .fieldrow:has(input[name="comment"]) {
  flex: 1 1 var(--w-fact-min);
}

.ringi-execution .fieldrow:has(input[name="comment"]) .input {
  width: 100%;
}

.ringi-ai-assist__trigger {
  flex: 0 0 auto;
}

.ringi-ai-assist__trigger .badge {
  margin-right: 2px;
}

.ringi-ai-summary {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}

/* 起案支援の結果。見出しの行の右に「すべて採用」。中は枠で囲まず、字だけで並べる */
.ringi-ai-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.ringi-ai-summary__text {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--c-text);
}

.ringi-ai-summary__sub {
  margin: var(--sp-2) 0 var(--sp-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-text-sub);
}

.ringi-ai-summary__list {
  margin: 0;
  padding-left: var(--sp-4);
  list-style: disc;
  font-size: var(--fs-sm);
  color: var(--c-text);
}

.ringi-ai-summary__list li + li {
  margin-top: var(--sp-1);
}

/* 提案・チェックのカードの中の説明は、注記の箱（.note）にしない。箱の中に箱が重なって読みにくい */
.ringi-ai-suggest__card .note:not(.thinking) {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-text-sub);
}

.ringi-ai-suggest {
  margin-bottom: var(--sp-1);
}

/* 品質基準のチェック表（DESIGN.md 4.31）。起案支援の結果の下に出す */
.ringi-ai-rubric {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}

.ringi-ai-rubric__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.ringi-ai-rubric__head .ringi-ai-suggest__label {
  margin: 0;
}

.ringi-ai-rubric__table {
  border-top: 1px solid var(--c-border);   /* 見出しの行が無いので、上の罫線を引く */
  background: var(--c-bg);
}

.ringi-ai-rubric__mark {
  width: 2.5em;
  text-align: center;
  font-weight: 700;
}

.ringi-ai-rubric__name {
  white-space: nowrap;
}

.ringi-ai-rubric__card .dtable__scroll {
  margin-bottom: var(--sp-2);
}

.ringi-ai-rubric__req {
  display: inline-block;
  white-space: nowrap;
  margin-left: var(--sp-1);
  padding: 0 var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

/* 足りない点から、まだ答えていない問いへ飛ぶ */
.ringi-ai-rubric__ask {
  white-space: nowrap;
  font-weight: 700;
}

.ringi-ai-rubric__row--ok .ringi-ai-rubric__mark { color: var(--c-st-ok); }
.ringi-ai-rubric__row--weak .ringi-ai-rubric__mark { color: var(--c-st-progress); }
.ringi-ai-rubric__row--missing .ringi-ai-rubric__mark { color: var(--c-st-ng); }
.ringi-ai-rubric__row--na { color: var(--c-text-sub); }

/* 表の下の、書けている点・当てはまらない点（名前だけを 1 行で） */
.ringi-ai-rubric__rest {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.ringi-ai-rubric__rest-mark {
  margin-right: var(--sp-1);
  font-weight: 700;
  color: var(--c-st-ok);
}

.ringi-ai-rubric__rest--na {
  font-size: var(--fs-xs);
}

.ringi-ai-rubric__rest + .ringi-ai-suggest__actions,
.ringi-ai-rubric__card .dtable__scroll + .ringi-ai-suggest__actions {
  margin-top: var(--sp-2);
}

/* 問いから作るの最初の問い。チャットの最初の画面のように、画面の真ん中に大きな問いと、
   角の丸い入力の箱（右下に送るボタン）だけを置く */
.intake-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  /* パンくずと本文の余白の分だけ引いた高さの真ん中より、少し下に置く（上にパンくずがあるので） */
  min-height: calc(100dvh - var(--h-header) - 96px);
  padding: 6vh var(--sp-3) 0;
}

.intake-hero__question {
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.intake-hero__composer {
  position: relative;
  width: min(100%, 42rem);
  padding: 15px 56px 15px 22px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 28px;   /* 1 行のときは両端が半円（高さ 56px の半分）。行が増えても角の丸みはこのまま */
}

.intake-hero__answer {
  display: block;
  width: 100%;
  min-height: 1.6em;   /* 最初は 1 行。書くと伸びる（field-sizing、効かないブラウザは app.js が高さを合わせる） */
  max-height: 40vh;
  padding: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--c-text);
  field-sizing: content;
}

.intake-hero__answer::placeholder { color: var(--c-text-mute); }

.intake-hero__send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}

.intake-hero__send:hover { background: var(--c-header-bg); }
.intake-hero__send svg { width: 18px; height: 18px; }

/* 空のときだけ、送るボタンの左に「Tab」の小さな札（押すと例が入る）。書き始めたら消す */
.intake-hero__tabhint {
  position: absolute;
  right: 54px;
  bottom: 17px;
  padding: 1px 6px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xs);
  background: var(--c-bg-sub);
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
  pointer-events: none;
}

/* 札の分だけ、入力の字を右で止める */
.intake-hero__composer:has(.intake-hero__tabhint) { padding-right: 96px; }

.intake-hero__composer:has(.intake-hero__answer:not(:placeholder-shown)) .intake-hero__tabhint {
  display: none;
}

/* 空のうちは、送れないことが分かるよう薄く */
.intake-hero__composer:has(.intake-hero__answer:placeholder-shown) .intake-hero__send {
  opacity: 0.35;
}

/* 例文は入力の箱と同じ幅の 1 行。入りきらない分は横に送る（ドラッグでも送れる。app.js の wireDragScroll）。
   スクロールバーは出さず、右端（送ったら左端も）を薄くして続きがあると分かるようにする */
.intake-hero__examples {
  display: flex;
  gap: var(--sp-2);
  width: min(100%, 42rem);
  margin-top: calc(var(--sp-2) * -1);
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  cursor: grab;
  user-select: none;
  --fade-l: 24px;
  --fade-r: 40px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}

.intake-hero__examples::-webkit-scrollbar { display: none; }

/* 端まで送ったら、その側は薄くしない（左端: data-at-start、右端: data-at-end） */
.intake-hero__examples[data-at-start] { --fade-l: 0px; }
.intake-hero__examples[data-at-end]   { --fade-r: 0px; }

.intake-hero__examples.is-dragging { cursor: grabbing; }

.intake-hero__example {
  flex: none;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid var(--c-border-light);
  border-radius: 999px;
  background: var(--c-bg);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.intake-hero__example:hover {
  border-color: var(--c-border-strong);
  color: var(--c-text);
}

.intake-hero__alt {
  margin: 0;
  font-size: var(--fs-sm);
}

.intake-hero__alt a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  color: var(--c-text-sub);
  text-decoration: none;
}

.intake-hero__alt a:hover {
  background: var(--c-bg);
  color: var(--c-brand-dark);
}

.intake-hero__alt svg {
  flex: none;
  width: 18px;
  height: 18px;
}

@media (max-width: 767px) {
  .intake-hero__answer { font-size: var(--fs-input-mobile); }
  .intake-hero__question { font-size: var(--fs-2xl); }
}

/* 問いから作るの件名を決める段。最初の画面と同じ 1 列の幅で、自分の答えを右の吹き出しに、
   件名の候補を押して選ぶカードに。左の帯や説明の文は置かない */
.intake-chat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  width: min(100%, 42rem);
  min-height: calc(100dvh - var(--h-header) - 96px);
  margin: 0 auto;
  padding-top: 6vh;
}

.intake-chat__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: 100%;
}

/* 書式の 2 枚のカード。名前と違いの 1 行。選んだ方は太い濃い枠 */
.doctype {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.doctype__card {
  display: grid;
  gap: 2px;
  padding: 12px 18px;
  border: 1.5px solid var(--c-border-light);
  border-radius: 16px;
  background: var(--c-bg);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.doctype__card:hover { border-color: var(--c-border-strong); }

.doctype__card > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* 選んだ方は、枠を太く濃くするだけ（地の色は変えない） */
.doctype__card:has(:checked) {
  padding: 11px 17px;   /* 枠が 1px 太くなる分を引いて、中身を動かさない */
  border-width: 2.5px;
  border-color: var(--c-brand-dark);
}

.doctype__name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.doctype__meaning {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

@media (max-width: 767px) {
  .doctype { grid-template-columns: 1fr; }
}

.intake-chat__set {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.intake-chat__question {
  display: block;
  width: 100%;
  margin-bottom: var(--sp-4);
  padding: 0;
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

/* 件名の欄。名前を左に小さく置いた、角の丸い 1 行の箱。中身はそのまま直せる */
.subjectbox {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 20px;
  border: 1.5px solid var(--c-border-light);
  border-radius: 999px;
  background: var(--c-bg);
  cursor: text;
}

.subjectbox__label {
  flex: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-mute);
}

.subjectbox__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: var(--fs-lg);
  color: var(--c-text);
}

.intake-chat__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.intake-chat__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--c-text-sub);
  font-weight: 600;
  text-decoration: none;
}

.intake-chat__back:hover {
  background: var(--c-depth-1);
  color: var(--c-text);
}

.intake-chat__back svg { width: 18px; height: 18px; }

.intake-chat__next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.intake-chat__next:hover { background: var(--c-header-bg); }
.intake-chat__next svg { width: 18px; height: 18px; }

/* 問いから作るの問いの段（intake.html）。最初の画面（.intake-hero）の形に、何問目か（ステッパー）、
   「あとで」「分からない」のピル、下の段（これまでの答え・作成に進む）を足す */
.intake-q { gap: var(--sp-4); }

/* 何問目かの列。上に吹き出しの入る分だけ空け、問いとのあいだは詰める */
.intake-q__progress {
  display: flex;
  justify-content: center;
  margin: 0;
  padding-top: 40px;
}

/* 励ましの吹き出し。いまの問いの点の真上に置き、しっぽでその点を指す。開いたときに、ぽんと出る */
.qsteps li.is-now { position: relative; }

.intake-q__cheer {
  position: absolute;
  left: calc(100% - 10px);   /* 線（左）を除いた、点の真ん中 */
  bottom: calc(100% + 8px);
  z-index: 2;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: intake-cheer-in 0.45s cubic-bezier(0.3, 0.7, 0.4, 1.4) 0.3s both;
}

.intake-q__cheer::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}

@keyframes intake-cheer-in {
  from { opacity: 0; transform: translate(-50%, 6px) scale(0.85); }
  to   { opacity: 1; transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .intake-q__cheer { animation: none; }
}

/* 何問目かのステッパー。済んだ問い（濃い丸に白いチェック）が左から増えていき、線でつながる */
.qsteps {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qsteps li {
  display: flex;
  align-items: center;
}

/* 丸と丸のあいだの線。丸の中心から中心までつなぐ（丸の下を通す）。済んだ問いの次の線は濃く */
.qsteps li + li::before {
  content: "";
  width: 48px;
  height: 2px;
  margin: 0 -10px;   /* 両隣の丸（どれも 20px の箱）の中心まで伸ばし、丸の下にくぐらせる */
  background: var(--c-border) linear-gradient(var(--c-brand-dark), var(--c-brand-dark)) no-repeat left / 0 100%;
}

.qsteps li.is-done + li::before { background-size: 100% 100%; }

.qsteps__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* 残りの問い: 小さな点（箱は 20px のまま。線は中心まで来る） */
.qsteps li:not(.is-done):not(.is-now) .qsteps__dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-border);
}

.qsteps li.is-done .qsteps__dot {
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
}

.qsteps__dot svg { width: 12px; height: 12px; }

/* いまの問い: 濃い点。枠は付けない。いまここ、と分かるように
   - 点のまわりに輪が 2 重に、ずらして外へ広がって消える（::before と box-shadow）
   - 点がゆっくり息をする */
.qsteps li.is-now .qsteps__dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-brand-dark);
  animation: qsteps-breathe 2.4s ease-in-out infinite, qsteps-ripple 2.4s ease-out infinite;
}

.qsteps li.is-now .qsteps__dot::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.5px solid var(--c-brand-dark);
  border-radius: 50%;
  animation: qsteps-ring 2.4s ease-out 1.2s infinite;
}

@keyframes qsteps-ripple {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-brand-dark) 35%, transparent); }
  70%, 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--c-brand-dark) 0%, transparent); }
}

@keyframes qsteps-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  70%, 100% { transform: scale(2.8); opacity: 0; }
}

@keyframes qsteps-breathe {
  0%, 100% { transform: scale(0.8); }
  50%      { transform: scale(1.15); }
}

/* いま答えた問い: チェックの丸がはじけて出て、チェックが描かれ、いまの問いまで線が伸びる */
@keyframes qsteps-pop {
  0%   { transform: scale(0.3); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@keyframes qsteps-draw {
  from { stroke-dashoffset: 24; }
  to   { stroke-dashoffset: 0; }
}

@keyframes qsteps-line {
  from { background-size: 0 100%; }
  to   { background-size: 100% 100%; }
}

.qsteps li.is-just .qsteps__dot {
  animation: qsteps-pop 0.45s cubic-bezier(0.3, 0.7, 0.4, 1.4) 0.25s both;
}

.qsteps li.is-just svg path {
  stroke-dasharray: 24;
  animation: qsteps-draw 0.3s ease-out 0.55s both;
}

.qsteps li.is-just + li.is-now::before {
  animation: qsteps-line 0.35s ease-out 0.75s both;
}

@media (prefers-reduced-motion: reduce) {
  .qsteps li.is-just .qsteps__dot,
  .qsteps li.is-just svg path,
  .qsteps li.is-just + li.is-now::before,
  .qsteps li.is-now .qsteps__dot::before,
  .qsteps li.is-now .qsteps__dot::after { animation: none; }
}

.intake-q__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
}

/* 問いが 1 行でも 2 行でも、上の進み具合と下の入力の箱が動かないよう、いつも 2 行分の高さを取る。
   1 行の問いは下（入力の箱のそば）に寄せる */
.intake-q__question {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  max-width: 42rem;
  min-height: calc(var(--fs-2xl) * 1.45 * 2);
  font-size: var(--fs-2xl);
  line-height: 1.45;
}

.intake-q__chips {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
}

.intake-q__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 6px 12px;
  border: 1px solid var(--c-border-light);
  border-radius: 999px;
  background: var(--c-bg);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.intake-q__chip svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.intake-q__chip:hover {
  border-color: var(--c-border-strong);
  color: var(--c-text);
}

/* 下の段: 過去の回答履歴を真ん中に（開くと下に広がる）。入力の箱と同じ幅 */
.intake-q__foot {
  display: flex;
  justify-content: center;
  width: min(100%, 42rem);
}

.intake-q__history {
  width: 100%;
  font-size: var(--fs-sm);
  text-align: center;
}

.intake-q__history summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  color: var(--c-text-sub);
  cursor: pointer;
  list-style: none;
}

.intake-q__history summary::-webkit-details-marker { display: none; }
.intake-q__history summary:hover { color: var(--c-text); }

/* 開け閉めの印は「く」の字の山形。開くと上向きに回す */
.intake-q__chev {
  flex: none;
  width: 18px;
  height: 18px;
  transition: transform var(--dur-slide) ease-in-out;
}

.intake-q__history[open] .intake-q__chev { transform: rotate(180deg); }

/* 過去の回答: 押すと入力欄に入る行。答えを上に、どの稟議で書いたかを下に小さく */
.intake-q__past {
  display: grid;
  gap: var(--sp-1);
  margin: var(--sp-2) 0 0;
  padding: var(--sp-2);
  list-style: none;
  border: 1px solid var(--c-border-light);
  border-radius: 16px;
  background: var(--c-bg);
  text-align: left;
}

.intake-q__pastbtn {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}

.intake-q__pastbtn:hover { background: var(--c-row-hover); }

.intake-q__pasttext {
  font-size: var(--fs-md);
  color: var(--c-text);
  white-space: pre-wrap;
}

.intake-q__pastfrom {
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}

.intake-q__pastnone {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-sm);
  color: var(--c-text-mute);
}

/* 残りの問いをスキップして作成に進む。画面の右下に止めた茶色のボタン（問いの途中でいつでも押せる） */
.intake-q__compose {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.intake-q__compose:hover { background: var(--c-header-bg); }

@media (max-width: 767px) {
  .intake-q__compose {
    right: var(--sp-3);
    bottom: var(--sp-3);
  }
}

.intake-q__compose svg { width: 18px; height: 18px; }

.intake-chat__next { text-decoration: none; }

/* 全部答え終えた画面の、労いの絵。丸が描かれ、チェックが入り、まわりに紙吹雪がはじける（1 回）。
   動きを減らす設定のときは、描き終えた形だけを出す */
.done-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
}

.done-art__mark {
  width: 96px;
  height: 96px;
  animation: done-pop 0.5s cubic-bezier(0.3, 0.7, 0.4, 1.4) 0.1s both;
}

.done-art__ring {
  stroke: var(--c-brand-dark);
  fill: var(--c-brand-pale);
  stroke-dasharray: 252;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: done-draw 0.6s ease-out 0.2s both;
}

.done-art__check {
  stroke: var(--c-brand-dark);
  stroke-dasharray: 60;
  animation: done-draw-check 0.35s ease-out 0.75s both;
}

.done-art__bit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 2px;
  opacity: 0;
  animation: done-burst 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.95s both;
}

.done-art__bit:nth-of-type(1) { --dx: 0px; --dy: -62px; background: var(--c-brand); }
.done-art__bit:nth-of-type(2) { --dx: 44px; --dy: -44px; background: var(--c-ch-4); border-radius: 50%; }
.done-art__bit:nth-of-type(3) { --dx: 62px; --dy: 0px; background: var(--c-ch-3); }
.done-art__bit:nth-of-type(4) { --dx: 44px; --dy: 44px; background: var(--c-ch-5); border-radius: 50%; }
.done-art__bit:nth-of-type(5) { --dx: 0px; --dy: 62px; background: var(--c-brand-dark); }
.done-art__bit:nth-of-type(6) { --dx: -44px; --dy: 44px; background: var(--c-ch-4); border-radius: 50%; }
.done-art__bit:nth-of-type(7) { --dx: -62px; --dy: 0px; background: var(--c-ch-3); }
.done-art__bit:nth-of-type(8) { --dx: -44px; --dy: -44px; background: var(--c-ch-5); border-radius: 50%; }
.done-art__bit:nth-of-type(9) { --dx: 24px; --dy: -58px; background: var(--c-ch-6); }
.done-art__bit:nth-of-type(10) { --dx: 58px; --dy: 24px; background: var(--c-brand); border-radius: 50%; }
.done-art__bit:nth-of-type(11) { --dx: -24px; --dy: 58px; background: var(--c-ch-6); }
.done-art__bit:nth-of-type(12) { --dx: -58px; --dy: -24px; background: var(--c-brand); border-radius: 50%; }

@keyframes done-pop {
  from { transform: scale(0.6); }
  to   { transform: scale(1); }
}

@keyframes done-draw {
  from { stroke-dashoffset: 252; }
  to   { stroke-dashoffset: 0; }
}

@keyframes done-draw-check {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0; }
}

@keyframes done-burst {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.4) rotate(0deg); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(200deg); }
}

@media (prefers-reduced-motion: reduce) {
  .done-art__mark,
  .done-art__ring,
  .done-art__check { animation: none; }
  .done-art__bit { display: none; }
}

/* 問いから作るの問いの出かた。次の問いへ移ると、問い・候補・操作が上から順に、
   下からせり上がりながらフェードインする（チャットで次の発言が出る動き）。
   動きを減らす設定のときは、ページのフェードインだけにする */
@keyframes intake-rise {
  from { opacity: 0; transform: translateY(var(--dist-rise)); }
  to   { opacity: 1; transform: none; }
}

.intake-chat__set,
.subjectbox,
.intake-chat__foot,
.intake-hero > * {
  animation: intake-rise var(--dur-rise) cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.intake-hero > :nth-child(2) { animation-delay: calc(var(--gap-rise) * 1); }
.intake-hero > :nth-child(3) { animation-delay: calc(var(--gap-rise) * 2); }
.intake-hero > :nth-child(n+4) { animation-delay: calc(var(--gap-rise) * 3); }

/* 書式の段: 問いとカード → 件名 → 戻ると次へ */
.subjectbox        { animation-delay: calc(var(--gap-rise) * 1); }
.intake-chat__foot { animation-delay: calc(var(--gap-rise) * 2); }

@media (prefers-reduced-motion: reduce) {
  :is(.intake-chat__set, .subjectbox, .intake-chat__foot),
  .intake-hero > * { animation: none; }
}

/* 問いから作成に進んだあとの待機画面。下書きができるまで、フォームを覆う（DESIGN.md 4.32）。
   覆うのは本文の枠（.main）だけ。上のヘッダーと左のサイドメニューはそのまま見せる。
   .main はスクロールする箱で position: relative なので、その見えている範囲いっぱいに置き、
   出しているあいだは .main を送らせない（送ると覆いがずれる） */
.main:has(> .intake-wait:not([hidden])),
.main:has(.intake-wait:not([hidden])) {
  overflow: hidden;
}

.intake-wait {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: var(--c-bg-sub);
}

.intake-wait[hidden] {
  display: none;
}

/* できあがったとき（app.js の finishWait）。工程の行を「できました」に替え、棒を最後まで伸ばし、
   書類の線を引き終える。そのあと待機画面ごとふわっと消す */
.intake-wait__done {
  display: none;
  align-items: center;
  gap: var(--sp-1);
  margin: 0;
  color: var(--c-st-ok);
  font-size: var(--fs-md);
  font-weight: 700;
}

.intake-wait__done svg {
  width: var(--size-wait-mark);
  height: var(--size-wait-mark);
}

.intake-wait__done path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.intake-wait.is-done .intake-wait__steps { display: none; }
.intake-wait.is-done .intake-wait__done { display: inline-flex; animation: wait-step-in var(--dur-rise) ease-out both; }
.intake-wait.is-done .intake-wait__done path { animation: wait-draw var(--dur-rise) ease-out 120ms forwards; }
.intake-wait.is-done .intake-wait__bar::after { animation: none; transform: scaleX(1); transition: transform var(--dur-rise) ease-out; }
.intake-wait.is-done .intake-wait__line { animation: none; stroke-dashoffset: 0; transition: stroke-dashoffset var(--dur-rise) ease-out; }
.intake-wait.is-done .intake-wait__pen { opacity: 0; transition: opacity var(--dur-rise) ease-out; }

.intake-wait.is-leaving {
  opacity: 0;
  transition: opacity var(--dur-wait-leave) ease-in;
}

/* JS が無いと外す人がいないので、出さない */
@media (scripting: none) {
  .intake-wait {
    display: none;
  }
}

.intake-wait__card {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.intake-wait__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
}

/* 書かれていく書類。線は工程の間合い（--at 番目の工程から、--len 工程分）で引かれる */
.intake-wait__doc {
  width: var(--size-wait-doc);
  height: auto;
  overflow: visible;
}

.intake-wait__paper {
  fill: var(--c-bg);
  stroke: var(--c-border-strong);
}

.intake-wait__fold {
  stroke: var(--c-border-strong);
}

.intake-wait__ink {
  stroke: var(--c-text-sub);
}

.intake-wait__line--title {
  stroke: var(--c-st-ai-ink);
}

.intake-wait__line--box {
  stroke: var(--c-st-ai);
}

.intake-wait__line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: wait-draw calc(var(--len) * var(--dur-wait-step)) ease-out calc(var(--at) * var(--dur-wait-step)) forwards;
}

.intake-wait__pen-body {
  fill: var(--c-st-ai);
}

.intake-wait__pen-tip {
  fill: var(--c-st-ai-ink);
}

/* 線ごとの間合い（何番目の工程から --at、何工程分で --len）。SVG の並び順と合わせる */
.intake-wait__line:nth-child(1) { --at: 1;    --len: 0.5; }   /* 件名 */
.intake-wait__line:nth-child(2) { --at: 1.5;  --len: 0.5; }   /* 金額の枠 */
.intake-wait__line:nth-child(3) { --at: 2;    --len: 0.3; }   /* 明細 */
.intake-wait__line:nth-child(4) { --at: 2.33; --len: 0.3; }
.intake-wait__line:nth-child(5) { --at: 2.66; --len: 0.3; }
.intake-wait__line:nth-child(6) { --at: 3;    --len: 0.25; }  /* 本文 */
.intake-wait__line:nth-child(7) { --at: 3.25; --len: 0.25; }
.intake-wait__line:nth-child(8) { --at: 3.5;  --len: 0.25; }
.intake-wait__line:nth-child(9) { --at: 3.75; --len: 0.25; }

@keyframes wait-draw {
  to { stroke-dashoffset: 0; }
}

/* 工程。1 行だけを出し、目安の間合い（--dur-wait-step）でかわりばんこに入れ替える。
   前の行は上へ抜けて消え、次の行が下から出てくる。--at 番目の工程が、その順番 */
.intake-wait__steps {
  display: grid;
  justify-items: center;
  overflow: hidden;
  font-size: var(--fs-md);
}

.intake-wait__step {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  color: var(--c-text);
  opacity: 0;
  animation: wait-step var(--dur-wait-step) ease-in-out calc(var(--at) * var(--dur-wait-step)) forwards;
}

.intake-wait__step:nth-child(1) { --at: 0; }
.intake-wait__step:nth-child(2) { --at: 1; }
.intake-wait__step:nth-child(3) { --at: 2; }
.intake-wait__step:nth-child(4) { --at: 3; }
.intake-wait__step:nth-child(5) { --at: 4; }

/* 行の頭の、回る輪 */
.intake-wait__step::before {
  content: "";
  box-sizing: border-box;
  flex: none;
  width: var(--size-wait-mark);
  height: var(--size-wait-mark);
  border: 2px solid var(--c-st-ai);
  border-top-color: transparent;
  border-radius: 50%;
  animation: wait-spin 0.9s linear infinite;
}

/* 最後の工程は、できあがるまで出したまま */
.intake-wait__step--last {
  animation-name: wait-step-in;
  animation-duration: var(--dur-rise);
  animation-timing-function: ease-out;
}

@keyframes wait-step {
  0%   { opacity: 0; transform: translateY(var(--dist-wait-step)); }
  12%  { opacity: 1; transform: none; }
  88%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(calc(var(--dist-wait-step) * -1)); }
}

@keyframes wait-step-in {
  from { opacity: 0; transform: translateY(var(--dist-wait-step)); }
  to   { opacity: 1; transform: none; }
}

@keyframes wait-spin {
  to { transform: rotate(1turn); }
}

/* 細い進み具合の棒。工程 4 つ分で 9 割まで伸び、あとは仕上げが終わるまで待つ */
.intake-wait__bar {
  width: var(--size-wait-bar);
  height: var(--size-wait-bar-h);
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--c-border-light);
}

.intake-wait__bar::after {
  content: "";
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--c-st-ai);
  transform: scaleX(0);
  transform-origin: left;
  animation: wait-bar calc(4 * var(--dur-wait-step)) cubic-bezier(0.3, 0.6, 0.4, 1) forwards;
}

@keyframes wait-bar {
  to { transform: scaleX(0.9); }
}

/* 動きを減らす設定: 線は最初から引いておき、ペンは出さない。工程の行は動かさずに入れ替え、輪は回さない */
@media (prefers-reduced-motion: reduce) {
  .intake-wait__line {
    animation: none;
    stroke-dashoffset: 0;
  }

  .intake-wait__pen {
    display: none;
  }

  .intake-wait__step {
    --dist-wait-step: calc(var(--dist-rise) * 0);   /* 単位の無い 0 は calc の中で長さにならない */
  }

  .intake-wait__step::before {
    animation: none;
  }
}

/* 答えから作ったたたき台を、稟議詳細と同じ形（左に紙、右に付箋）で見せる（DESIGN.md 4.32）。
   紙と付箋は詳細の部品（.fusen-desk、.ringi-lead、.ringi-read、.fusen）をそのまま使い、
   ここでは件名の行と「直す」と、見る所から指したときの印だけを足す */
.draft-review {
  margin-bottom: var(--sp-5);
}

.draft-review__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.draft-review__subject {
  flex: 0 1 auto;
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.5;
}

.draft-review__row {
  position: relative;
}

/* 金額の帯の下から最初の欄までを、欄どうしの間（--sp-3）とそろえる。
   帯の下の余白と行の上の余白が重なると、最初の欄だけ間が広く見える */
.draft-review .ringi-lead {
  margin-bottom: var(--sp-3);
}

.draft-review .ringi-read__row:first-child {
  padding-top: 0;
}

/* 「直す」は欄の札の行の右端に置く（文の幅を狭めない）。札と上下の中央をそろえる */
.draft-review__row > .draft-review__edit {
  position: absolute;
  top: var(--sp-3);
  right: 0;
  margin-top: calc(var(--sp-1) / -2);   /* ボタンは札より背が高いので、半分だけ上げて中央をそろえる */
}

.draft-review__row:first-child > .draft-review__edit {
  top: 0;
}

.draft-review__input {
  width: 100%;
  margin-top: var(--sp-1);
  font-size: var(--fs-md);
  line-height: 1.8;
}

/* 件名の横の「注意」の札は件名のすぐ右、「直す」は右端 */
.draft-review__title > .draft-review__edit {
  margin-left: auto;
}

.draft-review__title > .fusen-mark {
  align-self: center;
}

/* 見る所で別の所を選んだときは、件名も、ほかの欄と同じく薄くする */
.fusen-desk.is-focusing .fusen-desk__paper .draft-review__title:not(.is-fusen-focus) {
  opacity: 0.28;
}

/* 見る所の行。たたき台の点は文が長いので、札を上、文をその下に縦に並べ、文に幅を全部使わせる。
   押せる印（矢印）は右に、行の上下の中央に置く */
.draft-review .fusen__point {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "tag go" "text go";
  align-items: center;
  row-gap: var(--sp-1);
}

.draft-review .fusen__tag {
  grid-area: tag;
  justify-self: start;
  top: 0;
}

.draft-review .fusen__text {
  grid-area: text;
  line-height: 1.7;
}

.draft-review .fusen__go {
  grid-area: go;
}

/* 示している行は地の色だけで示す（長い文を太字にすると、かえって読みにくい） */
.draft-review .fusen__point.is-on {
  font-weight: inherit;
}

/* AI が確かめているあいだの 1 行（通りやすさのチェック）。待機画面の工程の行と同じ回る輪 */
.ai-loading {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

.ai-loading::before {
  content: "";
  box-sizing: border-box;
  flex: none;
  width: var(--size-wait-mark);
  height: var(--size-wait-mark);
  border: 2px solid var(--c-st-ai);
  border-top-color: transparent;
  border-radius: 50%;
  animation: wait-spin 0.9s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ai-loading::before {
    animation: none;
  }
}

/* 出るときと引くときの動き。待機画面が消えたあと、紙が下からせり上がり、少し遅れて付箋が出る
   （稟議詳細を開いたときと同じ動き）。「この内容でフォームに入れる」では、紙ごと少し上へ引いて消える */
.draft-review.is-entering .fusen-desk__paper {
  animation: ringi-paper-in var(--dur-paper) cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.draft-review.is-entering .fusen {
  animation: fusen-in var(--dur-rise) cubic-bezier(0.2, 0.7, 0.2, 1) 280ms both;
}

.draft-review.is-leaving {
  opacity: 0;
  translate: 0 calc(var(--dist-rise) * -1);
  transition: opacity var(--dur-review-leave) ease-in, translate var(--dur-review-leave) ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .draft-review.is-entering .fusen-desk__paper,
  .draft-review.is-entering .fusen { animation: none; }
  .draft-review.is-leaving { transition: none; }
}

/* 確かめてほしい点が指す、AI が書かなかった欄 */
.draft-review__empty {
  color: var(--c-text-mute);
}

/* 紙の所を指せない見る所の行（押せない）。押せる行と同じ並びで、矢印を出さない */
.fusen__point--static {
  cursor: default;
}

/* 稟議設定の「品質基準」の表。行が多いので、枠の中で縦に送らず、ページと一緒に送る */
.quality-rubric__wrap {
  margin-bottom: var(--sp-3);
  overflow-x: auto;
}

.quality-rubric__name {
  min-width: 9em;
}

@media (max-width: 640px) {
  .ringi-ai-rubric__name {
    white-space: normal;
  }
}

/* 明細の行の、費目の候補（DESIGN.md 4.33）。費目の欄の下に、小さく出す */
.line-expense-hint {
  display: block;
  margin-top: var(--sp-1);
}

.line-expense-hint__btn {
  padding: 0 var(--sp-2);
  border: 1px solid var(--c-st-ai);
  border-radius: var(--r-md);
  background: var(--c-st-ai-bg);
  color: var(--c-st-ai);
  font-size: var(--fs-xs);
  line-height: 1.8;
  text-align: left;
  cursor: pointer;
}

.line-expense-hint__btn:hover {
  filter: brightness(0.97);
}

/* いまの費目と違う候補は、線を強くして気づけるようにする */
.line-expense-hint--mismatch .line-expense-hint__btn {
  border-width: 2px;
  font-weight: 700;
}

/* 費目の確認（稟議の詳細で、承認者が明細の行の費目を確かめる。DESIGN.md 4.34） */
.expense-check {
  margin-top: var(--sp-2);
}

.expense-check__lead {
  margin: 0 0 var(--sp-2);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

.expense-check__table td {
  vertical-align: top;
}

.expense-check__hint .line-expense-hint__btn {
  margin-right: var(--sp-2);
}

/* いまの費目と違う候補は、線を強くして気づけるようにする */
.expense-check__hint--mismatch .line-expense-hint__btn {
  border-width: 2px;
  font-weight: 700;
}

.expense-check__same {
  margin-right: var(--sp-2);
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
}

/* 根拠（過去の決裁済みの明細の件数、単価の幅）。承認者が判断に使うので、隠さず字で出す */
.expense-check__reason {
  display: block;
  margin-top: var(--sp-1);
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
}

/* 似た品目の過去の単価の幅。今回の単価の下に小さく出す。幅の外なら、警告の色で太くする */
.expense-check__past {
  display: block;
  margin-top: var(--sp-1);
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  text-align: right;
  min-width: var(--w-fact-min);
  white-space: normal; /* 数字の列（.num）の折り返しなしを、この文だけ解く */
}

/* 品目と、候補と根拠の列を、過去の単価の文で狭めない */
.expense-check__table td:first-child {
  min-width: var(--w-fact-min);
}

.expense-check__table .expense-check__hint {
  min-width: calc(var(--w-fact-min) * 2);
}

.expense-check__past--outside {
  color: var(--c-st-draft-ink);
  font-weight: 700;
}

.expense-check__actions {
  margin-top: var(--sp-2);
}

/* ボタンの display が hidden 属性に勝たないようにする（候補が無いあいだは出さない） */
.expense-check__actions [hidden] {
  display: none;
}

.expense-check__state {
  margin-right: auto;
  font-size: var(--fs-sm);
}

.ringi-ai-suggest__card {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-st-ai-line);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}

.ringi-ai-suggest__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.ringi-ai-suggest__label {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-st-ai-ink);
}

.ringi-ai-suggest__meta {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-ai-suggest__diff {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ringi-ai-diff__del {
  text-decoration: line-through;
  color: var(--c-st-ng);
}

.ringi-ai-diff__add {
  color: var(--c-st-ok);
  font-weight: 600;
}

.ringi-ai-suggest__evidence {
  margin: 0 0 var(--sp-2);
  padding-left: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-ai-suggest__evidence li {
  margin-bottom: var(--sp-1);
}

.ringi-ai-suggest__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.ringi-ai-suggest__skip {
  margin: 0;
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-ai-suggest__skip strong {
  color: var(--c-text);
}

.ringi-attach-table {
  margin: 0 0 var(--sp-2);
}

.ringi-attach-table tr.is-new td {
  background: var(--c-st-ok-bg);
}

.ringi-attach-table__name {
  font-weight: 600;
  word-break: break-all;
}

.ringi-attach-table__action {
  width: 1%;
  white-space: nowrap;
}

.ringi-attach-table__action form {
  margin: 0;
}

.ringi-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}

.ringi-attach-row__file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.unit {
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
}

/* --- 4.2 承認ルート表 --------------------------------------------------- */
.route {
  border-collapse: collapse;
  font-size: var(--fs-xs);
  background: var(--c-bg);
  table-layout: fixed;
}

.route th {
  padding: 2px var(--sp-1);
  background: var(--c-th-bg);
  border: 1px solid var(--c-border);
  font-weight: 600;
  text-align: center;
  width: 84px;
}

.route td {
  height: 56px;
  padding: var(--sp-1) 2px;
  border: 1px solid var(--c-border);
  text-align: center;
  vertical-align: middle;
  color: var(--c-text-sub);
}

/* このセルが表しているのは「審査中」なので、色は中の文字と揃えて
   ブランド色ではなく --c-st-progress 系を使う（DESIGN.md 大原則4）。
   目印は淡い地と「審査中」の字だけ。左右の太線は付けない（線で目立たせない） */
.route td.is-current {
  background: var(--c-st-progress-bg);
}

.route td.is-skip {
  color: var(--c-st-skip);
  background: var(--c-st-skip-bg);
}

.route td.is-ng {
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
  font-weight: 600;
}

/* ハンコ風の丸枠 */
.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--c-st-ok);
  border-radius: 50%;
  color: var(--c-st-ok);
  font-size: 9px;
  line-height: 1.2;
  font-weight: 600;
}

.stamp b {
  font-size: var(--fs-xs);
  font-weight: 700;
}

.stamp--ng {
  border-color: var(--c-st-ng);
  color: var(--c-st-ng);
}

/* 既定（緑）と同じ。承認済みの印であることを class で読めるようにする */
.stamp--ok {
  border-color: var(--c-st-ok);
  color: var(--c-st-ok);
}

/* 段が多いときは承認欄だけを横に送る */
.route__scroll {
  overflow-x: auto;
}

/* 承認者の未読・既読（承認者名の下。GLIQ-46）。未読は、番が来ているのに開いていない */
.route__name.route__read {
  color: var(--c-text-mute);
}

/* 未読は、字を濃くするだけ（赤は、差戻しと不一致の色なので使わない） */
.route__name.route__read.is-unread {
  color: var(--c-text);
}

/* 越権承認の印（承認者名の下）。格上の人が、この段を承認した */
.route__name.route__over {
  color: var(--c-text-mute);
}

/* 印の下の承認者名 */
.route__name {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-sub);
  overflow-wrap: anywhere;
}

.route__now {
  color: var(--c-st-progress);
  font-weight: 600;
}

/* 稟議詳細の承認欄。枠の幅いっぱいに段を並べる */
.ringi-stamps {
  width: 100%;
}

.ringi-stamps td {
  height: auto;
  padding: var(--sp-2) 2px;
}

/* 仮登録の承認欄の仮ルート。本物の承認欄と見分けられるよう、破線の枠で薄く出す */
.ringi-provisional__template {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
}

.ringi-stamps--provisional th,
.ringi-stamps--provisional td {
  border-style: dashed;
  border-color: var(--c-border);
  color: var(--c-text-sub);
}

.ringi-provisional__issues {
  margin: var(--sp-2) 0;
  padding-left: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

/* ハンコの表の下の、段のコメント（承認理由・差戻しの理由） */
.ringi-stamps__comments {
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  white-space: pre-line;
}

.ringi-stamps__who {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}

/* --- 4.5 フィルタバー --------------------------------------------------- */
.filterbar {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.filterbar__fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.filterbar__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filterbar__field > label {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.filterbar__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--c-border-light);
}

/* --- ページャ ---------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
}

/* --- 4.7 タブ ---------------------------------------------------------- */
/* タブの段の下に薄い全幅の線を引き、選んだタブの下線（2px の銅）をその上に重ねる */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp-3);
}

.tabs__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;   /* 選んだタブの下線を段の線に重ねる */
  font-size: var(--fs-md);
  color: var(--c-text-sub);
}

.tabs__item:hover {
  color: var(--c-text);
}

/* マウスを乗せたタブの下線。銅の線を左から伸ばす（選んでいるタブは銅の下線のまま） */
.tabs__item {
  position: relative;
}

.tabs__item:not(.is-active)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--c-brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-tabline) ease-in-out;
}

.tabs__item:not(.is-active):hover::after {
  transform: scaleX(1);
}

/* タブの語の左のアイコン。色は語と同じ（選んだタブは銅）。字の見た目の真ん中にそろえる（--nudge-icon） */
.tabs__icon {
  flex: 0 0 auto;
  width: var(--sz-tabicon);
  height: var(--sz-tabicon);
  transform: translateY(var(--nudge-icon));
}

/* --- アイコンの動き（タブ・サイドメニュー・ボタン。マウスを乗せたときに 1 回。DESIGN.md 4.7） ---------
   アイコンの形に合わせて、線ごとに動かす（class は schemas/surveys.py の _TABS と schemas/nav.py、
   ボタンは _components/forms.html の BUTTON_ICONS）。
   どれも ease-in-out でぬるっと動かす。ti-s1〜4 は順に遅らせる。
   ずらす量は線の大きさに対する %（transform-box: fill-box）。回す中心はアイコンの中心 */
.tabs__icon,
.sidebar__icon,
.btnicon {
  overflow: visible;   /* 電球の光の線などは枠の外まで出す */
}

:is(.tabs__icon, .sidebar__icon, .btnicon) :is([class^="ti-"], [class*=" ti-"]) {
  transform-box: fill-box;
  animation-duration: var(--dur-iconmotion);
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
}

:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-s1 { animation-delay: calc(var(--dur-iconmotion) * 0.15); }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-s2 { animation-delay: calc(var(--dur-iconmotion) * 0.3); }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-s3 { animation-delay: calc(var(--dur-iconmotion) * 0.45); }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-s4 { animation-delay: calc(var(--dur-iconmotion) * 0.6); }

/* 棒が下から伸びる（回答結果・経営分析・決裁権限） */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-bar { transform-origin: 50% 100%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-bar { animation-name: ti-grow; }

@keyframes ti-grow {
  0% { transform: scaleY(0.2); }
  70% { transform: scaleY(1.08); }
  100% { transform: scaleY(1); }
}

/* 線を引く（一覧の行、チェック、表の罫、グラフの線）。線は pathLength="1" */
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-draw {
  stroke-dasharray: 1;
  animation-name: ti-draw;
}

@keyframes ti-draw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* ぽんと弾む（ダッシュボードの枠、組織図の箱、決裁ルートの行き先） */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-pop { transform-origin: 50% 50%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-pop { animation-name: ti-pop; }

@keyframes ti-pop {
  0%, 100% { transform: none; }
  45% { transform: scale(0.7); }
  75% { transform: scale(1.08); }
}

/* 少し跳ねる（人の頭、カレンダーの留め具、データベースの上の段） */
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-hop { animation-name: ti-hop; }

@keyframes ti-hop {
  0%, 100% { transform: none; }
  45% { transform: translateY(-32%); }
}

/* 左右に動く（入金消込の矢印、設定のつまみ） */
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-slide-r { animation-name: ti-slide-r; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-slide-l { animation-name: ti-slide-l; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-knob-r { animation-name: ti-knob-r; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-knob-l { animation-name: ti-knob-l; }

@keyframes ti-slide-r {
  0%, 100% { transform: none; }
  50% { transform: translateX(14%); }
}

@keyframes ti-slide-l {
  0%, 100% { transform: none; }
  50% { transform: translateX(-14%); }
}

@keyframes ti-knob-r {
  0%, 100% { transform: none; }
  50% { transform: translateX(80%); }
}

@keyframes ti-knob-l {
  0%, 100% { transform: none; }
  50% { transform: translateX(-80%); }
}

/* 揺れる（費目の札。穴のあたりを中心に） */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-swing { transform-origin: 25% 25%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-swing { animation-name: ti-swing; }

@keyframes ti-swing {
  0%, 100% { transform: none; }
  30% { transform: rotate(14deg); }
  65% { transform: rotate(-8deg); }
}

/* 吹き出しの中に … が順に出る（入力中の印）。ふだんは見せない */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-dot {
  opacity: 0;
  stroke-width: 2.6;
}

:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-dot { animation-name: ti-dot; }

@keyframes ti-dot {
  0% { opacity: 0; transform: translateY(40%); }
  100% { opacity: 1; transform: none; }
}

/* 電球のまわりに光の線が出る。ふだんは見せない */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-ray {
  opacity: 0;
  transform-origin: 50% 70%;
}

:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-ray { animation-name: ti-ray; }

@keyframes ti-ray {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

/* 鉛筆が小さく左右に振れる（書いている動き） */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-pen { transform-origin: 0% 100%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-pen { animation-name: ti-write; }

@keyframes ti-write {
  0%, 100% { transform: none; }
  25% { transform: translateX(-22%) rotate(-14deg); }
  50% { transform: translateX(10%) rotate(6deg); }
  75% { transform: translateX(-12%) rotate(-8deg); }
}

/* 差し込み口（紙の上の辺）から紙が下へ伸びて出てくる */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-paper { transform-origin: 50% 0%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-paper { animation-name: ti-print; }

@keyframes ti-print {
  0% { transform: scaleY(0.15); }
  100% { transform: none; }
}

/* 時計: 変更履歴は針が左回りに 1 周して矢印の弧が少し戻る。未実行は針が右回りに 1 周 */
:is(.tabs__icon, .sidebar__icon, .btnicon) :is(.ti-rewind, .ti-arc, .ti-tick) {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-rewind { animation-name: ti-rewind; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-arc { animation-name: ti-back; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-tick { animation-name: ti-tick; }

@keyframes ti-rewind {
  0% { transform: none; }
  100% { transform: rotate(-360deg); }
}

@keyframes ti-tick {
  0% { transform: none; }
  100% { transform: rotate(360deg); }
}

@keyframes ti-back {
  0%, 100% { transform: none; }
  50% { transform: rotate(-30deg); }
}

/* お気に入りの星: 回りながら弾む */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-star { transform-origin: 50% 50%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-star { animation-name: ti-star; }

@keyframes ti-star {
  0%, 100% { transform: none; }
  50% { transform: rotate(72deg) scale(1.15); }
}

/* 沈んで戻る（取り込むの矢印） */
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-down { animation-name: ti-down; }

@keyframes ti-down {
  0%, 100% { transform: none; }
  45% { transform: translateY(28%); }
}

/* 下を軸に押されて縮み、戻る（保存の札） */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-press { transform-origin: 50% 100%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-press { animation-name: ti-press; }

@keyframes ti-press {
  0%, 100% { transform: none; }
  45% { transform: scaleY(0.55); }
}

/* 後ろの紙から前の紙がずれて出てくる（複製） */
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-copy { animation-name: ti-copy; }

@keyframes ti-copy {
  0% { transform: translate(-40%, -40%); opacity: 0.3; }
  100% { transform: none; opacity: 1; }
}

/* ごみ箱のふたが左を軸に開いて閉じる */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-lid { transform-origin: 0% 100%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-lid { animation-name: ti-lid; }

@keyframes ti-lid {
  0%, 100% { transform: none; }
  35% { transform: translateY(-30%) rotate(-22deg); }
  70% { transform: rotate(4deg); }
}

/* 紙飛行機が右上へ飛んで消え、左下から戻ってくる */
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-fly { animation-name: ti-fly; }

@keyframes ti-fly {
  0%, 100% { transform: none; opacity: 1; }
  40% { transform: translate(45%, -45%) scale(0.6); opacity: 0; }
  41% { transform: translate(-45%, 45%) scale(0.6); opacity: 0; }
}

/* ＋ が 1/4 回る */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-turn { transform-origin: 50% 50%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-turn { animation-name: ti-turn; }

@keyframes ti-turn {
  0% { transform: none; }
  100% { transform: rotate(90deg); }
}

/* 目がまばたきする */
:is(.tabs__icon, .sidebar__icon, .btnicon) .ti-blink { transform-origin: 50% 50%; }
:is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover .ti-blink { animation-name: ti-blink; }

@keyframes ti-blink {
  0%, 100% { transform: none; }
  40% { transform: scaleY(0.1); }
}

/* 動きを減らす設定の人には動かさない（… と光の線は出さないまま） */
@media (prefers-reduced-motion: reduce) {
  :is(.tabs__item, .sidebar__item, .split__pick, .btn:not(:disabled)):hover :is([class^="ti-"], [class*=" ti-"]) {
    animation: none;
  }
}

.tabs__item.is-active {
  color: var(--c-brand);
  border-bottom-color: var(--c-brand);
  font-weight: 600;
}

.tabs__count {
  display: inline-block;
  margin-left: var(--sp-1);
  padding: 0 5px;
  background: var(--c-bg-sub);
  border-radius: 8px;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.tabs__item.is-active .tabs__count {
  background: var(--c-brand-pale);
  color: var(--c-brand-dark);
}

/* --- 4.7 モーダル ------------------------------------------------------- */
.ringi-parent-picker__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.ringi-parent-picker__label {
  flex: 1 1 12rem;
}

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

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-shade);
  padding: var(--sp-5);
}

/* モーダルの出方（全部のモーダルで同じ）。背景はふわっと暗くなり、箱は少し下から上へ滑りながら出る。
   閉じるときは逆に沈みながら消える（.is-closing。app.js の closeModal） */
.modal {
  animation: modal-fade-in var(--dur-modal) ease-in-out;
}

.modal > .modal__box {
  animation: modal-rise-in var(--dur-modal) ease-in-out;
}

.modal.is-closing {
  pointer-events: none;
  animation: modal-fade-out var(--dur-modal) ease-in-out forwards;
}

.modal.is-closing > .modal__box {
  animation: modal-sink-out var(--dur-modal) ease-in-out forwards;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modal-rise-in {
  from { opacity: 0; transform: translateY(var(--sp-5)); }
  to { opacity: 1; transform: none; }
}

@keyframes modal-sink-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(var(--sp-4)); }
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal > .modal__box {
    animation: none;
  }
}

.modal__box {
  background: var(--c-bg);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 420px;
}

.modal__box--wide { width: 860px; }
.modal__box--md { width: 620px; }
/* 別の画面を中に開くモーダル（まとめて決裁の「詳細を開く」）。画面いっぱい近くまで広げ、中の余白は中のページに任せる */
.modal__box--frame { width: min(1200px, 100%); height: 100%; overflow: hidden; }   /* 中の画面で下の角丸が隠れないように */
.modal__box--frame .modal__body { padding: 0; overflow: hidden; display: flex; }
.swipe-detail__frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--c-bg-sub); }

.modal__head {
  display: flex;
  align-items: center;
  padding: var(--sp-3);
  background: var(--c-brand);
  color: var(--c-text-inv);
  border-radius: var(--r-md) var(--r-md) 0 0;
  font-size: var(--fs-lg);
  font-weight: 600;
}

/* 閉じる: 押しやすい大きさの丸。× も大きく */
.modal__close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--sz-modal-close);
  height: var(--sz-modal-close);
  margin: calc(var(--sp-1) * -1) 0 calc(var(--sp-1) * -1) auto;
  padding: 0;
  border: 1px solid var(--c-on-dark-stroke);
  border-radius: 50%;
  background: var(--c-on-dark-fill-hover);
  color: var(--c-text-inv);
  font-size: var(--fs-2xl);
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover { background: var(--c-on-dark-stroke); }

.modal__close:focus-visible {
  outline: 3px solid var(--c-text-inv);
  outline-offset: 2px;
}

.modal__body {
  padding: var(--sp-4);
  overflow: auto;
  flex: 1 1 auto;
}

.modal__body > * + * {
  margin-top: var(--sp-3);
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--c-bg-sub);
  border-top: 1px solid var(--c-border);
  border-radius: 0 0 var(--r-md) var(--r-md);
}

/* フォームの中（本文の中）に置いた帯は、本文の余白の分だけ外へ出して箱の下の端に付ける */
.modal__body .modal__foot {
  margin: var(--sp-4) calc(var(--sp-4) * -1) calc(var(--sp-4) * -1);
}

/* --- 4.8 稟議一覧（表。768px 未満はカード） ----------------------------- */

/* 一覧の行の操作（承認・差戻し、複製・削除）を 1 行に並べる */
.ringi-table__btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
}

.ringi-table__btns form {
  display: inline-flex;
}

/* 「今の段」の文字の色。青は審査中の今の段だけ（DESIGN.md 1 のステータス色） */
.ringi-step { font-weight: 600; }
.ringi-step.is-progress { color: var(--c-st-progress); }
.ringi-step.is-ok       { color: var(--c-st-ok); }
.ringi-step.is-ng       { color: var(--c-st-ng); }
.ringi-step.is-none     { color: var(--c-text-sub); font-weight: 400; }

/* 段の帯: 1 段を 1 本の短い線で。済んだ段は緑、今の段は青、残りは灰色 */
.stepbar {
  display: inline-flex;
  gap: var(--gap-stepbar);
  margin-left: var(--sp-2);
  vertical-align: middle;
}

.stepbar__seg {
  display: block;
  width: var(--w-stepbar-seg);
  height: var(--h-stepbar);
  border-radius: var(--r-sm);
  background: var(--c-st-skip-bg);
}

.stepbar__seg.is-ok       { background: var(--c-st-ok); }
.stepbar__seg.is-progress { background: var(--c-st-progress); }
.stepbar__seg.is-ng       { background: var(--c-st-ng); }
.stepbar__seg.is-skip     { background: var(--c-st-skip); }
.stepbar__seg.is-none     { background: var(--c-border); }

/* 稟議一覧の表。箱と罫線をやめて、1 件ずつ浮いたカードの行にする。状態はピル 1 つと段の帯で言う */

.ringi-simple {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.ringi-simple th {
  padding: 0 var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--c-text-mute);
  text-align: left;
}

.rs-count {
  margin-left: var(--sp-2);
  font-weight: 400;
  letter-spacing: 0;
}

.ringi-simple th.num,
.ringi-simple td.num { text-align: right; }

.ringi-simple td {
  padding: 8px var(--sp-4);
  background: var(--c-bg);
  border-top: 1px solid var(--c-border-light);
  border-bottom: 1px solid var(--c-border-light);
  vertical-align: middle;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.ringi-simple td:first-child {
  border-left: 1px solid var(--c-border-light);
  border-radius: var(--r-md) 0 0 var(--r-md);
}

.ringi-simple td:last-child {
  border-right: 1px solid var(--c-border-light);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.ringi-simple tbody tr { cursor: pointer; }

.ringi-simple tbody tr:hover td {
  background: var(--c-row-hover);
  border-color: var(--c-border);
}

/* 自分の番の行も、地の色や左の線は付けない。目印は「あなたの番」のピル */

.rs-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rs-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.35;
}

.rs-title a {
  color: var(--c-text);
  text-decoration: none;
}

.ringi-simple tbody tr:hover .rs-title a { color: var(--c-brand); }

.rs-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--c-st-ai-bg);
  color: var(--c-st-ai-ink);
}

.rs-tag.is-urgent { background: var(--c-st-ng); color: var(--c-text-inv); }

.rs-meta {
  margin-top: 1px;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.rs-meta span::before {
  content: "·";
  margin: 0 6px;
  color: var(--c-text-mute);
}

.rs-amount {
  font-size: var(--fs-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rs-amount small {
  margin-right: 2px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-mute);
}

/* 状況の欄: ピルと段の帯を横に並べて、1 件の高さを件名の 2 行に収める */
.rs-stateline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rs-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  background: var(--c-st-none-bg);
  color: var(--c-text-sub);
}

.rs-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.rs-pill.is-mine     { background: var(--c-brand); color: var(--c-text-inv); }
.rs-pill.is-progress { background: var(--c-st-progress-bg); color: var(--c-st-progress); }
.rs-pill.is-ok       { background: var(--c-st-ok-bg); color: var(--c-st-ok); }
.rs-pill.is-ng       { background: var(--c-st-ng-bg); color: var(--c-st-ng); }
.rs-pill.is-draft    { background: var(--c-st-draft-bg); color: var(--c-st-draft-ink); }

.rs-progress {
  width: 160px;
}

.rs-progress__bar {
  display: flex;
  gap: 3px;
}

.rs-progress__bar i {
  flex: 1;
  height: 5px;
  border-radius: 2px;
  background: var(--c-border-light);
}

.rs-progress__bar i.is-ok       { background: var(--c-st-ok); }
.rs-progress__bar i.is-progress { background: var(--c-st-progress); }
.rs-progress__bar i.is-ng       { background: var(--c-st-ng); }
.rs-progress__bar i.is-skip     { background: var(--c-st-skip); }

.rs-progress__text {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
  white-space: nowrap;
}

.rs-progress__text b { color: var(--c-text); }

.rs-wait {
  display: block;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  white-space: nowrap;
}

.rs-wait b {
  margin-right: 1px;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.rs-wait.is-slow b { color: var(--c-st-draft); }
.rs-wait.is-late b { color: var(--c-st-ng); }

.rs-date {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}

.rs-ops {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.rs-ops .btn + .btn { margin-left: 6px; }

.rs-open {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 6px 6px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-sub);
  text-decoration: none;
}

.rs-open svg { width: 16px; height: 16px; }

.ringi-simple tbody tr:hover .rs-open {
  background: var(--c-brand-pale);
  color: var(--c-brand-dark);
}

/* 稟議一覧の絞り込みの帯: 条件と操作を 1 行に。「条件を増やす」を開くと、下の行に続ける */
.ringi-filter {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
}

.ringi-filter .filterbar__fields {
  flex: 1 1 auto;
  align-items: flex-end;
  gap: var(--sp-2) var(--sp-3);
}

.ringi-filter .fieldrow--stack {
  gap: 2px;
}

.ringi-filter .fieldrow--stack > label,
.ringi-filter .filterbar__field > label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-sub);
}

.ringi-filter__actions {
  flex: 0 0 auto;
  align-items: center;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ringi-filter__more {
  align-self: flex-end;
}

.ringi-filter__more[open] {
  flex-basis: 100%;
}

/* 詳細条件の開け閉めは、高さを 0 から広げて下へスライドさせる（サイドメニューのグループと同じ。
   閉じるときも縮めてから隠す） */
.ringi-filter__more {
  interpolate-size: allow-keywords;
}

.ringi-filter__more::details-content {
  block-size: 0;
  overflow: clip;
  opacity: 0;
  transition: block-size var(--dur-slide) ease-in-out, opacity var(--dur-slide) ease-in-out,
    content-visibility var(--dur-slide) allow-discrete;
}

.ringi-filter__more[open]::details-content {
  block-size: auto;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .ringi-filter__more::details-content {
    transition: none;
  }
}

.ringi-filter__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: var(--h-input);
  color: var(--c-brand);
  font-size: var(--fs-sm);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.ringi-filter__toggle::-webkit-details-marker {
  display: none;
}

/* ＋（開くと －）。語の左に */
.ringi-filter__toggle-icon {
  width: var(--sz-moveicon);
  height: var(--sz-moveicon);
  background-color: currentColor;
  -webkit-mask: var(--icon-plus) center / contain no-repeat;
  mask: var(--icon-plus) center / contain no-repeat;
}

/* 開いたら「＋ 詳細条件」は出さない（閉じる操作は置かない）。条件の行だけが並ぶ */
.ringi-filter__more[open] > .ringi-filter__toggle {
  display: none;
}

/* 詳細条件を開いたら、絞り込むのボタンは点線の下の行の右端に（上下の真ん中にしない） */
.ringi-filter:has(.ringi-filter__more[open]) > .ringi-filter__actions {
  align-self: flex-end;
  /* ボタンは欄より低いので、下の行の欄と上下の真ん中をそろえる */
  margin-bottom: calc((var(--h-input) - var(--h-btn-sm)) / 2);
}

.ringi-filter__more-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-1);
  padding-top: var(--sp-2);
}

/* 上の行との区切りの点線は、絞り込みの枠の左右いっぱいに引く（右の「絞り込む」の上まで）。
   線は枠（.ringi-filter）を基準に置き、上下の位置は詳細条件の欄の上の端のまま */
.ringi-filter {
  position: relative;
}

.ringi-filter__more-body::before {
  content: "";
  position: absolute;
  left: var(--sp-3);
  right: var(--sp-3);
  border-top: 1px dashed var(--c-border-light);
  /* 欄の並び（flex・grid）の下揃えに引っぱられないよう、上の端に置いてから余白の分だけ上げる */
  align-self: start;
  justify-self: stretch;
  transform: translateY(calc(var(--sp-2) * -1));
}

/* 一覧からの承認・差戻しのモーダルの要約（2 列の小さな表） */
.ringi-quick-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2) var(--sp-4);
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-sub);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}

.ringi-quick-summary dt {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.ringi-quick-summary dd {
  margin: 0;
  font-weight: 600;
}

.ringi-quick-summary__amount {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-lg);
}

/* 768px 以上は、帯の見出しを入力欄の左に置いて 1 行にする（表の行を多く出すため） */
@media (min-width: 768px) {
  .ringi-filter,
  .ringi-filter .filterbar__fields,
  .ringi-filter__more-body {
    align-items: center;
  }

  .ringi-filter .filterbar__field,
  .ringi-filter .fieldrow--stack {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--sp-1);
  }

  .ringi-filter .filterbar__field label {
    white-space: nowrap;
  }

  .ringi-filter__more {
    align-self: center;
  }

  /* 帯が折り返すときは、絞り込むのボタンを下の行の右端に（2 行の間に浮かせない） */
  .ringi-filter > .ringi-filter__actions {
    align-self: flex-end;
  }

  .ringi-filterwrap {
    container-type: inline-size;
  }
}

/* 帯に幅があれば、欄を縮めて「詳細条件」と絞り込むまで 1 行に収める。幅は件名の欄が受ける */
@container (min-width: 800px) {
  .ringi-filter .filterbar__fields:not(:has(> .ringi-filter__more[open])) {
    flex-wrap: nowrap;
  }

  .ringi-filter .filterbar__fields > .filterbar__field {
    flex: 0 1 auto;
    min-width: 0;
  }

  .ringi-filter .filterbar__fields > .filterbar__field:first-child {
    flex: 1 1 auto;
  }

  .ringi-filter .filterbar__fields > .filterbar__field:first-child .input {
    width: 100%;
    min-width: 6rem;
  }

  .ringi-filter .filterbar__fields > .filterbar__field .select {
    min-width: 5.5rem;
  }

  .ringi-filter__more {
    flex: 0 0 auto;
  }

  .ringi-filter__toggle {
    white-space: nowrap;
  }
}

.ringi-hidden-note {
  margin-top: var(--sp-2);
}

.ringi-grid {
  display: none;
  gap: var(--sp-2);
}

.ringi-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.ringi-card__link {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  color: inherit;
  text-decoration: none;
}

.ringi-card__head {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
}

.ringi-card__subject {
  font-weight: 600;
  font-size: var(--fs-lg);
}

.ringi-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.ringi-card__amount {
  margin-left: auto;
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.ringi-card__actions {
  display: flex;
  gap: var(--sp-2);
}

.ringi-card__actions .btn {
  flex: 1 1 0;
  min-height: var(--h-tap, var(--h-btn));
}

@media (max-width: 767px) {
  .ringi-list-table { display: none; }
  .ringi-grid { display: grid; }
  .ringi-grid-pager { display: block; }

  /* 帯は縦に積む。件名は 1 行、選ぶ欄は 2 列に並べて高さを抑える */
  .ringi-filter {
    align-items: stretch;
  }

  .ringi-filter .filterbar__fields,
  .ringi-filter__more-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .ringi-filter .filterbar__field:first-child,
  .ringi-filter__more,
  .ringi-filter__more[open] {
    grid-column: 1 / -1;
  }

  /* 日付の欄（決まった幅と、右どなりの今日・昨日）は 2 列に入らないので、1 行を使う */
  .ringi-filter .filterbar__field:has(.td-date-wrap) {
    grid-column: 1 / -1;
  }

  .ringi-filter .select,
  .ringi-filter .input:not(.td-date) {
    width: 100%;
    max-width: 100%;
  }

  .ringi-filter__actions {
    flex-wrap: wrap;
  }
}

/* --- 4.9 ページャー ------------------------------------------------------ */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

/* 表の欄の下の帯に入れたとき。帯いっぱいの中央に */
.panel__foot .pager {
  flex: 1 1 auto;
  margin-top: 0;
  padding: 0;
}

/* スマホのカードの下のページャー。PC は表の欄の帯にあるので出さない */
.ringi-grid-pager {
  display: none;
}

.pager__info {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  white-space: nowrap;
}

/* --- 4.7 KPIカード ------------------------------------------------------ */
.kpi {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  padding: var(--sp-3);
}

.kpi__label {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  margin-bottom: var(--sp-1);
}

.kpi__value {
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi__unit {
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--c-text-sub);
  margin-left: 2px;
}

.kpi__foot {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
  font-size: var(--fs-sm);
}

.kpi__yoy {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kpi__yoy.is-up { color: var(--c-st-ok); }
.kpi__yoy.is-down { color: var(--c-st-ng); }

.kpi--alert {
  border-color: var(--c-st-ng);
}

.kpi--warn {
  border-color: var(--c-st-draft);
}

/* 詰めた KPI（集計の画面など、下の表を早く見せたいとき）。ラベルと数字を 1 行に、補足はその下に小さく */
.kpirow--compact .kpi {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
}

.kpirow--compact .kpi__label {
  margin-bottom: 0;
}

.kpirow--compact .kpi__value,
.kpirow--compact .kpi--muted .kpi__value {
  justify-self: end;
  font-size: var(--fs-2xl);
}

.kpirow--compact .kpi__foot {
  grid-column: 1 / -1;
  margin-top: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

/* 脇の数（除外した件数など）。地を灰にし、数字を小さく薄く */
.kpi--muted {
  background: var(--c-th-bg);
}

.kpi--muted .kpi__value {
  font-size: var(--fs-2xl);
  color: var(--c-text-sub);
}

/* 押すとその一覧へ移る KPI。見た目は KPI のまま、ホバーで地と枠を変える */
.kpi--link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.kpi--link:hover {
  background: var(--c-row-hover);
  border-color: var(--c-brand);
}

/* 稟議一覧の承認待ちの件数（あなたの番があるとき）。サイドメニューの件数と同じ赤い丸に白い字 */
.tabs__count--alert,
.tabs__item.is-active .tabs__count--alert {
  background: var(--c-st-ng);
  color: var(--c-text-inv);
  font-weight: 600;
}

/* 稟議一覧のタブの「差戻し n」（自分の申請に差戻しがあるとき）。赤い地の小さな印 */
.tabs__count--ng,
.tabs__item.is-active .tabs__count--ng {
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
  font-weight: 600;
}

/* 未実行のタブの期日間近。橙の地の小さな印（§4.30） */
.tabs__count--warn,
.tabs__item.is-active .tabs__count--warn {
  background: var(--c-st-draft-bg);
  color: var(--c-st-draft-ink);
  font-weight: 600;
}

/* 絞り込みの帯の包み。広い画面ではいつも開き、見出し（絞り込み）は出さない。狭い画面では見出しで開く */
.ringi-filterwrap {
  margin-bottom: var(--sp-3);
}

.ringi-filterwrap > .filterbar {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .ringi-filterwrap > .ringi-filterwrap__toggle {
    display: none;
  }

  .ringi-filterwrap::details-content {
    content-visibility: visible;
    display: block;
    block-size: auto;   /* 広い画面ではいつも開いて見せる（base.css の開け閉めの動きを当てない） */
    overflow: visible;
    opacity: 1;
    transition: none;
  }
}

.ringi-filterwrap__toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--h-tap, var(--h-btn));
  padding: 0 var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c-text-sub);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.ringi-filterwrap__toggle::-webkit-details-marker {
  display: none;
}

.ringi-filterwrap__toggle::before {
  content: "";
  width: var(--sz-sorticon);
  height: var(--sz-sorticon);
  background-color: currentColor;
  -webkit-mask: var(--icon-filter) center / contain no-repeat;
  mask: var(--icon-filter) center / contain no-repeat;
}

.ringi-filterwrap[open] > .ringi-filterwrap__toggle {
  margin-bottom: var(--sp-2);
  border-color: var(--c-brand);
  color: var(--c-brand-dark);
}

/* 行の中のアイコンだけの小さなボタン（稟議一覧の複製・削除）。承認・差戻しと同じ高さで 1 行に並べる */
.rowicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-btn-sm);
  height: var(--h-btn-sm);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text-sub);
  cursor: pointer;
  transition: color var(--dur-menu) ease-in-out, background var(--dur-menu) ease-in-out,
    border-color var(--dur-menu) ease-in-out;
}

.rowicon svg {
  width: var(--sz-moveicon);
  height: var(--sz-moveicon);
}

.rowicon:hover {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
  color: var(--c-brand-dark);
}

.rowicon--danger:hover {
  border-color: var(--c-st-ng);
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
}

/* --- 差分（delta マクロ）: + は緑、▲ は赤、0 は色なし ------------------ */
.delta {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.delta--up { color: var(--c-st-ok); }
.delta--down { color: var(--c-st-ng); }

/* --- 節の見出し（sectionhead マクロ） ---------------------------------- */
.sectionhead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-5) 0 var(--sp-3);
}

.sectionhead:first-child {
  margin-top: 0;
}

.sectionhead__title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.sectionhead__sub {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
  transform: translateY(calc(var(--sp-hair) * -0.5));   /* 題の字の見た目の真ん中にそろえる（.panel__sub と同じ理由。題が大きいので少しだけ） */
}

.sectionhead__actions {
  margin-left: auto;
  display: flex;
  gap: var(--sp-2);
}

/* --- 4.7 トースト ------------------------------------------------------- */
/* 知らせは画面の右下の角に出す。下に止めた操作帯（.formfoot--sticky）がある画面だけ、その上に出す */
.toastwrap {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-end;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 260px;
  padding: var(--sp-3);
  background: var(--c-text);
  color: var(--c-text-inv);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm);
  animation: toast-in var(--dur-toast) ease-in-out;
}

.toast.is-leaving {
  animation: toast-out var(--dur-toast) ease-in-out forwards;
}

body:has(.formfoot--sticky) .toastwrap {
  bottom: calc(var(--h-actionbar) + var(--sp-3));
}

.toast--ok { background: var(--c-st-ok); }
.toast--ng { background: var(--c-st-ng); }

.toast__text {
  flex: 1 1 auto;
  min-width: 0;
}

.toast__close {
  flex: none;
  width: var(--h-btn-sm);
  height: var(--h-btn-sm);
  margin: calc(var(--sp-1) * -1) calc(var(--sp-1) * -1) calc(var(--sp-1) * -1) 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: inherit;
  font-size: var(--fs-lg);
  line-height: 1;
  cursor: pointer;
}

.toast__close:hover {
  background: var(--c-on-dark-fill-hover);
}

/* 右の外から滑り込み、消えるときは右へ滑って消える */
@keyframes toast-in {
  from { opacity: 0; transform: translateX(calc(100% + var(--sp-5))); }
  to   { opacity: 1; transform: none; }
}

@keyframes toast-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(calc(100% + var(--sp-5))); }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation: none;
  }
}

/* --- 進捗バー ---------------------------------------------------------- */
.progress {
  height: 8px;
  background: var(--c-border-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--c-st-ok);
  transition: width 0.4s ease;
}

.progress__fill--brand { background: var(--c-brand); }

/* --- 横棒（構成比などの簡易表示） --------------------------------------- */
.minibar {
  position: relative;
  height: var(--h-minibar);
  background: var(--c-bg-sub);
  border-radius: var(--r-sm);
  overflow: hidden;
  min-width: 60px;
}

.minibar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;   /* app.js の fillMinibars が data-percent の幅まで伸ばす */
  background: var(--c-ch-1);   /* 既定は銅の茶。点数の帯・評価の ★ は上書きする */
  transition: width var(--dur-bar) var(--ease-bar);
}

/* --- ドロップゾーン（入金消込のCSV取込） -------------------------------- */
.dropzone {
  border: 2px dashed var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
  padding: var(--sp-6);
  text-align: center;
  color: var(--c-text-sub);
}

.dropzone.is-over {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
  color: var(--c-brand-dark);
}

/* --- タイル（機能ショートカット） --------------------------------------- */
.tile {
  display: block;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  padding: var(--sp-4);
  color: var(--c-text);
}

.tile:hover {
  background: var(--c-row-hover);
  border-color: var(--c-brand);
  text-decoration: none;
}

.tile__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0 0 var(--sp-2);
}

.tile__desc {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  line-height: 1.55;
  min-height: 60px;
}

.tile__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--c-border-light);
  font-size: var(--fs-sm);
}

/* --- TODOリスト（ポータルトップ） --------------------------------------- */
.todo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
  font-size: var(--fs-sm);
}

.todo:last-child { border-bottom: 0; }
.todo:hover { background: var(--c-row-hover); }

/* --- チャート枠 -------------------------------------------------------- */
.chartbox {
  position: relative;
  width: 100%;
}

.chartbox canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.wordcloud-legend {
  display: flex;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-sub);
}

.wordcloud-legend--below { justify-content: center; margin-top: var(--sp-2); color: var(--c-text-mute); }

/* キーワード横断集計の絞り込みの帯。種別・期間は .fmap-switch（選んでいる方が銅色の地に白い字）を使い回す */
.kwfilter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); margin-bottom: var(--sp-3); }
.kwfilter__group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.kwfilter__label { font-size: var(--fs-xs); color: var(--c-text-sub); }
.kwfilter__switch { flex-wrap: wrap; }
.kwfilter__custom { display: flex; align-items: center; gap: var(--sp-2); }
.kwfilter__custom[open] { flex-wrap: wrap; }
.kwfilter__toggle { display: inline-flex; align-items: center; height: var(--h-btn-sm); font-size: var(--fs-sm); color: var(--c-brand); cursor: pointer; user-select: none; }
.kwfilter__custom[open] > .kwfilter__toggle { font-weight: 700; }
.kwfilter__form { justify-content: flex-start; }
.kwfilter__clear, .kwfilter__clear:hover { font-size: var(--fs-sm); color: var(--c-text-sub); text-decoration: none; }

.wordcloud-legend__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.wordcloud-legend__dot--positive { background: var(--c-ch-3); }
.wordcloud-legend__dot--negative { background: var(--c-ch-6); }
.wordcloud-legend__dot--improvement { background: var(--c-ch-4); }

.wordcloud-tooltip {
  position: absolute;
  transform: translate(-50%, -130%);
  background: var(--c-text);
  color: var(--c-text-inv);
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

.chartbox--sm { height: 200px; }
.chartbox--md { height: 260px; }

/* アンケートのタイトルの末尾の補足（好調・〜に課題）。括弧を外し、色の語と顔のアイコンで */
.titlenote {
  margin-left: var(--sp-2);
  white-space: nowrap;
}

/* タイトルと補足を 1 行に収める（補足だけ次の行に落ちない） */
.survey-table__main {
  white-space: nowrap;
  font-weight: 600;   /* タイトルは稟議一覧の件名と同じ太字 */
}

.survey-table__main .titlenote {
  font-weight: 400;
}

/* 一覧のタイトル・種別のリンクは、乗せても下線を出さない */
.survey-table a:hover {
  text-decoration: none;
}

.survey-table tbody tr:hover .survey-table__main {
  color: var(--c-brand);
}

/* 顔は文字と同じ行に置き、少し下げて字の中央に合わせる（文字の下端はタイトルとそろう） */
.titlenote__face {
  width: var(--sz-titleface);
  height: var(--sz-titleface);
  margin-right: var(--sp-hair);
  vertical-align: -0.27em;   /* 字の見た目の真ん中にそろえる */
}

.titlenote--ok { color: var(--c-st-ok); }
.titlenote--ng { color: var(--c-st-ng); }
.titlenote--none { color: var(--c-text-sub); }

/* 回答の経路（画面・紙・代理入力）。アイコンと語 */
.srclabel {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  white-space: nowrap;
}

.srclabel__icon {
  flex: 0 0 auto;
  width: var(--sz-tabicon);
  height: var(--sz-tabicon);
  color: var(--c-text-sub);
}

/* パンくずのいちばん右のお気に入りの ☆。入れたら銅で塗る */
.crumbs .favstar {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-hair);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--c-text-mute);
  cursor: pointer;
}

.crumbs .favstar::before {
  content: none;
}

.favstar:hover {
  color: var(--c-brand);
  background: var(--c-row-hover);
}

/* 星は尖った先が上にあり、線の重心が外枠の真ん中より下に寄る。字と重心をそろえるため少し上げる */
.favstar__icon {
  width: var(--sz-tabicon);
  height: var(--sz-tabicon);
  transform: translateY(-0.07em);
}

.favstar.is-on {
  color: var(--c-brand);
}

.favstar.is-on .favstar__icon {
  fill: currentColor;
}

/* 回答一覧の絞り込み（欄の見出しの右）。見出しの太字を引き継がず、帯の高さに収める */
.respfilter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  font-weight: 400;
}

.respfilter .select,
.respfilter .input {
  height: var(--h-btn-sm);
  font-size: var(--fs-sm);
}

.ai-report__meeting-text {
  margin: 0;
  line-height: 1.8;
  white-space: pre-line;
}

/* AI分析をまだ生成していないとき。対象と作るものの表（.deftable）と、右下の主ボタン */
.ai-plan__actions {
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* 2 つのグラフで 1 つの凡例。グラフの下の中央に並べる。色の並びは app.js の chartPalette */
.chartlegend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-1) var(--sp-3);
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.chartlegend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.chartlegend__swatch {
  display: inline-block;
  width: var(--sp-3);
  height: var(--sp-3);
  border-radius: var(--r-sm);
}

.chartlegend__swatch--1  { background: var(--c-ch-1); }
.chartlegend__swatch--2  { background: var(--c-ch-2); }
.chartlegend__swatch--3  { background: var(--c-ch-3); }
.chartlegend__swatch--4  { background: var(--c-ch-4); }
.chartlegend__swatch--5  { background: var(--c-ch-5); }
.chartlegend__swatch--6  { background: var(--c-ch-6); }
.chartlegend__swatch--7  { background: var(--c-ch-1-alt); }
.chartlegend__swatch--8  { background: var(--c-ch-2-alt); }
.chartlegend__swatch--9  { background: var(--c-ch-3-alt); }
.chartlegend__swatch--10 { background: var(--c-ch-4-alt); }
.chartlegend__swatch--11 { background: var(--c-ch-5-alt); }
.chartlegend__swatch--12 { background: var(--c-ch-6-alt); }

/* 設問ごとの分布。「ラベル | 棒 | 件数と割合」を詰めて並べる。評価は ★ で、良いほうが上 */
.distlist {
  display: grid;
  grid-template-columns: max-content minmax(var(--w-distbar-min), 1fr) max-content max-content;
  align-items: center;
  gap: var(--sp-hair) var(--sp-2);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.distlist__label {
  color: var(--c-text-sub);
  white-space: nowrap;
}

.distlist__bar {
  height: var(--h-distbar);
  min-width: 0;
}

/* 設問ごとの集計の棒は動かさない */
.distlist .minibar__fill {
  transition: none;
}

.distlist--rate .minibar__fill {
  background: var(--c-star);
}

.distlist__count,
.distlist__pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.distlist__pct {
  color: var(--c-text-mute);
}

.stars {
  color: var(--c-star);
  letter-spacing: 0.05em;
}

.stars__off {
  color: var(--c-border);
}

/* テーマ別の件数（棒）と月次推移（折れ線）を 1 つの欄に。欄に 2 つ入る幅があれば左右に半分ずつ並べ、
   入らなければ折り返して縦に積む（画面の幅ではなく欄の幅で決める） */
.themeview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.themeview__col {
  flex: 1 1 var(--w-themeview-chart);
  min-width: 0;
}

.themeview__title {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-sub);
}

.chartbox--wordcloud { height: var(--h-wordcloud); }

/* 頻出キーワードは、描き終わったら欄ごとフェードインで見せる */
.wordcloud-canvas {
  opacity: 0;
  transition: opacity var(--dur-menu) ease-in-out;
}

.wordcloud-canvas.is-shown {
  opacity: 1;
}

/* --- 注記ボックス ------------------------------------------------------ */
/* 注記。境界は四辺の罫線で表す（DESIGN.md 0-2 の方針） */
.note {
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-brand-pale);
  border: 1px solid var(--c-brand);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--c-brand-dark);
  margin-bottom: var(--sp-3);
}

.note:last-child { margin-bottom: 0; }

/* 案内文のための、弱い注記。茶色の枠は「対応すべきこと」に取っておく */
.note--muted {
  background: var(--c-th-bg);
  border-color: var(--c-border);
  color: var(--c-text-sub);
}

.note--warn {
  background: var(--c-st-draft-bg);
  border-color: var(--c-st-draft);
  color: var(--c-st-draft-ink);
}

.note--ai {
  background: var(--c-st-ai-bg);
  border-color: var(--c-st-ai);
  color: var(--c-st-ai-ink);
}

.note--ok {
  background: var(--c-st-ok-bg);
  border-color: var(--c-st-ok);
  color: var(--c-st-ok);
}

/* 自分の番であることを伝える注記。審査中の青（--c-st-progress） */
.note--info {
  background: var(--c-st-progress-bg);
  border-color: var(--c-st-progress);
  color: var(--c-st-progress);
  font-weight: 600;
}

/* 自分が対応すべきことを伝える、いちばん強い注記 */
.note--alert {
  background: var(--c-st-ng-bg);
  border-color: var(--c-st-ng);
  color: var(--c-st-ng);
}

/* --- QR（公開の入口） ---------------------------------------------------- */
/* 紙に刷って客室に置く。枠を付けて余白を守る */
/* 文字をコピーするアイコンのボタン（URL の横など）。app.js の wireCopyButtons */
.copybtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--sp-1);
  padding: var(--sp-hair);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--c-text-mute);
  vertical-align: -0.2em;
  cursor: pointer;
}

.copybtn:hover {
  color: var(--c-brand);
  background: var(--c-row-hover);
}

.copybtn__icon,
.copybtn__done {
  width: var(--sz-tabicon);
  height: var(--sz-tabicon);
}

/* コピーできたら、少しのあいだアイコンをチェックに替え、横に「コピーしました」 */
.copybtn__done,
.copybtn.is-done .copybtn__icon {
  display: none;
}

.copybtn.is-done .copybtn__done {
  display: block;
  color: var(--c-st-ok);
}

.copybtn__note {
  margin-left: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--c-st-ok);
  white-space: nowrap;
}

.copybtn__note.is-ng {
  color: var(--c-st-ng);
}

/* 公開の入口の QR。欄の中で左右中央に置き、上の項目（受付など）とは間を空ける */
.qr {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  margin-top: var(--sp-5);
  text-align: center;
}

.qr__img {
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  padding: var(--sp-2);
}

.qr__link {
  position: relative;
  display: block;
  line-height: 0;
}

.qr__img {
  display: block;
}

/* ホバーで QR の上を暗くし、白い保存のアイコンを重ねる */
.qr__save {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-shade);
  color: var(--c-text-inv);
  opacity: 0;
  transition: opacity var(--dur-menu) ease-in-out;
}

.qr__save svg {
  width: var(--sz-qr-save);
  height: var(--sz-qr-save);
}

.qr__link:hover .qr__save {
  opacity: 1;
}

.qr__note {
  margin: 0;
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
}

/* --- スマホ枠（アンケート回答画面のプレビュー） -------------------------- */
/* 実機と同じ幅（内側375px）で見せる。ここが狭いと回答画面の表示が崩れる */
.phone {
  width: 100%;
  max-width: 395px;
  border: 10px solid var(--c-text);
  border-radius: 28px;
  background: var(--c-text);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  flex: 1 1 auto;
}

.phone__notch {
  height: 18px;
  background: var(--c-text);
  position: relative;
}

.phone__notch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  transform: translateX(-50%);
  width: 76px;
  height: 12px;
  background: var(--c-ink);
  border-radius: 8px;
}

.phone__screen {
  height: 640px;
  background: var(--c-bg);
  overflow: auto;
  padding: var(--sp-3);
}

.phone__frame {
  width: 100%;
  height: 640px;
  border: 0;
  display: block;
}

/* --- 設問編集 ---------------------------------------------------------- */
.qlist {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* 設問の表の形（DESIGN.md 4.22）。見出しの行と各行の summary が同じ列の grid を持つ */
.qlist__head,
.qlist--table {
  --qcols: var(--w-q-no) minmax(0, 1fr) var(--w-q-type) var(--w-q-flag)
    var(--w-q-reason) var(--w-q-chev);
}

.qlist--table {
  gap: 0;
}

.qlist__head {
  display: flex;
  gap: var(--sp-1);
  background: var(--c-th-bg);
  border-bottom: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-sub);
}

.qlist__cols {
  display: grid;
  grid-template-columns: var(--qcols);
  gap: var(--sp-2);
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--sp-1) var(--sp-3);
}

.qlist__ops {
  flex: 0 0 var(--w-q-ops);
  padding: var(--sp-1) var(--sp-2) var(--sp-1) 0;
}

.qcard {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  overflow: hidden;
}

.qlist--table > .qcard {
  border: 0;
  border-bottom: 1px solid var(--c-border-light);
  border-radius: 0;
}

.qcard__summary {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto 1rem;
  align-items: center;
  gap: var(--sp-2);
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.qlist--table .qcard__summary {
  grid-template-columns: var(--qcols);
  min-height: var(--h-row);
  padding: var(--sp-1) var(--sp-3);
}

.qcard__main {
  display: block;
  min-width: 0;
}

.qcard__cell {
  font-size: var(--fs-sm);
}

.qcard__row {
  display: flex;
  align-items: stretch;
  gap: var(--sp-1);
  border-bottom: 1px solid transparent;
}

.qcard--open .qcard__row {
  border-bottom-color: var(--c-border-light);
}

.qcard__list-ops {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2) var(--sp-1) 0;
  flex: 0 0 auto;
}

.qlist--table .qcard__list-ops {
  flex-basis: var(--w-q-ops);
}

/* 設問の ↑↓ は form ではなくボタンが直に並ぶ */
.iconmove > .iconmove__btn + .iconmove__btn {
  border-left: 0;
}

.iconmove > .iconmove__btn:first-child {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.iconmove > .iconmove__btn:last-child {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* 削除は押すまで赤くしない（行ごとの赤い塊を避ける） */
.iconmove .iconmove__btn.qcard__del:hover:not(:disabled) {
  border-color: var(--c-st-ng);
  color: var(--c-st-ng);
  background: var(--c-st-ng-bg);
}

.qcard__summary--static {
  cursor: default;
}

.qcard--open .qcard__summary {
  background: transparent;
}

.qcard__row:hover {
  background: var(--c-row-hover);
}

.qcard--open .qcard__row {
  background: var(--c-bg-sub);
}

.qcard__no {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-text-sub);
}

.qcard__label {
  min-width: 0;
  font-size: var(--fs-sm);
}

.qcard__chev {
  color: var(--c-text-mute);
  font-size: var(--fs-lg);
  line-height: 1;
  transition: transform 0.15s ease;
}

.qcard--open .qcard__chev {
  transform: rotate(90deg);
}

.qcard__edit {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

.qcard__op {
  margin: 0;
  display: inline-flex;
}

/* 設問の編集の「種類・必須・低評価の理由・表示」。格子の列（--w-formgrid-col）にすると間が空きすぎるので、
   欄は中身の幅にして詰めて並べる */
.formgrid.qcard__fieldrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-3);
}

.qcard__fieldrow .fieldrow {
  margin: 0;
}

.qcard__fieldrow .select {
  width: auto;
  min-width: var(--w-qfield);
}

/* 下の欄（選択肢など）とは間を空ける */
.qcard__fieldrow + .fieldrow,
.qcard__fieldrow + [data-qcard-detail] {
  margin-top: var(--sp-3);
}

/* 設問の追加の欄。開くときは高さを 0 から広げて下へスライドし（.is-open）、開き切ったら中身をはみ出して
   よくする（.is-shown。フォーカスの枠が切れない）。app.js の openAddQuestion / closeAddQuestion */
.qcard-add {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0 var(--sp-3);
  padding: 0 var(--sp-3);
  border: 1px dashed transparent;
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
  opacity: 0;
  transition: grid-template-rows var(--dur-slide) ease-in-out, margin var(--dur-slide) ease-in-out,
    padding var(--dur-slide) ease-in-out, opacity var(--dur-slide) ease-in-out,
    border-color var(--dur-slide) ease-in-out;
}

.qcard-add[hidden] {
  display: none;
}

.qcard-add.is-open {
  grid-template-rows: 1fr;
  margin: var(--sp-3);
  padding: var(--sp-3);
  border-color: var(--c-border);
  opacity: 1;
}

.qcard-add__inner {
  min-height: 0;
  overflow: hidden;
}

.qcard-add.is-shown .qcard-add__inner {
  overflow: visible;
}

/* 足したばかりの設問。上から滑り込み、淡い銅の地を一度だけ出して消す */
.qcard.qcard--new {
  animation: qcard-new 1.4s ease-in-out;
}

@keyframes qcard-new {
  0% { opacity: 0; transform: translateY(calc(var(--sp-3) * -1)); background: var(--c-brand-pale); }
  25% { opacity: 1; transform: none; background: var(--c-brand-pale); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .qcard-add {
    transition: none;
  }

  .qcard.qcard--new {
    animation: none;
  }
}

.panel__foot-inline {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.kvlist {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
}

.kvlist__row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: baseline;
}

.kvlist__row dt {
  margin: 0;
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.kvlist__row dd {
  margin: 0;
  font-size: var(--fs-sm);
  word-break: break-all;
}

.settings-inline-form {
  margin: 0;
  display: inline-flex;
}

.settings-edit__form + .settings-edit__form {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
}

.survey-edit-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.survey-edit-aside {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.survey-edit-aside .panel {
  margin-bottom: 0;
}

.survey-edit-aside .panel__body:empty {
  display: none;
}

.survey-edit-preview {
  position: sticky;
  top: var(--sp-4);
}

/* お客様の画面の頭と同じ。焦茶の帯にロゴと題を並べ、下に冒頭文 */
.pv-head {
  container-type: inline-size;
  margin: calc(var(--sp-3) * -1) calc(var(--sp-3) * -1) 0;
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
  background: var(--c-header-bg);
  color: var(--c-text-inv);
}

.pv-head__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  margin-bottom: var(--sp-2);
}

.pv-head__logo {
  display: block;
  height: var(--h-pv-logo);
  width: auto;
}

.pv-head__title {
  padding-left: var(--sp-2);
  border-left: 1px solid var(--c-on-dark-sep);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.3;
}

/* 狭くてロゴの右に入らないときは、縦線を消して題を次の行に置く（お客様の画面と同じ） */
@container (max-width: 260px) {
  .pv-head__title {
    flex-basis: 100%;
    padding-left: 0;
    border-left: 0;
  }
}

.pv-head__lead {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-on-dark-sub);
  line-height: 1.6;
}

/* 進み具合（プレビューでは何も答えていない形） */
.pv-progress {
  margin: 0 calc(var(--sp-3) * -1) var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
}

.pv-progress__bar {
  height: var(--sp-1);
  background: var(--c-border-light);
  border-radius: var(--r-sm);
}

.pv-progress__text {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-1);
  font-size: var(--fs-2xs);
  color: var(--c-text-sub);
}

.pv-progress__left {
  font-family: var(--ff-num);
  font-size: var(--fs-md);
  font-weight: 900;
  color: var(--c-brand);
}

/* 5 段階の星（まだ選んでいない形） */
.pv-stars {
  display: flex;
  gap: var(--sp-1);
}

.pv-star svg {
  display: block;
  width: var(--sz-pv-star);
  height: var(--sz-pv-star);
  fill: var(--c-border);
}

.pv-q {
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
}

.pv-q__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.pv-q__no {
  color: var(--c-brand);
}

.pv-q__req {
  font-size: var(--fs-xs);
  color: var(--c-st-ng);
  font-weight: 600;
}

.pv-rate {
  display: grid;
  gap: var(--sp-1);
}

.pv-rate--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pv-rate--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pv-rate__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
  font-size: 9px;
  text-align: center;
  line-height: 1.2;
}

.pv-rate__face {
  font-size: var(--fs-md);
}

.pv-choice {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.pv-choice__btn {
  display: block;
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  font-size: var(--fs-sm);
  text-align: left;
}

.pv-menu3__row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.pv-menu3__no {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  width: 1.25rem;
}

.pv-input,
.pv-textarea {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: var(--sp-2);
  font: inherit;
  font-size: var(--fs-sm);
  background: var(--c-bg-sub);
  box-sizing: border-box;
}

.pv-textarea {
  resize: vertical;
}

.pv-foot {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
}

.pv-submit {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-radius: var(--r-sm);
  background: var(--c-brand);
  color: var(--c-text-inv);
  font-weight: 600;
  font-size: var(--fs-sm);
  opacity: 0.55;
}

/* 送信の下の注記。お客様の画面と同じく左寄せの 1 段落 */
.pv-note {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-2xs);
  line-height: 1.6;
  color: var(--c-text-sub);
}

.pv-sign {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
  text-align: right;
}

/* プレビュー内の設問カード（回答画面など） */
.phone__screen .qcard {
  margin-bottom: var(--sp-2);
}

/* --- 積み上げの帯（消込履歴の「自動／人の判断」） ------------------------- */

/* --- 星評価表示（集計用） ----------------------------------------------- */
.stars {
  color: var(--c-st-draft);
  letter-spacing: 1px;
  white-space: nowrap;
}

.stars .off { color: var(--c-border); }

/* --- 分割ビュー（入金消込の左右対比） ----------------------------------- */

/* 完全一致は件数が多いので1行に畳む */

/* --- AI思考中の演出 ----------------------------------------------------- */
/* AI分析を待つ間のヒント（ゲームの読み込み画面のように。survey-ai.js が入れ替える）。
   進み具合の下に、薄い地の枠で。見出しの行に「ヒント」・番号・次へ、下に見出しと文 */
.aitips {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
}

.aitips[hidden] {
  display: none;
}

.aitips__head {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--c-st-ai);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.aitips__icon {
  width: var(--sz-tabicon);
  height: var(--sz-tabicon);
  transform: translateY(var(--nudge-icon));
}

.aitips__count {
  margin-left: auto;
  color: var(--c-text-mute);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.aitips__next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-btn-sm);
  height: var(--h-btn-sm);
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text-sub);
  cursor: pointer;
}

.aitips__next:hover {
  background: var(--c-row-hover);
  color: var(--c-brand);
}

.aitips__next svg {
  width: var(--sz-sorticon);
  height: var(--sz-sorticon);
}

/* 入れ替えは、薄くして少し上へ → 文を差し替え → 下から出す */
.aitips__body {
  min-height: calc(var(--fs-sm) * var(--lh-body) * 3);
  transition: opacity var(--dur-tip) ease-in-out, transform var(--dur-tip) ease-in-out;
}

.aitips__body.is-leaving {
  opacity: 0;
  transform: translateY(calc(var(--sp-1) * -1));
}

.aitips__title {
  margin: var(--sp-1) 0 0;
  font-weight: 600;
}

.aitips__text {
  margin: var(--sp-1) 0 0;
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
}

@media (prefers-reduced-motion: reduce) {
  .aitips__body {
    transition: none;
  }
}

.thinking {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-st-ai);
  font-size: var(--fs-sm);
}

.thinking__dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--c-st-ai);
  animation: blink 1.1s infinite;
}

.thinking__dots span:nth-child(2) { animation-delay: 0.18s; }
.thinking__dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

/* --- AI改善提案（survey-admin.js の ai() に合わせる） -------------------- */
.ai-report > .note--ai {
  margin-bottom: var(--sp-4);
}

.ai-report__item {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
}

.ai-report__item:last-child {
  border-bottom: 0;
}

.dtable--ai-actions th:first-child,
.dtable--ai-actions th:last-child {
  width: 120px;
}

.pagehead__inline-form {
  display: inline;
}

/* --- ユーザー選択（回覧モーダル） --------------------------------------- */
.picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: start;
}

/* --- 履歴タイムライン --------------------------------------------------- */

/* --- ラジオグループ（代理入力・取り込み確認） ----------------------------- */
.radiogroup {
  margin-bottom: var(--sp-3);
}

.radiogroup__label {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-1);
}

.radiogroup__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
}

.radioline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.radioline input {
  margin: 0;
}

/* --- 回答一覧・取り込みの内容列 ----------------------------------------- */
.response-answers {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.response-line {
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.response-line__q {
  color: var(--c-text-sub);
}

.response-line__q::after {
  content: "：";
}

.response-line__v {
  font-weight: 600;
}

.response-line__more,
.response-line__empty {
  color: var(--c-text-mute);
  font-size: var(--fs-xs);
}

/* --- 紙取り込み --------------------------------------------------------- */
/* 見出しの右の「写真から読み取る」。ファイルの欄は隠し、ボタンの見た目のラベルで選ぶ */
.intake-pick {
  display: contents;
}

.intake-pick__btn {
  cursor: pointer;
}

.intake-pick__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* 紙の回答の入口の「登録先」。語、選ぶ欄、2 つのボタンを 1 行に並べる（狭い画面では折り返す） */
.intake-target__label {
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.intake-target .select {
  width: auto;
  min-width: var(--w-select-min);
}

@media (min-width: 768px) {
  .intake-target {
    flex-wrap: nowrap;
  }
}

/* 紙の回答の入口。上に登録先、下に写真を置く大きな枠（押しても選べる） */
.intake-drop {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.intake-drop__target {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.intake-drop__target .select {
  width: auto;
  min-width: var(--w-select-min);
}

.intake-drop__zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4);
  border: 2px dashed var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
  text-align: center;
  cursor: pointer;
  transition: background var(--dur-menu) ease-in-out, border-color var(--dur-menu) ease-in-out;
}

.intake-drop__zone:hover,
.intake-drop__zone.is-dragover {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

.intake-drop__icon {
  width: var(--sz-drop-icon);
  height: var(--sz-drop-icon);
  color: var(--c-brand);
}

.intake-drop__text {
  font-weight: 600;
}

.intake-drop__or {
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

.intake-drop__hint {
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
}

/* 一覧の上に写真を持ってきたとき */
[data-intake-table].is-dragover .panel {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

/* 読み取りの途中の束。確認待ちの枠（表は枠いっぱいに敷く）の中に置くので、まわりを空ける。
   文は押せる（紙ごとの状態をモーダルで見る）が、注記の見た目のままにする */
.intake-batches .intake-batch {
  margin: var(--sp-3) var(--sp-4);
}

.intake-batch__open {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.intake-progress-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.intake-progress-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
}

.intake-progress-row__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
}

.intake-progress-row__state {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.intake-progress-row--ok .intake-progress-row__state { color: var(--c-st-ok); }
.intake-progress-row--ng .intake-progress-row__state { color: var(--c-st-ng); }

.intake-review {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  align-items: start;
}

/* --- 組織図（部署ツリー） ------------------------------------------------ */
.orgchart__tree,
.orgchart__children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.orgchart__children {
  margin-top: var(--sp-1);
  padding-left: var(--sp-5);
}

.orgchart__node {
  position: relative;
  padding: var(--sp-1) 0;
}

/* 親から子への折れ線。トランクは兄弟の最後の子で止める（::after を隠す） */
.orgchart__children > .orgchart__node::before,
.orgchart__children > .orgchart__node::after {
  content: "";
  position: absolute;
  left: calc(var(--sp-5) * -1);
  border-left: 1px solid var(--c-border-strong);
}

.orgchart__children > .orgchart__node::before {
  top: 0;
  width: var(--sp-5);
  height: var(--sp-5);
  border-bottom: 1px solid var(--c-border-strong);
}

.orgchart__children > .orgchart__node::after {
  top: var(--sp-5);
  bottom: 0;
}

.orgchart__children > .orgchart__node:last-child::after {
  display: none;
}

.orgchart__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  width: 100%;
  min-height: var(--h-row);
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-depth-0);
}

.orgchart__row--depth-0 { background: var(--c-depth-0); }
.orgchart__row--depth-1 { background: var(--c-depth-1); }
.orgchart__row--depth-2 { background: var(--c-depth-2); }
.orgchart__row--depth-3 { background: var(--c-depth-3); }
.orgchart__row--depth-4 { background: var(--c-depth-4); }

.orgchart__label {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.orgchart__label strong {
  font-size: var(--fs-md);
}

/* 部署名の欄（管理の人だけ。欄ごとの自動保存 §4.24）。読むときの太字の名前と同じ大きさ */
.orgchart__name-form {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
}

.orgchart__name-form .input {
  width: 14em;
  max-width: 100%;
  font-size: var(--fs-md);
  font-weight: 700;
}

.orgchart__parent-form {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
}

.orgchart__parent-form .fieldrow {
  flex-wrap: nowrap;
}

.orgchart__parent-form .fieldrow > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.orgchart__parent-form .select {
  width: auto;
}

@media (min-width: 900px) {
  .intake-review {
    grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr);
  }
}

.intake-review__image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}

/* 表と裏の 2 枚を取り込んだ紙は、2 枚目を下に並べる */
.intake-review__image img + img {
  margin-top: var(--sp-2);
}

.intake-review__image--missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  padding: var(--sp-3);
  border: 1px dashed var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  text-align: center;
}

.intake-review__image--missing::before {
  content: "画像を読み込めません";
}

.intake-thumb {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
}

/* --- 設問編集：タイトル・冒頭文・末尾（greencard 一括変換モーダル風） -- */
.qcard__scale-row {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
}

.survey-edit-save__note {
  margin: var(--sp-3) 0 0;
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.survey-edit-save__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.survey-edit-save__actions .btn,
.survey-edit-save__form .btn {
  width: 100%;
}

.survey-edit-save__form {
  width: 100%;
}

/* 下に止めた保存の帯（設問編集）。左に版の状態、右に下書き保存と反映。
   目立たせるため、ヘッダーと同じ焦茶の地に白い字 */
.formfoot.survey-savebar {
  background: var(--c-header-bg);
  border-top-color: var(--c-header-bg);
  color: var(--c-text-inv);
}

.survey-savebar .survey-edit-save__note,
.survey-savebar .savechip {
  color: var(--c-on-dark-sub);
}

/* 反映のボタンは焦茶の上で沈まないよう、白地に焦茶の字。押せないときは薄く */
/* 反映のボタンは普通の大きさ（下の帯のボタンは既定で大きいので戻す） */
.survey-savebar #survey-activate {
  height: var(--h-btn);
  font-size: var(--fs-md);
  background: var(--c-bg);
  border-color: var(--c-bg);
  color: var(--c-header-bg);
}

.survey-savebar #survey-activate:not(:disabled):hover {
  background: var(--c-brand-pale);
  border-color: var(--c-brand-pale);
}

/* 押せないとき（変更が無いとき）も白地のまま。字は白地の上で読める灰色（5.9:1） */
.survey-savebar #survey-activate:disabled {
  background: var(--c-bg);
  border-color: var(--c-bg);
  color: var(--c-text-sub);
}

.survey-savebar .btn-secondary {
  background: transparent;
  border-color: var(--c-on-dark-stroke);
  color: var(--c-text-inv);
}

.survey-savebar .formfoot__left {
  flex: 1 1 0;
  flex-wrap: wrap;
  align-items: center;   /* 題・版・保存の知らせを上下の中央にそろえる */
  gap: 0 var(--sp-3);
}

.survey-savebar__title {
  font-size: var(--fs-md);
}

.survey-savebar__ver {
  font-size: var(--fs-sm);
  color: var(--c-on-dark-sub);
}

.survey-savebar .survey-edit-save__note {
  flex-basis: 100%;
  margin: var(--sp-1) 0 0;   /* 上の題と版の行と、少し間を空ける */
}

.survey-savebar .survey-edit-save__actions {
  flex-direction: row;
  align-items: center;
  margin-top: 0;
}

.survey-savebar .survey-edit-save__actions .btn,
.survey-savebar .survey-edit-save__form .btn,
.survey-savebar .survey-edit-save__form {
  width: auto;
}

.copy-block {
  margin-bottom: var(--sp-4);
}

.copy-fields {
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.copy-field {
  border-bottom: 1px solid var(--c-border-light);
}

.copy-field:last-child {
  border-bottom: 0;
}

.copy-field--open {
  background: var(--c-row-hover);
}

.copy-field--dirty:not(.copy-field--open) .copy-field__view {
  align-items: start;
}

.copy-field--dirty:not(.copy-field--open) .copy-field__hint {
  display: none;
}

.copy-field--dirty:not(.copy-field--open) .copy-field__val--lg {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: inherit;
}

.copy-inline-diff {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.copy-inline-diff__row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: start;
}

.copy-inline-diff__label {
  padding-top: 0.15rem;
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.copy-inline-diff__text {
  font-size: var(--fs-sm);
  line-height: 1.5;
  word-break: break-word;
}

.copy-field--title.copy-field--dirty .copy-inline-diff__text {
  font-size: var(--fs-md);
  font-weight: 600;
}

.copy-diff-del {
  color: var(--c-st-ng);
  text-decoration: line-through;
  background: var(--c-st-ng-bg);
  border-radius: var(--r-sm);
}

.copy-diff-ins {
  color: var(--c-st-ok);
  background: var(--c-st-ok-bg);
  border-radius: var(--r-sm);
}

/* タイトル・冒頭文・末尾の文言。稟議の入力（.deftable）と同じく、左に灰色の地の項目名、右に中身 */
.copy-field__view,
.copy-field__edit-grid {
  display: grid;
  grid-template-columns: var(--w-deflabel) minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
}

.copy-field__edit-grid {
  grid-template-columns: var(--w-deflabel) minmax(0, 1fr);
}

.copy-field--static .copy-field__view {
  cursor: default;
}

.copy-field__edit {
  display: none;
}

.copy-field--open .copy-field__view {
  display: none !important;
}

.copy-field--open .copy-field__edit {
  display: block;
}

.copy-field__view {
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background var(--dur-tabline) ease-in-out;
}

.copy-field:not(.copy-field--open):not(.copy-field--static) .copy-field__view:hover {
  background: var(--c-row-hover);
}

.copy-field__name {
  display: flex;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-th-bg);
  border-right: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.copy-field__val {
  align-self: center;
  min-width: 0;
  max-width: var(--w-form-max);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-md);
  line-height: 1.6;
  word-break: break-word;
  color: var(--c-text);
}

.copy-field__val--lg {
  font-size: var(--fs-lg);
  font-weight: 600;
}

/* 押せば直せる印。いつも薄く出し、乗せると銅に */
.copy-field__hint {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  color: var(--c-text-mute);
}

.copy-field__pen {
  width: var(--sz-tabicon);
  height: var(--sz-tabicon);
}

.copy-field:not(.copy-field--open):not(.copy-field--static) .copy-field__view:hover .copy-field__hint {
  color: var(--c-brand);
}

.copy-field--static .copy-field__hint {
  display: none;
}

/* 入力欄は、右の列の中で左右に余白を取って広げる（幅 100% にすると余白の分はみ出す） */
.copy-field__edit-grid > .copy-field__input {
  align-self: center;
  width: auto;
  max-width: var(--w-form-max);
  margin: var(--sp-2) var(--sp-4);
}

.intake-review__body {
  min-width: 0;
}

/* --- プレビュー折りたたみ（768px 未満） -------------------------------- */
.survey-edit-preview__toggle {
  display: none;
}

/* --- 稟議フォームの下に止めた操作帯（スマホ） -----------------------------
   縦に積むと画面の 3 分の 1 を覆うので、1 段目に「申請に足りないもの」、
   2 段目にボタンを横に並べる。 */
@media (max-width: 767px) {
  .formfoot.formfoot--sticky {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2);
  }

  .formfoot--sticky .formfoot__left {
    display: contents;
  }

  .formfoot--sticky .formfoot__right {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .formfoot.formfoot--sticky .btn {
    width: auto;
    flex: 0 0 auto;
    font-size: var(--fs-md);
    padding: 0 var(--sp-3);
  }

  .formfoot--sticky .formfoot__right .btn {
    flex: 1 1 0;
  }

  .formfoot--sticky .ringi-missing {
    order: -1;
    flex: 1 0 100%;
    margin: 0;
    padding: 0;
    border-left: 0;
    font-size: var(--fs-xs);
  }

  /* 合計と「合っていません」を 2 行に分け、語の途中で折り返さない */
  .ringi-lines__diff {
    display: block;
    margin-left: 0;
  }

  .formfoot--sticky .formfoot__top {
    order: -2;
  }

  /* 設問編集の保存と反映の帯も --h-actionbar の 2 段に収める
     （1 段目に版の状態を小さく、2 段目にボタン。見出しと一言は出さない） */
  .survey-savebar .survey-savebar__title,
  .survey-savebar .survey-edit-save__note {
    display: none;
  }

  .survey-savebar .survey-savebar__ver {
    order: -1;
    flex: 0 0 auto;
    font-size: var(--fs-xs);
    white-space: nowrap;
  }

  .survey-savebar .formfoot__right {
    flex: 1 0 100%;
  }

  .survey-savebar .survey-edit-save__form {
    display: flex;
    flex: 1 1 0;
  }

  .survey-savebar .survey-edit-save__form .btn {
    flex: 1 1 0;
  }
}

/* --- アンケート（一覧・集計・入口。DESIGN.md 4.18） ---------------------- */
/* 点の帯の色。minibar の色を上書きする（85 以上・70 以上・70 未満） */
.scorebar--hi .minibar__fill  { background: var(--c-score-hi); }
.scorebar--mid .minibar__fill { background: var(--c-score-mid); }
.scorebar--low .minibar__fill { background: var(--c-score-low); }

.survey-table__kind {
  font-weight: 600;
  white-space: nowrap;
}

/* 列の少ない一覧なので、数字の列も見出しと一緒に左へそろえる（桁の幅は .num のまま） */
.survey-table .num {
  text-align: left;
}

.scorecell {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.scorecell__num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 3em;
  text-align: right;
}

.scorecell .minibar {
  width: var(--w-scorebar);
  min-width: var(--w-scorebar);
}

.survey-table__ops {
  white-space: nowrap;
  width: 1%;
}

.survey-table__ops .btn + .btn {
  margin-left: var(--sp-1);
}

/* 種別は、狭い画面ではタイトルの上に出す（広い画面では列） */
.survey-table__narrow {
  display: none;
}

/* 集計の点の棒。設問の文は折り返し、棒は残りの幅いっぱい、右に点と n */
.scorebars {
  display: grid;
  grid-template-columns: minmax(8em, var(--w-scorelabel)) minmax(0, 1fr) auto;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
}

.scorebars__row {
  display: contents;
}

.scorebars__label {
  font-size: var(--fs-sm);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.scorebars__bar {
  height: var(--h-scorebar);
}

.scorebars__value {
  font-size: var(--fs-sm);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.scorebars__value b {
  font-size: var(--fs-md);
}

.scorebars__n {
  margin-left: var(--sp-2);
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
}

.scorebars__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-sub);
}

.scorebars__swatch {
  display: inline-block;
  width: var(--sp-3);
  height: var(--sp-3);
  margin-right: var(--sp-1);
  vertical-align: -1px;
  border-radius: var(--r-sm);
}

.scorebars__swatch--hi  { background: var(--c-score-hi); }
.scorebars__swatch--mid { background: var(--c-score-mid); }
.scorebars__swatch--low { background: var(--c-score-low); }

/* アンケートの表は十数行なので、枠の中でスクロールさせず、ページで流す */
.survey-table__wrap {
  max-height: none;
}

/* 手で入力の操作。DOM は「次の 1 枚」（主）が先（Enter で押される）。見た目は主を右に */
.survey-proxy .formfoot__right {
  flex-direction: row-reverse;
}

/* 手で入力の 1 問。左に Q 番号、右に見出しと答えの欄（理由の欄もここ） */
.manual-q {
  display: grid;
  grid-template-columns: var(--w-manual-qno) minmax(0, 1fr);
  align-items: start;
}

.manual-q + .manual-q {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
}

.manual-q__no {
  display: inline-block;   /* 答えが入ったときに弾ませる（transform） */
  color: var(--c-brand-dark);
  font-family: var(--ff-num);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: var(--lh-body);
  transition: color var(--dur-press) ease-in-out;
}

.manual-q__body > .fieldrow {
  margin-bottom: 0;
}

.manual-q__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-body);
}

.manual-q__req {
  color: var(--c-st-ng);
  font-size: var(--fs-xs);
}

/* 欄の部品が出す見出しは、読み上げ用に残して画面では隠す（見出しは .manual-q__head） */
.manual-q__body > .fieldrow:nth-child(2) > label:first-child,
.manual-q__body > .fieldrow:nth-child(2) > .radiogroup__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* 選ぶ設問はボタンの形にする（押しやすく、選んだものが一目で分かる）。
   選んだものは焦茶の地に白い字。「選ばない」「未回答」も同じ並びの最初に置く */
.manual-q .radiogroup__options {
  gap: var(--sp-2);
}

.manual-q .radioline {
  position: relative;
  min-height: var(--h-btn);
  padding: 0 var(--sp-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-bg);
  cursor: pointer;
  /* お客様の画面と同じ押した感。押している間は少し縮み、選ぶと地と枠と字の色がすっと変わる */
  transition: transform var(--dur-press) ease-in-out, background var(--dur-press) ease-in-out,
    border-color var(--dur-press) ease-in-out, color var(--dur-press) ease-in-out;
}

.manual-q .radioline:active {
  transform: scale(0.97);
}

/* 選んだあと、一瞬ふくらんで戻る（app.js の wireManualMotion が .is-pop をかけ直す） */
.manual-q .radioline.is-pop {
  animation: manual-pop var(--dur-pop) ease-in-out;
}

@keyframes manual-pop {
  0% { transform: scale(0.97); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* 答えのある設問は Q 番号を緑に。答えが入った瞬間にぽんと弾む */
.manual-q.is-answered .manual-q__no {
  color: var(--c-st-ok);
}

.manual-q.is-answer-pop .manual-q__no {
  animation: manual-answer-pop var(--dur-pop) ease-in-out;
}

@keyframes manual-answer-pop {
  0%, 100% { transform: none; }
  50% { transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
  .manual-q .radioline,
  .manual-q .radioline.is-pop,
  .manual-q.is-answer-pop .manual-q__no {
    animation: none;
    transition: none;
  }
}

.manual-q .radioline:hover {
  border-color: var(--c-brand);
}

.manual-q .radioline input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.manual-q .radioline:has(input:checked) {
  background: var(--c-brand-dark);
  border-color: var(--c-brand-dark);
  color: var(--c-text-inv);
}

/* 「選ばない」「未回答」（値が空）は、選んでいても目立たせない */
.manual-q .radioline:has(input[value=""]:checked) {
  background: var(--c-bg-sub);
  border-color: var(--c-border-strong);
  color: var(--c-text-sub);
}

/* 送れなかった必須の設問 */
.manual-q.is-invalid .manual-q__label,
.manual-q.is-invalid .manual-q__no {
  color: var(--c-st-ng);
}

/* 赤くするのは答えの欄だけ（任意の理由の欄は赤くしない） */
.manual-q.is-invalid .manual-q__body > .fieldrow:nth-child(2) .radioline,
.manual-q.is-invalid .manual-q__body > .fieldrow:nth-child(2) .input,
.manual-q.is-invalid .manual-q__body > .fieldrow:nth-child(2) .textarea {
  border-color: var(--c-st-ng);
}

.manual-q__body > .fieldrow + .fieldrow {
  margin-top: var(--sp-2);
}

/* 操作の帯は欄の下の帯にする。最後の設問とは間を空け、欄の左右と下の端まで広げる */
.survey-proxy .panel__body > .formfoot:last-child {
  margin: var(--sp-5) calc(var(--sp-3) * -1) calc(var(--sp-3) * -1);
  border-radius: 0 0 var(--r-md-inner) var(--r-md-inner);
}

.intake-all-table__summary {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  min-width: 16em;
}

.intake-all-table__ops {
  white-space: nowrap;
}

.intake-all-table__ops {
  width: 1%;
}

/* 新しいアンケートの欄。一覧の下に、中身の幅で 1 行に置く */
.survey-create {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  max-width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
}

.survey-create__title {
  font-weight: 600;
  font-size: var(--fs-sm);
}

.survey-create__field {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

@media (max-width: 767px) {
  /* 狭い画面では設問の文を棒の上の行に */
  .scorebars {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: var(--sp-1);
  }
  .scorebars__label {
    grid-column: 1 / -1;
    margin-top: var(--sp-2);
  }
  /* 一覧は、種別・最後の回答・補助の操作を畳み、横に送らずに読める幅にする */
  .survey-table .survey-table__wide {
    display: none;
  }
  .survey-table__narrow {
    display: block;
    font-weight: 600;
  }
  /* 狭い画面では主（次の 1 枚）を上に縦に積む */
  .survey-proxy .formfoot__right {
    flex-direction: column;
  }
  .survey-table .scorecell .minibar {
    display: none;
  }
  .survey-create,
  .survey-create__field {
    display: flex;
  }
  .survey-create__field {
    flex-wrap: wrap;
    width: 100%;
  }
}

/* --- 4.25 変更履歴 `.changelog` ----------------------------------------
   画面のいちばん下に、たたんだ 1 行（上に細い線、題・最新の日時と人・「く」の字）。開くと、地のまま
   （箱・表にしない）、左に細い縦線と小さな丸を付けた時刻順の流れ。1 件は「日時・誰が・何を・対象」の
   1 行と、その下に変わった欄 */
.changelog {
  margin-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
}

.changelog__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  cursor: pointer;
  list-style: none;
}
.changelog__head::-webkit-details-marker { display: none; }
.changelog__head:hover,
.changelog[open] > .changelog__head { color: var(--c-text); }
.changelog__title { font-weight: 700; }
/* 4 倍の画面で墨の上下の真ん中を測ってそろえた（小さい字は 0.6px 上、「く」の字は 0.5px 下に出ていた） */
.changelog__latest { position: relative; top: 1px; font-size: var(--fs-xs); color: var(--c-text-mute); font-family: var(--ff-num); }
.changelog__head .ringi-fold__chev { margin-left: calc(var(--sp-3) * -1 + 4px); top: -1px; }   /* 題のすぐ右に寄せる */
.changelog[open] > .changelog__head .ringi-fold__chev { transform: rotate(180deg); }

.changelog__body { padding: 0 0 var(--sp-4); }
.changelog__help { margin: 0 0 var(--sp-3); font-size: var(--fs-xs); color: var(--c-text-mute); }
.changelog__empty { margin: 0; font-size: var(--fs-sm); color: var(--c-text-mute); }

.changelog__list {
  margin: 0 0 0 3px;
  padding: 0 0 0 var(--sp-4);
  list-style: none;
  border-left: 1px solid var(--c-border);
}

.changelog__item { position: relative; padding: 0 0 var(--sp-4); font-size: var(--fs-sm); line-height: 1.5; }
.changelog__item:last-child { padding-bottom: var(--sp-1); }

/* 縦線の上の小さな丸。1 行目の字の上下の真ん中に置く（行の高さ 1.5 の半分から、丸の半径を引く） */
.changelog__item::before {
  content: "";
  position: absolute;
  top: calc(0.75em - 3.5px);
  left: calc(var(--sp-4) * -1 - 4px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-border-strong);
}
.changelog__item:first-child::before { background: var(--c-brand); }

.changelog__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--sp-3);
}
.changelog__at { color: var(--c-text-sub); font-family: var(--ff-num); white-space: nowrap; }
.changelog__actor { color: var(--c-text-sub); overflow-wrap: anywhere; }
.changelog__action { font-weight: 700; }
.changelog__target { min-width: 0; overflow-wrap: anywhere; }

/* 変わった欄は折り返す（長い値で横に広げない。ADR 0039） */
.changelog__diff {
  margin-top: 2px;
  overflow-wrap: anywhere;
  word-break: normal;
}

.changelog__change + .changelog__change { margin-top: 2px; }

.changelog__field,
.changelog__from { color: var(--c-text-sub); }

.changelog__arrow { color: var(--c-text-mute); }

/* 変えて元に戻した（まとめた件の changes が空）。消さずに薄く出す */
.changelog__item.is-reverted,
.changelog__item.is-reverted .changelog__action { color: var(--c-text-mute); font-weight: 400; }

.changelog__foot { padding-top: var(--sp-1); }
.changelog__foot:not(:has(.btn)) { display: none; }

/* --- レスポンシブ（768px 未満） --------------------------------------- */
/* 稟議のやり取り（詳細画面。DESIGN 4.28）。出来事とコメントの時系列 + 投稿欄 */
/* やり取りは部品の中の最初の見出しなので、.sectionhead:first-child で上の間隔が消える。前の節（添付ファイル・回覧）と
   同じだけ空ける */
.ringi-talk > .sectionhead:first-child {
  margin-top: var(--sp-5);
}

.ringi-talk__list {
  list-style: none;
  margin: 0 0 0 7px; /* 点（12px）の半分が線の左へ出る分 */
  padding: 0 0 0 var(--sp-4);
  border-left: 2px solid var(--c-border-light);
}
.ringi-talk__item { position: relative; padding: var(--sp-2) 0 var(--sp-3); min-width: 0; }
.ringi-talk__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-4) - 7px);
  top: calc(var(--sp-2) + 4px);
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--c-bg);
  background: var(--c-border-strong);
}
.ringi-talk__item--comment::before { background: var(--c-brand); }
.ringi-talk__item.is-ok::before { background: var(--c-st-ok); }
.ringi-talk__item.is-ng::before { background: var(--c-st-ng); }
.ringi-talk__item.is-progress::before { background: var(--c-st-progress); }
.ringi-talk__item.is-none::before { background: var(--c-st-none); }
.ringi-talk__head { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: baseline; }
.ringi-talk__when { color: var(--c-text-sub); font-size: var(--fs-sm); white-space: nowrap; }
.ringi-talk__who { font-weight: bold; }
.ringi-talk__event { font-weight: bold; }
.ringi-talk__item.is-ok .ringi-talk__event { color: var(--c-st-ok); }
.ringi-talk__item.is-ng .ringi-talk__event { color: var(--c-st-ng); }
.ringi-talk__item.is-progress .ringi-talk__event { color: var(--c-st-progress); }
/* 本文は改行をそのまま出す（エスケープ済み）。長い語も枠からはみ出させない */
.ringi-talk__body {
  margin: var(--sp-1) 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ringi-talk__item--comment > .ringi-talk__body {
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-sub);
  border-radius: var(--r-sm);
}
.ringi-talk__changes { margin: var(--sp-1) 0 0; padding-left: var(--sp-3); overflow-wrap: anywhere; }
.ringi-talk__revs { margin-top: var(--sp-1); font-size: var(--fs-sm); }
.ringi-talk__revs > summary { cursor: pointer; color: var(--c-text-sub); width: fit-content; }
.ringi-talk__revlist { list-style: none; margin: var(--sp-1) 0 0; padding-left: var(--sp-3); border-left: 1px dashed var(--c-border); }
.ringi-talk__revlist > li + li { margin-top: var(--sp-2); }
.ringi-talk__revlist .ringi-talk__body { color: var(--c-text-sub); }
.ringi-talk__edit { margin-top: var(--sp-1); }
.ringi-talk__editbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.ringi-talk [hidden] { display: none; }
.ringi-talk__remain, .ringi-talk__hint { font-size: var(--fs-xs); color: var(--c-text-sub); }
.ringi-talk__empty { color: var(--c-text-sub); font-size: var(--fs-sm); margin: 0; }
.ringi-talk__form { margin-top: var(--sp-2); min-width: 0; }
.ringi-talk__form .textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.ringi-talk__post { margin-top: var(--sp-3); }
.ringi-talk__label { display: block; font-weight: bold; margin-bottom: var(--sp-1); }
.ringi-talk__error { margin: var(--sp-1) 0 0; color: var(--c-st-ng); font-size: var(--fs-sm); }
.ringi-talk__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--sp-2);
}
.ringi-talk__actions .ringi-talk__hint { margin-right: auto; }

/* やり取りの役割（起案者・承認者・回覧・管理）。状態ではないので状態色を使わない */
.rolechip {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
  white-space: nowrap;
}

/* --- 決裁のあとの実行（未実行・まとめ・実行の入力。GLIQ-57、DESIGN.md 4.30） --- */
.exec-setting {
  margin-top: var(--sp-3);
}

.exec-filter {
  margin-top: var(--sp-3);
}

.exec-table__subject {
  min-width: 12em;
}

/* 狭い画面だけに出す補足（部署は件名の下へ） */
.exec-table__narrow {
  display: none;
}

/* 期日の一言の色。間近は下書きの橙（文字は濃い版）、超過・遅れは赤 */
.exec-due--warn {
  color: var(--c-st-draft-ink);
  font-weight: 600;
}

.exec-due--ng {
  color: var(--c-st-ng);
  font-weight: 600;
}

/* 期日を使わない設定で、決裁から 30 日を超えた未実行の印 */
.exec-stale {
  display: block;
  margin-top: var(--sp-hair);
  color: var(--c-st-draft-ink);
  font-size: var(--fs-xs);
}

.exec-entry__yen {
  font-variant-numeric: tabular-nums;
}

.exec-entry__memo {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 実行の入力は、幅を絞って左右の真ん中に（ぱんくずと見出しは左のまま）。表の形にしない */
.exec-entry {
  max-width: var(--w-read);
  margin-inline: auto;
}

.exec-entry .exec-facts {
  margin: var(--sp-3) 0 var(--sp-4);
}

.exec-entry .ringi-facts__label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.exec-entry__reason .note {
  margin: 0 0 var(--sp-3);
}

/* 入れる欄は、名札の上に欄を縦に積む。要点の帯との間に 1 本線 */
.exec-form {
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border-light);
}

.exec-form .fieldrow--stack + .fieldrow--stack {
  margin-top: var(--sp-3);
}

/* 紙の上では、欄のあいだは点線（.panel--paper）。線の上の空きを足さない */
.panel--paper .exec-form {
  padding-top: 0;
}

.panel--paper .exec-form .fieldrow--stack + .fieldrow--stack {
  margin-top: 0;
}

.exec-form__yen {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.exec-form .fieldrow--stack > .textarea {
  max-width: 100%;
}

.exec-form .ro-fieldset[disabled] .input,
.exec-form .ro-fieldset[disabled] .textarea {
  background: var(--c-bg-sub);
}

.exec-form__error {
  margin-top: var(--sp-3);
}

.exec-form .formactions {
  align-items: center;
  margin-top: var(--sp-3);
}

/* 要点の帯のすぐ下に 1 行で: 名札・選ぶ欄（中身の幅）・指名する */
.exec-nominate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: calc(var(--sp-2) * -1) 0 var(--sp-4);
}

.exec-nominate label { font-size: var(--fs-sm); color: var(--c-text-sub); }
.exec-nominate .select {
  width: auto;
  min-width: var(--w-select-min);
}

.exec-nominate .note {
  flex-basis: 100%;
  margin: 0;
}

.exec-history {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}

.exec-history li {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--c-border-light);
}

.exec-history li:last-child {
  border-bottom: 0;
}

.exec-history__when {
  color: var(--c-text-sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.exec-history__note {
  flex-basis: 100%;
  color: var(--c-text-sub);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  /* 館内マップ: 3D の描き先を低くし、地図の中の階の列を小さくする（3D は狭い画面でも出す）。
     本体の定義はこの節より後ろなので、.fmap を前に付けて勝たせる */
  .fmap .fmap__3d {
    height: var(--h-map-3d-narrow);
  }

  .fmap .fmap-floors {
    width: var(--w-map-floors-narrow);
  }

  .fmap .fmap-floors__item {
    height: var(--h-map-floor-narrow);
    font-size: var(--fs-xs);
  }

  /* 未実行の一覧（GLIQ-57）: 狭い画面では部署・経過・操作の列を畳む（部署は件名の下へ） */
  .exec-table__wide {
    display: none;
  }

  .exec-table__narrow {
    display: inline;
  }

  .exec-table__subject {
    min-width: 8em;
  }

  /* 組織図: 部署の名前と人の並びを幅いっぱいにし、並べ替えと親部署の欄はその下 */
  .orgchart__row .orgchart__label:has(.orgchart__people) {
    flex-basis: 100%;
    order: -1;
  }

  .grid--2,
  .grid--3,
  .grid--sidebar-right {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tabs__item {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .filterbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filterbar__fields {
    flex-direction: column;
    align-items: stretch;
  }

  .filterbar__actions {
    justify-content: stretch;
  }

  .filterbar__actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  /* 1 行の帯も縦に積み、欄は幅いっぱい（本体の .filterbar--inline より強く） */
  .filterbar.filterbar--inline,
  .filterbar.filterbar--inline .filterbar__fields {
    align-items: stretch;
  }

  .filterbar.filterbar--inline .input,
  .filterbar.filterbar--inline .select {
    width: 100%;
    max-width: 100%;
  }

  /* 稟議フォームなどの deftable が、390px で横にはみ出さないようにする（ADR 0039） */
  .deftable th {
    width: 7.5em;
    white-space: normal;
  }

  /* タイトル・冒頭文・末尾の文言も、項目名の列を稟議の入力と同じ幅に詰める */
  .copy-field__view {
    grid-template-columns: 7.5em minmax(0, 1fr) auto;
  }

  .copy-field__edit-grid {
    grid-template-columns: 7.5em minmax(0, 1fr);
  }

  .copy-field__name,
  .copy-field__val {
    padding: var(--sp-2) var(--sp-3);
  }

  .deftable td .fieldrow,
  .deftable td .filterbar__fields {
    flex-wrap: wrap;
  }

  /* iOS は 16px 未満の入力欄にフォーカスすると、画面を拡大する */
  .input,
  .select,
  .textarea {
    font-size: var(--fs-input-mobile);
    min-height: var(--h-input-touch);
  }

  /* 選ぶ欄（Tom Select）は .select が外枠に付くので、押しやすい高さは中の箱に付ける（外枠だけ高いと、
     箱が外枠の上に寄り、表のセルでは上の罫線にくっつく） */
  .ts-wrapper.select {
    min-height: 0;
  }

  /* 本体の .ts-wrapper.single .ts-control（後ろに書く）より強くする */
  .ts-wrapper.select.single .ts-control {
    min-height: var(--h-input-touch);
  }

  /* 表の中の選ぶ欄は、広い画面と同じ高さでセルの上下の真ん中に置く（行を高くしない） */
  .gridedit td > .ts-wrapper.select.single .ts-control {
    min-height: var(--h-input);
  }

  .formfoot {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .formfoot .btn {
    width: 100%;
    min-height: 44px;
  }

  .formfoot__left {
    margin-right: 0;
    flex-direction: column;
    width: 100%;
  }

  .modal {
    padding: var(--sp-3);
  }

  .modal__box,
  .modal__box--wide,
  .modal__box--md,
  .modal__box--frame {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .modal__foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal__foot .btn {
    width: 100%;
    min-height: 44px;
  }

  /* 画面幅いっぱいに出す。.toastwrap の本体の定義より後ろ（このファイル）に
     置かないと、layout.css の方は読み込み順で負ける。 */
  .toastwrap {
    right: var(--sp-3);
    left: var(--sp-3);
    bottom: calc(var(--h-actionbar) + var(--sp-2));
    align-items: stretch;
  }

  /* 稟議のやり取り（§4.28） */
  .ringi-talk__list { padding-left: var(--sp-3); }
  .ringi-talk__item::before { left: calc(-1 * var(--sp-3) - 7px); }
  /* 投稿ボタンはタップしやすく、幅いっぱい */
  .ringi-talk__post .ringi-talk__actions .btn { width: 100%; min-height: 44px; }
  .ringi-talk__actions .ringi-talk__hint { margin-right: 0; width: 100%; }
  .ringi-talk__form .textarea { font-size: var(--fs-input-mobile); }

  .toast {
    min-width: 0;
    width: 100%;
  }

  .panel__head {
    flex-wrap: wrap;
  }

  .panel__actions {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .deftable {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 編集できる表は列をつぶさず、枠の中で横に送る */
  .gridedit {
    width: max-content;
    min-width: 100%;
  }

  .qcard__summary,
  .qlist--table .qcard__summary {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
  }

  .qlist__head,
  .qcard__cell {
    display: none;
  }

  .qlist--table .qcard__list-ops {
    flex-basis: auto;
  }

  .survey-savebar .survey-edit-save__note {
    display: none;
  }

  .copy-field__edit-grid {
    grid-template-columns: 1fr;
  }

  .copy-field__edit-grid .copy-field__name {
    padding-top: 0;
  }

  .survey-edit-preview {
    position: static;
  }

  .survey-edit-preview__toggle {
    display: flex;
    width: 100%;
    min-height: 44px;
    margin-bottom: var(--sp-3);
  }

  .survey-edit-preview:not(.is-preview-open) .panel {
    display: none;
  }

  .survey-edit-save__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .survey-edit-save__actions .btn,
  .survey-edit-save__form .btn {
    width: 100%;
    min-height: 44px;
  }

  .pagehead__inline-form {
    width: 100%;
  }

  .pagehead__inline-form .btn {
    width: 100%;
    min-height: 44px;
  }
}

/* 表の 1 つのセルに ↑ ↓ を横に並べる */

.fieldrow--stack + .fieldrow--stack { margin-top: var(--sp-3); }

/* KPI タイルの行。下のパネルとの間に余白を持つ */
.kpirow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--w-kpi-min), 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

/* 入力欄の下の、主アクションの行。主アクションは右下（DESIGN §0-5） */
.formactions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

/* --- 4.19 編集できる表（Excel のような入力）.gridedit ----------------------
   罫線だけの密な表。セルの入力欄は枠を消してセルいっぱいに置き、ホバーで細い線、
   フォーカスでブランド色の輪郭を出す。変えたセルと行には、未保存（下書き）の印。 */
.gridedit {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  background: var(--c-bg);
  font-variant-numeric: tabular-nums;
}

.gridedit th {
  height: var(--h-grid-row);
  padding: 0 var(--sp-2);
  background: var(--c-th-bg);
  border: 1px solid var(--c-border);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.gridedit td {
  height: var(--h-grid-row);
  padding: 0;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  vertical-align: middle;
}

.gridedit th.num,
.gridedit td.num {
  text-align: right;
}

.gridedit td > .input,
.gridedit td > .select {
  display: block;
  width: 100%;
  max-width: none;
  height: var(--h-grid-row);
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px transparent;
  font-size: var(--fs-sm);
}

.gridedit td > .input:hover,
.gridedit td > .select:hover {
  box-shadow: inset 0 0 0 1px var(--c-border-strong);
}

.gridedit td > .input:focus,
.gridedit td > .select:focus {
  background: var(--c-bg);
}

.gridedit td.num > .input {
  text-align: right;
}

.gridedit td > .input::placeholder {
  color: var(--c-text-mute);
}

/* 読むだけのセル（状態、いま当たる人など） */
.gridedit td.is-ro {
  padding: 0 var(--sp-2);
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
  white-space: nowrap;
}

/* 操作のセル（使わない / 使う など）。ボタンは横に並べる */
.gridedit td.gridedit__ops {
  padding: 0 var(--sp-1);
  white-space: nowrap;
  text-align: right;
}

.gridedit td.gridedit__ops form {
  display: inline;
}

.gridedit tbody tr:hover > td:not(.is-ro) {
  background: var(--c-row-hover);
}

/* 行頭のセル: 行の番号と ↑↓ の小さなアイコンの組 */
.gridedit .gridedit__rowhead {
  width: 1%;
  padding: 0 var(--sp-1);
  background: var(--c-th-bg);
  color: var(--c-text-sub);
  text-align: center;
  white-space: nowrap;
}

/* 変えたセル・行（未保存）。未保存は下書きの意味なので --c-st-draft を使う（§4.13） */
.gridedit td.is-changed,
.gridedit tbody tr:hover > td.is-changed {
  background: var(--c-st-draft-bg);
}

.gridedit tr.is-dirty > .gridedit__rowhead {
  background: var(--c-st-draft-bg);
}

/* 選ぶ欄（Tom Select）は枠のある箱のままなので、罫線に触れないよう左右にも少し空ける */
.gridedit td:has(> .ts-wrapper) {
  padding: 0 var(--sp-1);
}

/* 外側の枠には上の .gridedit td > .select（行の高さ）が写るので、中の箱の高さに戻す（箱を上に寄せない）。
   Tom Select は中の箱に z-index: 1 を付けるので、枠の中で閉じ、止めた見出しの上に出さない */
.gridedit td > .ts-wrapper.select {
  height: auto;
  box-shadow: none;
  isolation: isolate;
}

/* 使わない行は薄く */
.gridedit tr.is-inactive td > .input,
.gridedit tr.is-inactive td > .select {
  color: var(--c-text-mute);
}

/* 表の最後の、追加の行 */
.gridedit tr.gridedit__new > td {
  background: var(--c-bg-sub);
}

.gridedit tr.gridedit__new > .gridedit__rowhead {
  color: var(--c-brand);
  font-weight: 600;
}

.gridedit__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-sm);
}

.gridedit__count {
  margin-right: auto;
  color: var(--c-text-sub);
}

.gridedit__count.is-dirty {
  color: var(--c-st-draft);
  font-weight: 600;
}

/* ↑↓ をまとめた小さなアイコンの組（行頭・優先の列） */
.iconmove {
  display: inline-flex;
  vertical-align: middle;
}

.iconmove form {
  display: inline;
}

.iconmove .iconmove__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--h-btn-sm);
  height: var(--h-btn-sm);
  padding: 0;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  line-height: 1;
  cursor: pointer;
}

/* ↑ ↓ × は文字（読み上げと、HTML を見るテスト用に残す）を隠し、太い線のアイコンで描く。
   文字のままだと細くて見えにくい。色は currentColor（押せないときは薄い） */
.iconmove .iconmove__btn:is([title="上へ"], [title="下へ"], .qcard__del) {
  font-size: 0;
}

.iconmove .iconmove__btn:is([title="上へ"], [title="下へ"], .qcard__del)::before {
  content: "";
  width: var(--sz-moveicon);
  height: var(--sz-moveicon);
  background-color: currentColor;
  -webkit-mask: var(--icon-sort-asc) center / contain no-repeat;
  mask: var(--icon-sort-asc) center / contain no-repeat;
}

.iconmove .iconmove__btn[title="下へ"]::before {
  -webkit-mask-image: var(--icon-sort-desc);
  mask-image: var(--icon-sort-desc);
}

.iconmove .iconmove__btn.qcard__del::before {
  -webkit-mask-image: var(--icon-close);
  mask-image: var(--icon-close);
}

.iconmove form + form .iconmove__btn {
  border-left: 0;
}

.iconmove form:first-child .iconmove__btn {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.iconmove form:last-child .iconmove__btn {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.iconmove .iconmove__btn:hover:not(:disabled) {
  border-color: var(--c-brand);
  color: var(--c-brand);
  background: var(--c-brand-pale);
}

.iconmove .iconmove__btn:disabled {
  color: var(--c-border);
  cursor: default;
}

/* 編集できる表の列の幅（中身の種類ごと） */
.gridedit th.w-code { width: 7rem; }
.gridedit th.w-select { width: 10rem; }
.gridedit th.w-state { width: 6rem; }
/* 代表品目は長い文になるので、費目名より広く取る */
.gridedit th.w-hint { min-width: 22rem; }
/* 代表品目に押されて、費目名が読めなくならないようにする */
.gridedit th.w-name { min-width: 11rem; }
.gridedit th.w-ops { width: 5rem; }
.gridedit th.w-wide { width: 16rem; }
/* 長い名前から選ぶ欄。中身の長さで列が広がらないように、幅を決めて、あふれた分は省く */
.gridedit th.w-pick { width: 13rem; max-width: 13rem; }
.gridedit th.w-pick ~ th.w-dest { width: 9rem; }
.gridedit td:has(> .select[data-field="budget_account_key"]) { max-width: 13rem; }
.gridedit td > .select[data-field="budget_account_key"] { text-overflow: ellipsis; }

/* 枠の中でスクロールする編集できる表は、見出しを止める */
.dtable__scroll > .gridedit thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-top-width: 1px;
}

/* 罫線を重ねる表（collapse）を枠の中でスクロールさせると、見出しの上の罫線の分から下の行の字が透け、
   外側の罫線の半分が枠の外にはみ出して切れる（一番下の線が消える）。.dtable--sticky と同じく、
   罫線をセルに持たせて右と下だけに引く（左端と上端は別に足す） */
.dtable__scroll > :is(.dtable, .gridedit) {
  border-collapse: separate;
  border-spacing: 0;
}

.dtable__scroll > :is(.dtable, .gridedit) :is(th, td) {
  border-width: 0 1px 1px 0;
}

.dtable__scroll > :is(.dtable, .gridedit) tr > :first-child {
  border-left-width: 1px;
}

.dtable__scroll > .dtable thead th {
  border-top-width: 1px;
}

/* 役割の表: 当てる先のセルに部署と職員の両方を置き、割り当ての種類に合う欄だけを出す。
   :has() が効かないブラウザでは両方出る（送る値は BFF が種類に合わせて選ぶ）。 */
.gridedit td.assign-target > .assign-none {
  display: none;
  padding: 0 var(--sp-2);
  color: var(--c-text-mute);
}

.gridedit tr:has(.assign-type option[value="department_top"]:checked) td.assign-target > .assign-staff,
.gridedit tr:has(.assign-type option[value="staff"]:checked) td.assign-target > .assign-dept,
.gridedit tr:has(.assign-type option[value="unassigned"]:checked) td.assign-target > .select {
  display: none;
}

.gridedit tr:has(.assign-type option[value="unassigned"]:checked) td.assign-target > .assign-none {
  display: block;
}

/* --- 4.20 決裁ルートの条件と段のチップ ------------------------------------- */
.chipline,
.stepchain {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
}

/* 条件（稟議、500,000 円以上、至急 …）。状態ではないので、状態色を使わない */
.condchip {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-hair) var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
  font-size: var(--fs-xs);
  color: var(--c-text);
  white-space: nowrap;
}

.condchip--all {
  border-style: dashed;
  background: var(--c-bg);
  color: var(--c-text-mute);
}

/* 文書種別なし（稟議と購入伺いの両方に使う）。書式のタブの両方に出る */
.condchip--both {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
  font-weight: 600;
}

/* 段（番号付き）。役割の段は銅の淡い地、見つからない役割は赤 */
.stepchip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-hair) var(--sp-2) var(--sp-hair) var(--sp-hair);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-bg);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.stepchip__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(var(--fs-xs) * 1.6);
  height: calc(var(--fs-xs) * 1.6);
  border-radius: var(--r-sm);
  background: var(--c-th-bg);
  color: var(--c-text-sub);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stepchip--role {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

.stepchip--missing {
  border-color: var(--c-st-ng);
  color: var(--c-st-ng);
}

.stepchain__arrow {
  color: var(--c-text-mute);
  font-size: var(--fs-xs);
}

/* 専決の段の印「◆専決（10万円未満）」。段の種類（役割・組織）の色は変えず、太字の墨で添える */
.stepchip__final {
  margin-left: var(--sp-1);
  color: var(--c-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}

.stepchip--final {
  border-width: 2px;
}

/* 付け替えのときだけ使う（特殊）ルートの書式のチップ */
.condchip--special {
  border-style: dashed;
  border-color: var(--c-border-strong);
}

/* チップの見方（一覧の下）。1 つずつ行を分け、チップと説明を 2 列にそろえる（横に流すと、どの説明がどのチップのものか
   読みにくい）。見出しは付けない（チップの見本と説明で見方だとわかる） */
.routelegend {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  justify-items: start;
  gap: var(--sp-2) var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.routelegend__item {
  display: contents;
}

.routelegend__item .stepchip__final {
  margin-left: 0;
}

/* 編集の画面の専決の欄 */
.routesteps__final {
  min-width: 13em;
}

/* 専決のセルは、チェックと金額の欄を積むので、罫線に触れないよう内側を空ける */
.gridedit td.routesteps__final {
  padding: var(--sp-2);
}

.routesteps__limit {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-1);
}

.routeedit__selection {
  margin-top: var(--sp-3);
}

/* 決裁ルートの一覧 */
.routelist td {
  vertical-align: middle;
}

.routelist__prio {
  width: 1%;
  white-space: nowrap;
}

.routelist .prio {
  display: inline-block;
  min-width: 1.5em;
  margin-right: var(--sp-1);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.routelist__name {
  min-width: 8em;
  font-weight: 600;
}

.routelist__name a {
  color: var(--c-text);
  text-decoration: none;
}

.routelist tr:hover .routelist__name a {
  color: var(--c-brand);
}

/* 行の操作。ボタンを縦に積まず、横に並べる */
.rowops {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.rowops > form {
  display: inline;
}

/* 使わない行は、文字を薄く */
.dtable tr.is-inactive > td {
  color: var(--c-text-mute);
}

.dtable tr.is-inactive .routelist__name a {
  color: var(--c-text-mute);
}

/* 左に補助（チェックなど）、右に主アクション */
.formactions--between {
  justify-content: space-between;
  align-items: center;
}

.route-preview > .note:first-child {
  margin-top: var(--sp-3);
}

/* 「試す」の飛ばす段・専決なら不要の段は薄く */
.route-preview tr.is-muted > td {
  color: var(--c-text-mute);
}

.route-preview__note {
  font-size: var(--fs-xs);
}

.route-preview__issues {
  margin: var(--sp-2) 0 0;
  padding-left: var(--sp-4);
  font-size: var(--fs-sm);
}

/* 決裁ルートの編集。1280px 以上は右に「試す」の列を置く */
.routeedit--with-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

@media (min-width: 1280px) {
  .routeedit--with-side {
    grid-template-columns: minmax(0, 1fr) var(--w-detailside);
  }
}

/* 段: 種類に合わない欄（辿る上限・役割）を隠す。:has() が効かないブラウザでは両方出る */
.routesteps tr:not(:has(.step-type option[value="climb"]:checked)) td.step-until,
.routesteps tr:not(:has(.step-type option[value="role"]:checked)) td.step-role {
  background: var(--c-bg-sub);
}

.routesteps tr:not(:has(.step-type option[value="climb"]:checked)) td.step-until > .select,
.routesteps tr:not(:has(.step-type option[value="role"]:checked)) td.step-role > .select {
  visibility: hidden;
}

.gridedit__note {
  margin: 0;
  padding: 0 var(--sp-3) var(--sp-2);
}

/* --- 見た目の刷新 PR 7: 残りの画面 ------------------------------------------ */

/* 1 行の絞り込みの帯（DESIGN.md 4.5）。条件を横に並べ、操作は右端に続ける。
   稟議一覧の .ringi-filter と同じ形の共通版 */
.filterbar--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
}

.filterbar--inline .filterbar__fields {
  flex: 0 1 auto;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
}

.filterbar--inline .filterbar__field > label {
  font-weight: 600;
}

/* 1 行の帯では、見出しを欄の上ではなく左に置く（見出しと欄で 2 段にしない。2026-11-03）。
   fieldrow--stack で描いた欄（select_field(..., stack=True)）も同じ形にする */
.filterbar--inline .filterbar__field,
.filterbar--inline .filterbar__field > .fieldrow--stack {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}

/* 幅の決まっていない打つ欄は、見出しの横で折り返さない幅にする */
.filterbar--inline .filterbar__field .input:not([class*="input--"]) { width: 16em; }

.filterbar--inline .filterbar__field > label,
.filterbar--inline .filterbar__field > .fieldrow--stack > label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-sub);
  white-space: nowrap;
}

.filterbar--inline .filterbar__actions {
  flex: 0 0 auto;
  align-items: center;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* 組織表: 部署を見出しの行にした 1 つの表（DESIGN.md 4.21） */
.orgtable td.orgtable__move,
.orgtable th.orgtable__move {
  width: 1%;
  white-space: nowrap;
}

.dtable tbody tr.orgtable__dept > td {
  background: var(--c-bg-sub);
  border-top: 1px solid var(--c-border-strong);
}

.orgtable__deptname {
  font-weight: 600;
}

.orgtable__count {
  margin-left: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

/* 組織図: 1 部署 1 行に詰める */
.orgchart__meta {
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.orgchart__children > .orgchart__node::before {
  height: calc(var(--sp-1) + var(--h-row) / 2);
}

.orgchart__children > .orgchart__node::after {
  top: calc(var(--sp-1) + var(--h-row) / 2);
}

/* 組織表の編集: 中身の幅（全幅にしない） */
.orgedit {
  max-width: var(--w-form-max);
}

/* 一時パスワード: 読み違えない大きさ */
.staff-secret {
  max-width: var(--w-form-max);
  margin-bottom: var(--sp-3);
}

.staff-secret__pw {
  font-size: var(--fs-lg);
  letter-spacing: 0.05em;
}

/* 回答一覧・取り込み: 日付と経路は折り返さず、設問の見出しは幅を止めて折り返す */
.response-table__date,
.response-table__src {
  white-space: nowrap;
}

.dtable thead th.response-table__q {
  min-width: 7em;
  max-width: var(--w-table-q);
  white-space: normal;
}

/* 回答一覧・取り込みの見出しは、折り返した列があっても全部の列を上下の中央にそろえる */
.response-table thead th,
.intake-table thead th {
  vertical-align: middle;
}

/* 設問が多い表は、列をつぶさずに枠の中で横に送る（ページははみ出さない）。
   自由記述は --w-table-text で折り返す */
.dtable.response-table,
.dtable.intake-table {
  width: max-content;
  min-width: 100%;
}

.response-table td,
.intake-table td {
  max-width: var(--w-table-text);
}

/* 回答詳細の設問の見出しは 1 行。列の幅は答えで決め、見出しはその幅いっぱいまで出す（足りなければ …。
   押すと全文。.qpop）。
   - .response-table__qlabel::before: 見えない同じ文字。--w-table-q-line までは列を見出しのために広げる
   - .response-table__qtext: 幅 0 から列の幅いっぱいに伸ばす（列の幅を押し広げない）
   - 並べ替えの矢印は th::after をやめ、.response-table__qhead::after で文字の右に残す */
.dtable.response-table thead th.response-table__q {
  min-width: 0;
  max-width: none;
  white-space: nowrap;
}

.dtable.response-table thead th.response-table__q::after {
  content: none;
}

.response-table__qhead {
  display: flex;
  align-items: center;
}

.response-table__qhead::after {
  content: "";
  flex: none;
  width: var(--sz-sorticon);
  height: var(--sz-sorticon);
  margin-left: var(--sp-1);
  background-color: var(--c-text-sub);
  -webkit-mask: var(--icon-sort) center / contain no-repeat;
  mask: var(--icon-sort) center / contain no-repeat;
}

.response-table__q.is-asc .response-table__qhead::after,
.response-table__q.is-desc .response-table__qhead::after {
  background-color: var(--c-brand);
}

.response-table__q.is-asc .response-table__qhead::after {
  -webkit-mask-image: var(--icon-sort-asc);
  mask-image: var(--icon-sort-asc);
}

.response-table__q.is-desc .response-table__qhead::after {
  -webkit-mask-image: var(--icon-sort-desc);
  mask-image: var(--icon-sort-desc);
}

.response-table__qlabel {
  flex: 1 1 auto;
  min-width: 0;
}

.response-table__qlabel::before {
  content: attr(data-short);
  display: block;
  max-width: var(--w-table-q-line);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  white-space: nowrap;
}

.response-table__qtext {
  display: block;
  width: 0;
  min-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 設問の見出しを押したときの全文と並べ替え（response-table.js が body に置く） */
.qpop {
  position: fixed;
  z-index: var(--z-dropdown);
  width: max-content;
  max-width: var(--w-helptip);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm);
}

.qpop__title {
  margin: 0 0 var(--sp-2);
  font-weight: 600;
  line-height: var(--lh-body);
  white-space: normal;
  overflow-wrap: anywhere;
}

.qpop__sort {
  display: flex;
  gap: var(--sp-1);
}

/* 回答詳細の操作: ピン留めと、集計から外す・戻すを横に並べる */
.response-table__ops {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  white-space: nowrap;
}

/* 回答詳細の欄の見出し、件数の右の ◀ ▶（response-table.js。表を 1 画面分ずつ横に送る）。
   .iconmove の組を、押しやすいよう小ボタンの高さで。送れない表では出さない */
.response-hscroll[hidden] {
  display: none;
}

.iconmove.response-hscroll .iconmove__btn {
  width: var(--h-btn-sm);
  height: var(--h-btn-sm);
}

/* ピン留めしている行のボタンは、ピンのアイコンを塗る */
.response-pin[aria-pressed="true"] svg {
  fill: currentColor;
}

/* ピン留めの枠（response-table.js が行を移す）。ピンが無ければ出さない */
.response-pins[hidden],
.response-pins .dtable__scroll[hidden],
.response-pins__hidden[hidden] {
  display: none;
}

/* 枠の見出しは写しなので押せない。並べ替えの矢印も出さない */
.response-pins .response-table__qhead::after {
  content: none;
}

.response-pins__hidden {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

/* 回答詳細の列の入れ替え（response-table.js）: 設問の見出しはつかんで動かせる。
   動かしている列は薄く、落とす位置は見出しの左か右に銅の線 */
.response-table thead th[draggable="true"] {
  cursor: grab;
}

.response-table thead th.is-dragging {
  opacity: 0.5;
}

.response-table thead th.is-drop-before {
  box-shadow: inset var(--bw-accent) 0 0 var(--c-brand);
}

.response-table thead th.is-drop-after {
  box-shadow: inset calc(-1 * var(--bw-accent)) 0 0 var(--c-brand);
}

/* 答えの横のテーマは、同じ行に続ける（行を高くしない） */
.response-table .chips {
  display: inline-flex;
  vertical-align: middle;
}

/* 稟議設定（DESIGN.md 4.23）: パネルは 1 列に積み、下の変更履歴と右端をそろえる（2 列にすると左右の
   下端がずれ、欄の説明も狭く折れる）。チェックは用途で分けた組に */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.settings-grid > .panel {
  margin-bottom: 0;
}

.settings-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
}

.checkgroup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) 0;
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--c-border-light);
}

.checkgroup:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.checkgroup__title {
  flex-basis: 100%;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text-sub);
}

.checkgroup + .note {
  margin-top: var(--sp-3);
}

.settings-grid .formgrid {
  align-items: start;
}

/* --- 4.24 自動保存と保存の知らせ .savechip ------------------------------
   成功は toast にしない。見出し・帯の小さな知らせと、欄・行の短い緑の地で伝える。
   状態は autosave.js が付ける（is-saving / is-saved / is-quiet / is-error / is-hint）。 */
.savechip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  max-width: 100%;
  white-space: normal;
  font-size: var(--fs-xs);
  line-height: var(--lh-table);
  color: var(--c-text-sub);
  transition: color var(--dur-save-flash) ease-out;
}

.savechip[hidden] {
  display: none;
}

.savechip.is-saving {
  color: var(--c-text-sub);
}

.savechip.is-saved {
  color: var(--c-st-ok);
  font-weight: 600;
}

/* 約 2 秒で薄くする（保存済みのまま、目立たせない） */
.savechip.is-quiet {
  color: var(--c-text-mute);
  font-weight: 400;
}

.savechip.is-error {
  color: var(--c-st-ng);
  font-weight: 600;
}

.savechip.is-hint {
  color: var(--c-text-sub);
  font-weight: 400;
}

.savechip__time {
  font-family: var(--ff-num);
  font-weight: 400;
}

/* 見出しの右（操作のボタンの左）。操作が無ければ右端 */
.pagehead .savechip {
  margin-left: auto;
  max-width: var(--w-savechip-max);
}

.pagehead .savechip:not([hidden]) + .pagehead__actions {
  margin-left: 0;
}

/* 画面の下の帯（formfoot）では、ボタンの左 */
.formfoot .savechip {
  max-width: var(--w-savechip-max);
}

/* 保存できた欄・行: 緑の地を --dur-save-flash で消す */
.is-save-flash {
  background: var(--c-save-flash);
}

.is-save-fade {
  transition: background-color var(--dur-save-flash) ease-out;
}

/* 保存できなかった欄・行: 赤い地と左の線（直すか、再試行するまで残す） */
.is-save-error {
  background: var(--c-save-error);
}

.gridedit tr.is-save-flash > td,
.gridedit tr.is-save-flash > td.is-ro {
  background: var(--c-save-flash);
}

.gridedit tr.is-save-fade > td {
  transition: background-color var(--dur-save-flash) ease-out;
}

/* 保存できた行は、行頭に小さな ✓（次に直すまで） */
.gridedit tr.is-saved > .gridedit__rowhead {
  position: relative;
}

.gridedit tr.is-saved > .gridedit__rowhead::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: var(--sp-hair);
  transform: translateY(-50%);
  color: var(--c-st-ok);
  font-size: var(--fs-xs);
}

.gridedit tr.is-save-error > .gridedit__rowhead {
  background: var(--c-save-error);
}

.gridedit tr.is-save-error > td.is-changed {
  background: var(--c-save-error);
}

/* 行のすぐ下の一言（誤りと「再試行」、追加の行の案内） */
.gridedit tr.gridedit__msg > td {
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-save-error);
  color: var(--c-st-ng);
  font-size: var(--fs-xs);
  white-space: normal;
}

.gridedit tr.gridedit__msg.is-hint > td {
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
}

.gridedit tr.gridedit__msg .btn {
  margin-left: var(--sp-2);
}

/* --- 4.26 業務ごとの段階のチップ `.permchip` ------------------------------
   段階は状態ではないので、状態色を使わず銅の濃さで段を上げる（なし→閲覧→運用→管理）。
   1 字のチップ（ア・稟・マ・職・経）は title と aria-label で業務と段階を言う。 */
.permchips {
  display: inline-flex;
  gap: var(--sp-hair);
  vertical-align: middle;
}

.permchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--w-permchip);
  padding: 0 var(--sp-1);
  border: 1px solid;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.permchip--none    { color: var(--c-level-none);    background: var(--c-level-none-bg);    border-color: var(--c-level-none-border); border-style: dashed; font-weight: 400; }
.permchip--view    { color: var(--c-level-view);    background: var(--c-level-view-bg);    border-color: var(--c-level-view-border); }
.permchip--operate { color: var(--c-level-operate); background: var(--c-level-operate-bg); border-color: var(--c-level-operate-border); }
.permchip--manage  { color: var(--c-level-manage);  background: var(--c-level-manage-bg);  border-color: var(--c-level-manage-border); }

/* 凡例。表の上に 1 行で、業務の 1 字と段階の色を並べる */
.permlegend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

/* 欄の見出しの右に置いたとき。見出しの太字と下の線を引き継がない */
.panel__head .permlegend {
  justify-content: flex-end;
  padding: 0;
  border-bottom: 0;
  font-weight: 400;
}

.permlegend__group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
}

.permlegend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

/* 承認者に当たるのに稟議の運用が無い人の注意（警告なので --c-st-ng） */
.permwarn {
  color: var(--c-st-ng);
  font-weight: 600;
}

.permwarn__note {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-st-ng);
}

/* 組織表の決裁権限レベルのセル: レベルの横に稟議の段階 */
.orgtable__level {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
}

/* 組織図の所属の人（1 部署の行の下に、名前・レベル・チップを横に流す） */
/* 人の並びは部署名の下の行に（ラベルの中で幅いっぱい）。ラベルは親部署の欄の左の残りに縮む */
.orgchart__label:has(.orgchart__people) {
  flex-basis: 0;
}

.orgchart__people {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  margin: 0;
  padding: var(--sp-1) 0 0;
  list-style: none;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.orgchart__person {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
}

.orgchart__person.is-warn {
  color: var(--c-st-ng);
}

/* 職員の権限の欄（編集のモーダル）。雛形の選択と、業務ごとの段階の選択 */
/* 職員の設定のモーダル。権限・メールアドレス・パスワード・アカウントを細い線で区切り、それぞれの
   見出しの下に操作を置く。1 行の操作（.staffedit__line）は、説明や欄を左、ボタンを右に */
.staffedit__sec + .staffedit__sec {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border-light);
}

.staffedit__title {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.staffedit__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.staffedit__line {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.staffedit__line + .staffedit__line {
  margin-top: var(--sp-2);
}

.staffedit__line > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.staffedit__line > .btn {
  flex: none;
}

/* スタッフの一覧のメール。長いアドレスは折り返し、狭い幅で表をはみ出させない (GLIQ-558) */
.staff-table__email {
  overflow-wrap: anywhere;
}

/* 4 業務の選択は 2 列（モーダルの幅でも縦に長くしない） */
/* 権限の欄: 上に雛形（まとめて入れる近道）と一言、下に業務ごとの権限（実際の値）を薄い地の枠にまとめ、
   業務名と選ぶ欄を 2 列の表のようにそろえる（雛形と業務ごとの欄を同じ格子に混ぜない） */
.permedit__preset {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
}

.permedit__preset .fieldrow--stack {
  margin: 0;
}

.permedit__hint {
  flex: 1 1 14rem;
  margin: 0;
  padding-bottom: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.permedit__areas {
  display: grid;
  grid-template-columns: max-content minmax(0, max-content);
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
}

.permedit__areas-title {
  grid-column: 1 / -1;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-text-sub);
}

/* 業務名と選ぶ欄を、枠の格子の 2 列にそのまま置く */
.permedit__areas > .fieldrow {
  display: contents;
}

.permedit__areas > .fieldrow > label {
  font-size: var(--fs-sm);
  color: var(--c-text);
}

/* 閲覧だけの人の画面。欄を止めた fieldset は見た目を持たない */
.ro-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ro-fieldset:disabled .gridedit__new {
  display: none;
}

/* --- 見出しの横の説明（?） ---------------------------------------------- */
/* ホバーか押したときに、下に吹き出しを出す。見出しの字と同じ高さにそろえる */
.helptip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* 欄の見出しの中では、見出しの字のすぐ右に置く（見出しの項目の間の gap を打ち消す） */
.panel__head > .helptip {
  margin-left: calc(var(--sp-3) * -1 + var(--sp-1));
}

.helptip__btn {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-text-mute);
  cursor: help;
}

/* 欄の並べ替えのつまみ（panel-order.js）。見出しの ? のすぐ右に、? と同じ大きさ・色で置く */
.panel__head > .panelgrip {
  margin-left: calc(var(--sp-3) * -1 + var(--sp-1));
}

.panelgrip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text-mute);
  cursor: grab;
  touch-action: none;   /* 指でつかんで動かすとき、画面を送らない */
  transition: color var(--dur-menu) ease-in-out, background var(--dur-menu) ease-in-out;
}

.panelgrip svg {
  width: var(--sz-helptip);
  height: var(--sz-helptip);
  fill: currentColor;
  transform: translateY(var(--nudge-icon));
}

.panelgrip:hover,
.panelgrip:focus-visible {
  color: var(--c-brand-dark);
  background: var(--c-row-hover);
}

/* 並べ替えのまとまり。入れ替わる欄はなめらかに動き、つかんだ欄は浮かせる */
.panel-stack > .panel {
  transition: transform var(--dur-slide) ease-in-out, box-shadow var(--dur-slide) ease-in-out;
}

.panel-stack > .panel.is-grabbed {
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-pop);
}

.is-panel-dragging,
.is-panel-dragging .panelgrip {
  cursor: grabbing;
  user-select: none;
}

.panel-order-reset {
  display: block;
  margin: calc(var(--sp-2) * -1) 0 var(--sp-4) auto;
  padding: var(--sp-1) var(--sp-2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-brand);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.panel-order-reset:hover {
  background: var(--c-brand-pale);
}

.panel-order-reset[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .panel-stack > .panel {
    transition: none;
  }
}

.helptip__btn svg {
  width: var(--sz-helptip);
  height: var(--sz-helptip);
  transform: translateY(var(--nudge-icon));
}

/* 見出しの横の ? は、見出しの字の箱と上下中央でそろう（flex の align-items: center）。字の中の行に置くときの
   持ち上げ（--nudge-icon）をそのまま足すと上にずれるので、見出しでは字の見た目の真ん中に合う分だけにする
   （2x で字と ? の墨の上下の真ん中を測ってそろえた） */
.panel__head > .helptip .helptip__btn svg {
  transform: translateY(calc(var(--nudge-icon) * 0.7));
}

.sectionhead > .helptip .helptip__btn svg {
  transform: none;
}

.helptip__btn:hover {
  color: var(--c-brand-dark);
}

/* 閉じている間は display: none。見えなくても置いてあると、右の列では画面の右へはみ出して
   横スクロールが出る。開いたときに右端を越える分は、app.js が --helptip-shift で左へずらす */
.helptip__bubble {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: calc(var(--sp-2) * -1);
  translate: var(--helptip-shift, 0) 0;
  z-index: var(--z-dropdown);
  display: none;
  width: max-content;
  max-width: var(--w-helptip);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-text);
  color: var(--c-text-inv);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: var(--lh-body);
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--dur-menu) ease-in-out,
    visibility var(--dur-menu) ease-in-out,
    display var(--dur-menu) allow-discrete;
}

.helptip:hover .helptip__bubble,
.helptip__btn:focus + .helptip__bubble {
  display: block;
  opacity: 1;
  visibility: visible;
}

@starting-style {
  .helptip:hover .helptip__bubble,
  .helptip__btn:focus + .helptip__bubble {
    opacity: 0;
  }
}

/* --- 回答詳細の評価のセル ------------------------------------------------- */
/* ★と点を 1 行で。低い評価は★と点を赤にする。理由の答えは下に小さく */
.ratecell {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-1);
  white-space: nowrap;
}

.ratecell__stars {
  color: var(--c-star);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
}

.ratecell__off {
  color: var(--c-border);
}

.ratecell__num {
  font-family: var(--ff-num);
  font-weight: 700;
}

.ratecell--low .ratecell__stars,
.ratecell--low .ratecell__num {
  color: var(--c-st-ng);
}

.ratecell__reason {
  display: block;
  margin-top: var(--sp-1);
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  white-space: normal;
}

/* --- 日付の暦（Air Datepicker。datepicker.js。DESIGN.md 4.12） ------------------------------
   ライブラリの色・角・文字をトークンに合わせる。選んだ日は銅の地に白、今日は銅の字、
   曜日の見出しは日曜を赤、土曜を青に。前後の月の日は薄く */
.air-datepicker {
  --adp-font-family: var(--ff-base);
  --adp-font-size: var(--fs-md);
  --adp-width: var(--w-datepicker);
  --adp-z-index: var(--z-datepicker);
  --adp-padding: var(--sp-2);
  --adp-border-radius: var(--r-md);
  --adp-border-color: var(--c-border);
  --adp-border-color-inner: var(--c-border-light);
  --adp-background-color: var(--c-bg);
  --adp-background-color-hover: var(--c-row-hover);
  --adp-background-color-active: var(--c-brand-pale);
  --adp-accent-color: var(--c-brand);
  --adp-color: var(--c-text);
  --adp-color-secondary: var(--c-text-sub);
  --adp-color-current-date: var(--c-brand);
  --adp-color-other-month: var(--c-border);
  --adp-color-other-month-hover: var(--c-text-mute);
  --adp-color-disabled: var(--c-border);
  --adp-day-name-color: var(--c-text-sub);
  --adp-cell-border-radius: var(--r-sm);
  --adp-cell-background-color-hover: var(--c-row-hover);
  --adp-cell-background-color-selected: var(--c-brand);
  --adp-cell-background-color-selected-hover: var(--c-brand-dark);
  --adp-btn-color: var(--c-brand);
  --adp-btn-color-hover: var(--c-brand-dark);
  --adp-btn-background-color-hover: var(--c-brand-pale);
  --adp-btn-border-radius: var(--r-sm);
  --adp-nav-arrow-color: var(--c-text-sub);
  --adp-transition-ease: ease-in-out;
  box-shadow: var(--shadow-pop);
}

/* ライブラリは暦を body の直下の入れ物に置き、隠れている暦もページの下のほうに残す。職員の画面は
   .main だけがスクロールするので、そのままだとページ全体が伸びて 2 本目のスクロールバーと空白が出る。
   入れ物を画面に固定し、ページの高さに数えない（ページはスクロールしないので、暦の位置は変わらない）。
   公開アンケートはページごとスクロールするので、こうしない */
.air-datepicker-global-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

.air-datepicker-overlay {
  --adp-overlay-z-index: calc(var(--z-datepicker) - 1);
  --adp-overlay-transition-ease: ease-in-out;
}

/* 見出しの年月は太く。前後の月へは線の山形 */
.air-datepicker-nav--title {
  font-weight: 600;
  color: var(--c-text);
}

.air-datepicker-nav--title i {
  color: var(--c-text-sub);
}

.air-datepicker-nav--action svg {
  width: var(--sz-date-icon);
  height: var(--sz-date-icon);
  fill: none;
}

.air-datepicker-nav--action path {
  fill: none;
  stroke: currentColor;
}

/* 曜日の見出し。日曜は赤、土曜は青（日本の暦の見慣れた色。並びは日〜土） */
.air-datepicker-body--day-name {
  font-weight: 600;
  text-transform: none;
}

.air-datepicker-body--day-name:nth-child(1) {
  color: var(--c-st-ng);
}

.air-datepicker-body--day-name:nth-child(7) {
  color: var(--c-date-sat);
}

.air-datepicker-cell.-day-.-current- {
  font-weight: 700;
}

.air-datepicker-cell.-selected-,
.air-datepicker-cell.-selected-.-current- {
  color: var(--c-text-inv);
  font-weight: 700;
}

.air-datepicker-button {
  font-weight: 600;
}

/* 暦を出す欄。右に暦のアイコン（ブラウザの暦と同じ位置） */
input.td-date {
  padding-right: calc(var(--sz-date-icon) + var(--sp-2) * 2);
  background-image: var(--icon-calendar);
  background-repeat: no-repeat;
  background-position: right var(--sp-2) center;
  background-size: var(--sz-date-icon) var(--sz-date-icon);
  cursor: pointer;
}

/* 日付の欄と、横の「今日」「昨日」のボタン（datepicker.js が包む） */
.td-date-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;   /* 今日・昨日はいつも欄の右どなり */
  gap: var(--sp-2);
  max-width: 100%;
  vertical-align: middle;
}

/* 日付の欄は決まった幅（画面ごとの .input--date や行いっぱいの幅より優先） */
.td-date-wrap > input.td-date {
  flex: none;
  width: var(--w-date);
  max-width: none;
}

.td-date-quick {
  flex: none;
}

.td-date-quick {
  display: inline-flex;
  gap: var(--sp-1);
}

.td-date-chip {
  display: inline-flex;
  align-items: center;
  height: var(--h-btn-sm);
  padding: 0 var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--h-btn-sm);
  background: var(--c-bg);
  color: var(--c-text-sub);
  font-family: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-menu, 160ms) ease-in-out, color var(--dur-menu, 160ms) ease-in-out,
    border-color var(--dur-menu, 160ms) ease-in-out;
}

.td-date-chip:hover:not(:disabled) {
  border-color: var(--c-brand);
  color: var(--c-brand);
  background: var(--c-brand-pale);
}

.td-date-chip.is-on {
  border-color: var(--c-brand);
  background: var(--c-brand);
  color: var(--c-text-inv);
}

.td-date-chip:disabled {
  color: var(--c-border);
  cursor: default;
}

/* 後日は、日が入っていて今日でないときだけ出す（datepicker.js が hidden を付け外す） */
.td-date-chip[hidden] {
  display: none;
}

/* --- 選ぶ欄（Tom Select。select.js。DESIGN.md 4.10） ----------------------------------------
   外側の枠（.ts-wrapper）には元の select の class（.select / .select--auto など）が写るので、幅だけを
   受け、枠線・高さ・余白は中の .ts-control に付ける（二重の枠にしない）。右に山形、開くと向きが逆。
   選択肢の窓は body に置き、枠・影・角を合わせて、上から少し滑って出る */
.ts-wrapper.select {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  /* Tom Select は右の余白を !important で決めるので、その変数で山形の分を空ける（語と山形を重ねない） */
  --ts-pr-min: calc(var(--sp-2) * 2 + var(--sz-moveicon));
  --ts-pr-caret: calc(var(--sp-hair) * 0);
  --ts-pr-clear-button: calc(var(--sp-hair) * 0);
}

/* 中身の幅の欄（.select--auto）は、選んでいる語と右の山形が重ならない広さにする */
.ts-wrapper.select--auto {
  width: max-content;
  max-width: 100%;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control {
  display: flex;
  align-items: center;
  min-height: var(--h-input);
  padding: 0 calc(var(--sp-2) + var(--sz-moveicon) + var(--sp-1)) 0 var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  box-shadow: none;
  color: var(--c-text);
  font-size: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color var(--dur-menu) ease-in-out;
}

.ts-wrapper.single .ts-control::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--sp-2);
  width: var(--sz-moveicon);
  height: var(--sz-moveicon);
  margin: 0;
  border: 0;
  background-color: var(--c-text-sub);
  -webkit-mask: var(--icon-chevron-down) center / contain no-repeat;
  mask: var(--icon-chevron-down) center / contain no-repeat;
  transform: translateY(-50%);
  transition: transform var(--dur-dropdown) ease-in-out;
}

.ts-wrapper.single.dropdown-active .ts-control::after {
  transform: translateY(-50%) rotate(180deg);
}

.ts-wrapper.single .ts-control:hover,
.ts-wrapper.dropdown-active .ts-control {
  border-color: var(--c-brand);
}

.ts-wrapper.disabled .ts-control {
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
  cursor: default;
  opacity: 1;
}

.ts-wrapper .ts-control > .item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 絞り込める欄（選択肢が多い）は、開いたら打てる */
.ts-wrapper.td-select--search .ts-control > input {
  min-width: 4em;
  font-size: inherit;
}

/* 窓の幅は、選ぶ欄と同じにそろえず、いちばん長い選択肢が 1 行に入る広さにする（欄より狭くはしない。
   min-width は select.js が開くたびに欄の幅を入れる）。Tom Select が入れる幅は上書きする */
.ts-dropdown {
  position: fixed;   /* 画面を基準に欄の真下へ（select.js が置き直す） */
  z-index: var(--z-select);
  width: max-content !important;
  max-width: min(var(--w-select-drop-max), calc(100vw - var(--sp-5) * 2));
  margin-top: 0;   /* 欄とのすき間は select.js が位置に入れる */
  padding: var(--sp-1) 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  box-shadow: var(--shadow-pop);
  color: var(--c-text);
  font-size: var(--fs-md);
  /* 出るたびに（display が none から戻るたびに）上から少し滑り、ふわっと出る */
  transform-origin: top center;
  animation: ts-dropdown-in var(--dur-dropdown) ease-in-out;
}

/* 上に開いたときは、下から少し滑って出る */
.ts-dropdown.is-above {
  transform-origin: bottom center;
  animation-name: ts-dropdown-in-above;
}

@keyframes ts-dropdown-in-above {
  from {
    opacity: 0;
    transform: translateY(var(--sp-2)) scaleY(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ts-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(calc(var(--sp-2) * -1)) scaleY(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ts-dropdown .ts-dropdown-content {
  max-height: 18rem;
}

/* 選択肢の字は、選ぶ欄の字と左をそろえる（どちらも 1px の枠の内側に --sp-2） */
.ts-dropdown .option,
.ts-dropdown .no-results {
  position: relative;
  padding: var(--sp-2) calc(var(--sp-2) * 2 + var(--sz-moveicon)) var(--sp-2) var(--sp-2);
  line-height: 1.4;
  white-space: nowrap;
}

.ts-dropdown .no-results {
  color: var(--c-text-mute);
}

.ts-dropdown .option.active {
  background: var(--c-row-hover);
  color: var(--c-text);
}

/* 選んでいる選択肢は銅の字と右のチェック */
.ts-dropdown .option.selected {
  color: var(--c-brand-dark);
  font-weight: 600;
}

.ts-dropdown .option.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--sp-2);
  width: var(--sz-moveicon);
  height: var(--sz-moveicon);
  background-color: var(--c-brand);
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
  transform: translateY(-50%);
}

/* 絞り込み中に一致した字 */
.ts-dropdown .highlight {
  background: var(--c-brand-pale);
  border-radius: var(--sp-hair);
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .ts-dropdown {
    animation: none;
  }

  .ts-wrapper.single .ts-control::after {
    transition: none;
  }
}


/* --- まとめて決裁（ringi-swipe.js。DESIGN.md 4.7） --------------------------------------------
   主役は稟議書の紙 1 枚。後ろの 2 枚は紙の縁だけを見せる。向きは、紙の下の 3 つの丸で示す */
/* 見え方の切り替えは、画面見出しの右のボタンの並びに置く */
.ringi-modes { flex: none; }

.swipe {
  --w-swipe: 520px;
  --h-swipe-card: 392px;
  max-width: var(--w-swipe);
  margin: var(--sp-2) auto 0;
  display: grid;
  gap: var(--sp-4);
}

.swipe [hidden] { display: none; }

/* 残りの件数は、紙を指す吹き出し。数が減るたびに、数字がぽんと弾む */
.swipe__count {
  position: relative;
  justify-self: center;
  margin: 0;
  padding: 2px var(--sp-4);
  border-radius: 999px;
  background: var(--c-brand);
  color: var(--c-text-inv);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.7;
  transform-origin: 50% 100%;
  animation: swipe-count-pop var(--dur-pop) var(--ease-check) both;
}

.swipe__count b {
  display: inline-block;
  margin: 0 2px;
  font-size: var(--fs-lg);
  font-variant-numeric: tabular-nums;
}

.swipe__count::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  translate: -50% -1px;
  border: 6px solid transparent;
  border-top-color: var(--c-brand);
  border-bottom: 0;
}

/* 丸と説明は、書類が積み重なってから、左から順にぽんと出る */
.swipe.is-arriving .swipe__actions, .swipe.is-arriving .swipe__guide { visibility: hidden; }
.swipe.is-arrived .swipe__act { animation: swipe-act-in 380ms var(--ease-check) both; }
.swipe.is-arrived .swipe__act--later { animation-delay: 70ms; }
.swipe.is-arrived .swipe__act--ok { animation-delay: 140ms; }
.swipe.is-arrived .swipe__guide { animation: swipe-back 360ms ease-out 260ms both; }
@keyframes swipe-act-in {
  0%   { opacity: 0; transform: translateY(14px) scale(.7); }
  100% { transform: none; }   /* 終わりの濃さは指定しない（否決できないときの薄さを残す） */
}

/* 開いたときの登場（ringi-swipe.js の enter）。奥の紙から順に、上から落ちて積み重なる。
   重なりのずれ（translate / scale）とは別の transform で動かすので、積んだ位置はそのまま */
.swipe-card.is-entering { animation: swipe-card-enter 460ms cubic-bezier(.3, 1.35, .5, 1) var(--enter-delay, 0ms) both; }
@keyframes swipe-card-enter {
  0%   { opacity: 0; transform: translateY(-90px) rotate(-5deg); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

.swipe__count.is-pop { animation: none; }
.swipe__count.is-pop b { animation: swipe-count-pop var(--dur-pop) var(--ease-check) both; }

@keyframes swipe-count-pop {
  0%   { transform: scale(.6); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.swipe__stage { display: grid; gap: var(--sp-5); }

/* 紙の束。下に 2 枚分の縁が出るだけの余白を取る */
.swipe__deck { position: relative; height: calc(var(--h-swipe-card) + var(--pile-step) * 11); --pile-step: 4px; }

.swipe-card {
  position: absolute;
  inset: 0 0 auto;
  height: var(--h-swipe-card);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  overflow: hidden;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  touch-action: none;   /* 上（あとで）にも払うので、縦のスクロールにも指を渡さない */
  user-select: none;
  transform-origin: 50% 120%;
  transition: transform var(--dur-slide) var(--ease-map), opacity var(--dur-slide) ease-in-out,
    translate var(--dur-slide) var(--ease-map), scale var(--dur-slide) var(--ease-map);
  /* 山: 下の紙ほど少し下にずれて、少し小さい。残りの件数と同じ枚数を積む（12 枚まで） */
  translate: 0 calc(var(--depth, 0) * var(--pile-step));
  scale: calc(1 - var(--depth, 0) * 0.012);
}
.swipe-card--blank { pointer-events: none; }

/* 後ろの紙は、縁だけ（中身は見せない） */
.swipe-card:not(.is-top) { pointer-events: none; background: var(--c-bg); }   /* 重なる紙も上の紙と同じ白 */
.swipe-card:not(.is-top) > * { visibility: hidden; }
.swipe-card.is-top { cursor: grab; }
.swipe-card.is-dragging { cursor: grabbing; transition: none; }
.swipe-card.is-flying { transition-duration: 320ms; opacity: 0; }
.swipe-card.is-hinting { transition-duration: 420ms; }

/* 払っている向きに出る印（紙の右上・左上）。地の色は変えない */
.swipe-card__seal {
  position: absolute;
  top: var(--sp-4);
  padding: 0 var(--sp-2);
  border: 3px solid currentColor;
  border-radius: var(--r-sm);
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.5;
  pointer-events: none;
}

.swipe-card__seal--ok { right: var(--sp-4); color: var(--c-stamp-ok); opacity: var(--ok, 0); rotate: 10deg; }
.swipe-card__seal--ng { left: var(--sp-4); color: var(--c-stamp-ng); opacity: var(--ng, 0); rotate: -10deg; }

.swipe-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.swipe-card__subject { flex-basis: 100%; margin: 0; font-size: var(--fs-xl); font-weight: 700; line-height: 1.45; }
.swipe-card__yen { margin: 0; color: var(--c-text-sub); line-height: 1.1; }
.swipe-card__yen b { font-size: var(--fs-3xl); color: var(--c-text); font-variant-numeric: tabular-nums; margin-right: 2px; }
.swipe-card__deal { margin: 0; display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); font-size: var(--fs-sm); }
.swipe-card__key { margin-right: var(--sp-2); color: var(--c-text-mute); font-size: var(--fs-xs); }
.swipe-card__who { margin: 0; font-size: var(--fs-xs); color: var(--c-text-mute); }

/* 読むところ（要約か起案理由）。上に細い線を 1 本引いて、帯の情報と分ける */
.swipe-card__summary,
.swipe-card__reason {
  margin: 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

.swipe-card__summary .swipe-card__key,
.swipe-card__reason .swipe-card__key { display: block; margin: 0 0 2px; white-space: normal; }
.swipe-card__summary:empty { display: none; }
.swipe-card.has-summary .swipe-card__reason { display: none; }

.swipe-card__points { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.swipe-card__points .fusen__tag { margin-right: var(--sp-1); }
.swipe-card__error { margin: 0; color: var(--c-st-ng); font-size: var(--fs-sm); }

/* 紙の下端に「詳細を開く」（中身が多くても、いつも同じ所） */
.swipe-card__open {
  margin-top: auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-sm);
  text-decoration: none;
}

.swipe-card__open svg { width: 16px; height: 16px; }

/* 3 つの丸。左が否決（赤）、中央があとで、右が承認（緑）。紙の左右の端にそろえる */
/* 2 本指で横に払ったとき、ブラウザの「戻る・進む」にしない */
.swipe__stage { overscroll-behavior-x: none; }
.swipe__actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 0 var(--sp-5);
}

.swipe__act {
  display: grid;
  justify-items: center;
  gap: var(--sp-1);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  color: var(--c-text-sub);
}

.swipe__act--ng { justify-self: start; --tone: var(--c-stamp-ng); --lean: var(--ng, 0); }
.swipe__act--ok { justify-self: end; --tone: var(--c-stamp-ok); --lean: var(--ok, 0); }
.swipe__act--later { --tone: var(--c-text-sub); --lean: var(--later, 0); }

.swipe__act-circle {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--tone);
  background: var(--c-bg);
  color: var(--tone);
  transform: scale(calc(1 + var(--lean) * 0.18));
  transition: transform var(--dur-pop) var(--ease-check), background-color var(--dur-menu) ease-in-out,
    color var(--dur-menu) ease-in-out;
}

.swipe__act-circle svg { width: 28px; height: 28px; }
.swipe__act--later .swipe__act-circle { width: 48px; height: 48px; margin-top: 8px; border-color: var(--c-border-strong); }
.swipe__act--later .swipe__act-circle svg { width: 20px; height: 20px; }

/* 承認は緑、否決は赤で塗る（左右の丸だけで向きと意味が分かるように） */
.swipe__act--ok .swipe__act-circle,
.swipe__act--ng .swipe__act-circle { background: var(--tone); color: var(--c-text-inv); }
.swipe__act--ng:hover .swipe__act-circle,
.swipe__act--later:hover .swipe__act-circle,
.swipe__act--ok:hover .swipe__act-circle { transform: scale(1.08); }

.swipe__act-label { font-size: var(--fs-sm); font-weight: 700; color: var(--tone); }
.swipe__act--later .swipe__act-label { font-weight: 400; color: var(--c-text-sub); }
.swipe__act-off { display: none; font-size: var(--fs-xs); color: var(--c-text-mute); }

.swipe__act:disabled { cursor: not-allowed; opacity: .4; }
.swipe__act:disabled .swipe__act-label { display: none; }
.swipe__act:disabled .swipe__act-off { display: block; }

.swipe__guide { margin: calc(var(--sp-2) * -1) 0 0; text-align: center; font-size: var(--fs-xs); color: var(--c-text-mute); }

/* スマホ: 紙と 3 つの丸を、送らずに 1 画面に収める。
   見出しは「稟議申請」と見え方の切り替えだけの 1 段にし（宿泊券の申請・新規申請は一覧の見え方で出す）、
   紙の高さは画面の高さに合わせて縮める。積んだ紙の縁も薄くする */
@media (max-width: 767px) {
  /* スマホの見出しはふだん縦に積む（layout.css）が、ここは題と切り替えを横 1 段に並べる */
  .main:has([data-ringi-swipe]) .pagehead {
    flex-direction: row;
    align-items: center;
    margin-bottom: var(--sp-2);
  }

  .main:has([data-ringi-swipe]) .pagehead__actions {
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .main:has([data-ringi-swipe]) .pagehead__actions > .btn {
    display: none;
  }

  /* 画面の高い端末では紙の高さが上限で止まり、下が空く。見出しの下の残りの高さの真ん中に、
     残り件数・紙・3 つの丸をまとめて置く */
  .main:has([data-ringi-swipe]) {
    display: flex;
    flex-direction: column;
  }

  .main:has([data-ringi-swipe]) > .swipe {
    flex: 1 0 auto;
    width: 100%;
    align-content: center;
  }

  .swipe {
    --h-swipe-card: clamp(var(--h-swipe-card-min), calc(100dvh - var(--h-swipe-chrome)), 392px);
    margin-top: 0;
    gap: var(--sp-3);
  }

  .swipe__deck {
    --pile-step: 2px;
  }

  .swipe__stage {
    gap: var(--sp-3);
  }

  .swipe-card {
    padding: var(--sp-4);
    gap: var(--sp-2);
  }

  /* スワイプの案内は、3 つの丸があれば分かるので出さない（縦の場所を空ける） */
  .swipe__guide {
    display: none;
  }

  /* 読むところ（要約か起案理由）は、紙が低くても潰さない。見出しと 2 行までにして、残りは「詳細を開く」で読む */
  .swipe-card__summary,
  .swipe-card__reason {
    flex: none;
    -webkit-line-clamp: 3;
  }
}

/* 画面の低いスマホ（iPhone 13 mini の Safari など）: 起案者と申請日の 1 行は出さない（詳細を開けば読める）。
   金額・支払先・実施時期・起案理由を、送らずに 1 画面に収めるため */
@media (max-width: 767px) and (max-height: 700px) {
  .swipe-card__who {
    display: none;
  }
}

/* 否決の理由（紙のすぐ下に出す。丸は押せなくする）。
   丸の並びと入れ替わりに、下からせり上がって出る。閉じるとき（.is-closing）は沈んで消え、丸が戻る */
.swipe.is-asking .swipe__actions, .swipe.is-asking .swipe__guide { display: none; }
.swipe.is-back .swipe__actions, .swipe.is-back .swipe__guide { animation: swipe-back var(--dur-slide) ease-out; }
/* 否決の理由は、紙の裏（ringi-swipe.js が束の上に重ねる）。紙を横向きまで回して隠し、
   反対側から裏の面を回して出す。閉じるときは逆。影は使わない（§0-2） */
.swipe__stage {
  position: relative;
  perspective: var(--swipe-perspective);
}

.swipe-card { transition-property: transform, opacity, translate, scale, rotate; }
.swipe-card.is-turning { rotate: y 90deg; transition-duration: var(--dur-flip); transition-timing-function: ease-in; }
.swipe-card.is-asking { visibility: hidden; }
.swipe-card.is-instant { transition: none; }

.swipe__reject {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: var(--h-swipe-card);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  overflow-y: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
}

.swipe__reject:not([hidden]) { animation: swipe-flip-in var(--dur-flip) ease-out both; }
.swipe__reject.is-closing { animation: swipe-flip-out var(--dur-flip) ease-in both; }

/* 3 つの丸と案内が、戻るときにふわっと出る（理由の面を閉じたあと・登場のあと・終わりの画面） */
@keyframes swipe-back {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes swipe-flip-in {
  from { rotate: y -90deg; }
  to { rotate: y 0deg; }
}

@keyframes swipe-flip-out {
  from { rotate: y 0deg; }
  to { rotate: y -90deg; }
}

.swipe__reject-title {
  margin: 0;
  color: var(--c-st-ng);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.swipe__reject-subject {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.45;
}

/* 理由の札。押せばそれで否決なので、行いっぱいの大きめの押しやすい行にする */
.swipe__reasons {
  display: grid;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.swipe__reason {
  min-height: var(--h-tap, var(--h-btn));   /* スマホは指で押しやすい高さ（--h-tap はスマホだけにある） */
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-md);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-press) ease-in-out, color var(--dur-press) ease-in-out;
}

.swipe__reason + .swipe__reason { border-top: 1px solid var(--c-border-light); }

.swipe__reason:hover {
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
}

.swipe__write,
.swipe__back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  align-self: flex-start;
  min-height: var(--h-btn-sm);
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-brand);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.swipe__write svg,
.swipe__back svg {
  width: var(--sz-helptip);
  height: var(--sz-helptip);
}

.swipe__write:hover,
.swipe__back:hover { color: var(--c-brand-dark); }

/* 「やめて表に戻す」は面のいちばん下の右 */
.swipe__back {
  margin-top: auto;
  align-self: flex-end;
  color: var(--c-text-sub);
}

.swipe__own {
  display: grid;
  gap: var(--sp-2);
  justify-items: end;
}

.swipe__own .textarea { width: 100%; }
.swipe__own[hidden] { display: none; }
.swipe__reject .textarea.is-invalid { border-color: var(--c-st-ng); }

@media (prefers-reduced-motion: reduce) {
  .swipe__reject:not([hidden]), .swipe__reject.is-closing { animation: none; }
  .swipe-card.is-turning { rotate: none; }
}

@media (max-width: 767px) {
  .swipe__reject { padding: var(--sp-4); }
}

/* 取り消しの帯（画面の下の真ん中） */
.swipe__undo {
  position: fixed;
  left: 50%;
  bottom: var(--sp-5);
  translate: -50% 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border-radius: 999px;
  background: var(--c-text);
  color: var(--c-text-inv);
  font-size: var(--fs-sm);
}

.swipe__undo .btn { color: var(--c-text-inv); }

/* 取り消しの帯は 1 行に。件名が長いときは … で切る（折り返すと、下の 3 つの丸に掛かる） */
.swipe__undo {
  max-width: calc(100vw - var(--sp-4) * 2);
}

.swipe__undo [data-swipe-undo-text] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swipe__undo .btn {
  flex: none;
}

.swipe__done { display: grid; gap: var(--sp-3); justify-items: center; padding: var(--sp-5) 0 var(--sp-6); text-align: center; }
.swipe__done-title { margin: var(--sp-2) 0 0; font-size: var(--fs-3xl); font-weight: 800; letter-spacing: .06em; }
.swipe__done-sum { margin: 0; color: var(--c-text-sub); }
.swipe-done__lead { margin: 0; font-size: var(--fs-lg); color: var(--c-text-sub); }

/* 絵: 片付けた紙の山と「済」の印。承認が 1 件でもあれば緑、全部あとでなら銅で静かに */
.swipe-done__art { width: min(320px, 80vw); height: auto; aspect-ratio: 4 / 3; overflow: visible; --tone: var(--c-stamp-ok); }
.swipe__done.is-all-later .swipe-done__art { --tone: var(--c-brand); }
.swipe-done__paper rect, rect.swipe-done__paper { fill: var(--c-bg); stroke: var(--c-border-strong); stroke-width: 1.5; }
.swipe-done__paper { transform-box: fill-box; transform-origin: 50% 100%; }
.swipe-done__paper--3 { opacity: .7; }
.swipe-done__lines { fill: none; stroke: var(--c-border); stroke-width: 4; stroke-linecap: round; }
.swipe-done__seal { color: var(--tone); transform-box: view-box; transform-origin: 150px 112px; rotate: -10deg; }
.swipe-done__seal circle { fill: var(--c-bg); stroke: currentColor; stroke-width: 4; }
.swipe-done__seal .swipe-done__seal-in { fill: none; stroke-width: 1.5; }
.swipe-done__seal text { fill: currentColor; font-size: 30px; font-weight: 800; }
.swipe-done__rays path { fill: none; stroke: var(--tone); stroke-width: 4; stroke-linecap: round; opacity: 0; }

.swipe-done__tally { display: flex; gap: var(--sp-6); margin: var(--sp-3) 0 var(--sp-2); padding: 0; list-style: none; }
.swipe-done__n { display: grid; justify-items: center; gap: 2px; min-width: 64px; }
.swipe-done__n b { font-size: calc(var(--fs-3xl) * 1.5); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.swipe-done__n span { font-size: var(--fs-sm); color: var(--c-text-sub); }
.swipe-done__n--ok b { color: var(--c-stamp-ok); }
.swipe-done__n--ng b { color: var(--c-stamp-ng); }
.swipe-done__n--later b { color: var(--c-text-sub); }
.swipe-done__n.is-zero b { color: var(--c-text-mute); }
.swipe-done__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-2); }

/* 動き（約 1.6 秒）: 紙が上から 1 枚ずつ落ちて積もる（「済」の印は、いちばん上の紙に押してある形で一緒に落ちる。
   カードに押したはんこのすぐあとなので、ここでは押し直さない）
   → 光の線が外へ散る → 字と数が下から出る */
.swipe__done.is-playing .swipe-done__paper { animation: swipe-done-drop 420ms cubic-bezier(.3, 1.4, .5, 1) both; }
.swipe__done.is-playing .swipe-done__paper--3 { animation-delay: 0ms; }
.swipe__done.is-playing .swipe-done__paper--2 { animation-delay: 120ms; }
.swipe__done.is-playing .swipe-done__paper--1 { animation-delay: 240ms; }
.swipe__done.is-playing .swipe-done__seal { animation: swipe-done-drop 420ms cubic-bezier(.3, 1.4, .5, 1) 300ms both; }
.swipe__done.is-playing .swipe-done__rays path { animation: swipe-done-ray 560ms ease-out 620ms both; }
.swipe__done.is-playing > :not(.swipe-done__art) { animation: swipe-back 420ms ease-out both; }
.swipe__done.is-playing > .swipe__done-title { animation-delay: 780ms; }
.swipe__done.is-playing > .swipe-done__lead { animation-delay: 860ms; }
.swipe__done.is-playing > .swipe-done__tally { animation-delay: 900ms; }
.swipe__done.is-playing > .swipe-done__actions { animation-delay: 1100ms; }

/* 紙吹雪: 印を押した瞬間に、印の中心から外へ散って、少し落ちながら消える */
.swipe-done__bit { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.swipe-done__bit--ok { fill: var(--c-stamp-ok); }
.swipe-done__bit--ng { fill: var(--c-stamp-ng); }
.swipe-done__bit--brand { fill: var(--c-brand); }
.swipe-done__bit--gold { fill: var(--c-st-draft); }
.swipe__done.is-all-later .swipe-done__bits { display: none; }
/* 紙片ごとの散る先（--x, --y）・回り（--r）・出の遅れ（--d） */
.swipe-done__bit:nth-child(1) { --x:-70px; --y:-6px; --r:0deg; --d:0ms }
.swipe-done__bit:nth-child(2) { --x:-93px; --y:-46px; --r:53deg; --d:30ms }
.swipe-done__bit:nth-child(3) { --x:-86px; --y:-37px; --r:106deg; --d:60ms }
.swipe-done__bit:nth-child(4) { --x:-54px; --y:-74px; --r:159deg; --d:90ms }
.swipe-done__bit:nth-child(5) { --x:-49px; --y:-61px; --r:212deg; --d:120ms }
.swipe-done__bit:nth-child(6) { --x:-15px; --y:-62px; --r:265deg; --d:0ms }
.swipe-done__bit:nth-child(7) { --x:-22px; --y:-110px; --r:318deg; --d:30ms }
.swipe-done__bit:nth-child(8) { --x:24px; --y:-95px; --r:11deg; --d:60ms }
.swipe-done__bit:nth-child(9) { --x:22px; --y:-81px; --r:64deg; --d:90ms }
.swipe-done__bit:nth-child(10) { --x:54px; --y:-70px; --r:117deg; --d:120ms }
.swipe-done__bit:nth-child(11) { --x:49px; --y:-57px; --r:170deg; --d:0ms }
.swipe-done__bit:nth-child(12) { --x:64px; --y:-21px; --r:223deg; --d:30ms }
.swipe-done__bit:nth-child(13) { --x:97px; --y:-50px; --r:276deg; --d:60ms }
.swipe-done__bit:nth-child(14) { --x:101px; --y:1px; --r:329deg; --d:90ms }
.swipe__done.is-playing .swipe-done__bit { animation: swipe-done-bit 1100ms cubic-bezier(.15, .7, .3, 1) calc(620ms + var(--d)) both; }
@keyframes swipe-done-bit {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0) scale(.4); }
  10%  { opacity: 1; }
  60%  { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 36px)) rotate(calc(var(--r) + 120deg)) scale(1); }
}

@keyframes swipe-done-drop {
  from { opacity: 0; transform: translateY(-48px) rotate(-6deg); }
  to { opacity: 1; transform: none; }
}
@keyframes swipe-done-ray {
  0%   { opacity: 0; stroke-dasharray: 0 20; }
  30%  { opacity: 1; }
  100% { opacity: 0; stroke-dasharray: 12 20; stroke-dashoffset: -10; }
}

@media (prefers-reduced-motion: reduce) {
  .swipe__done.is-playing .swipe-done__paper,
  .swipe__done.is-playing .swipe-done__seal,
  .swipe__done.is-playing > :not(.swipe-done__art) { animation: none; }
  .swipe__done.is-playing .swipe-done__rays path,
  .swipe__done.is-playing .swipe-done__bit { animation: none; opacity: 0; }
}

@media (max-width: 640px) {
  /* 紙の高さは、767px 以下の規則（画面の高さに合わせて縮める）に任せる */
  .swipe-card { padding: var(--sp-4); }
  .swipe__actions { padding: 0 var(--sp-2); }
}

@media (prefers-reduced-motion: reduce) {
  .swipe-card { transition: opacity 160ms ease-in-out; }
  .swipe__count, .swipe__count.is-pop b, .swipe-card.is-entering,
  .swipe.is-arrived .swipe__act, .swipe.is-arrived .swipe__guide { animation: none; }
  .swipe__act-circle { transition: none; transform: none; }
}

/* --- 決裁のはんこ（ringi-stamp.js。DESIGN.md 4.7） --------------------------------------------
   画面の中央。大きく傾いて浮いた印が、ぐっと押し付けられて一瞬つぶれ、にじんでから消える。影は付けない */
.hanko {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hanko.is-attached { position: absolute; z-index: 2; }
.hanko__seal {
  width: var(--sz-hanko);
  height: auto;
  overflow: visible;
  animation: hanko-press var(--dur-stamp) cubic-bezier(.2, .9, .3, 1.2) both;
}

.hanko--approve { color: var(--c-stamp-ok); }
.hanko--reject { color: var(--c-stamp-ng); }

.hanko__rim { fill: none; stroke: currentColor; stroke-width: 6; }
.hanko__line { stroke: currentColor; stroke-width: 3; }
.hanko__big { fill: currentColor; font-size: 30px; font-weight: 800; text-anchor: middle; letter-spacing: .08em; }
.hanko__big--ng { font-size: 40px; }
.hanko__small { fill: currentColor; font-size: 14px; font-weight: 700; text-anchor: middle; }

/* 押した瞬間に広がるにじみ（同じ色の輪） */
.hanko__ink {
  position: absolute;
  width: var(--sz-hanko);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid currentColor;
  opacity: 0;
  animation: hanko-ink var(--dur-stamp) ease-out both;
}

.hanko--reject .hanko__ink { border-radius: var(--r-md); }

@keyframes hanko-press {
  0%   { transform: scale(1.25) rotate(-12deg); opacity: 0; }
  12%  { opacity: .55; }
  20%  { transform: scale(1.25) rotate(-12deg); opacity: .6; }
  33%  { transform: scale(1) rotate(-8deg) scaleY(.92); opacity: 1; }
  40%  { transform: scale(1) rotate(-8deg) scaleY(1); }
  83%  { transform: scale(1) rotate(-8deg); opacity: 1; }
  100% { transform: scale(1) rotate(-8deg); opacity: 0; }
}

@keyframes hanko-ink {
  0%, 32% { transform: scale(.9); opacity: 0; }
  36%     { opacity: .45; }
  70%     { transform: scale(1.35); opacity: 0; }
  100%    { opacity: 0; }
}

body.is-hanko-shake .main { animation: hanko-shake 120ms ease-in-out 290ms 1; }

@keyframes hanko-shake {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(0, 2px); }
}

.hanko.is-reduced .hanko__seal { animation: hanko-fade 500ms ease-in-out both; }
.hanko.is-reduced .hanko__ink { display: none; }

@keyframes hanko-fade {
  0%   { opacity: 0; transform: rotate(-8deg); }
  30%, 70% { opacity: 1; transform: rotate(-8deg); }
  100% { opacity: 0; transform: rotate(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.is-hanko-shake .main { animation: none; }
}

/* 入力欄と同じ行に並ぶボタンは、入力欄と同じ高さにする（絞り込む・表示・保存・前日/今日/後日など）。
   欄の下の行にまとめた操作（.formactions / .formfoot）はそのまま */
:is(form, div, span):has(> :is(.fieldrow, .input, .select, .ts-wrapper, .td-date-wrap, .filterbar__field)) > .btn,
:is(.filterbar__actions, .ringi-filter__actions) .btn,
.td-date-chip {
  height: var(--h-input);
}

/* 欄の見出しに置く小さな絞り込み（.respfilter）は、欄もボタンも小さい高さ（--h-btn-sm）でそろえる */
form.respfilter .btn,
.respfilter .td-date-chip {
  height: var(--h-btn-sm);
}

.respfilter .ts-wrapper.single .ts-control {
  min-height: var(--h-btn-sm);
}

/* 金額の読み（実行金額など。app.js の wireYenWords）。欄の右下のすぐ下に「72万円」「1億2,345万6,789円」と
   出し、桁の打ち間違いに気づけるようにする。欄の箱は高くせず（同じ行の欄・ボタンとずれない）、読みの分の
   すき間は、欄を置いた行（稟議の詳細の実行金額の行・実行の入力の表のセル）の下に空けておく */
.yenwrap {
  position: relative;
  display: inline-block;
}

/* 積んだ欄の下に説明の一言があっても重ならないよう、読みの 1 行分を空ける。横に並べた欄（.formgrid の直下）は
   下端でそろうので空けない（読みは行の間のすき間に出る） */
.fieldrow--stack:has(.yenwrap):not(.formgrid > *) {
  margin-bottom: calc(var(--fs-xs) * 1.4);
}

.ringi-execution:has(.yenwrap) {
  margin-bottom: calc(var(--fs-xs) * 1.6);
}

.yenwords {
  position: absolute;
  top: calc(100% + var(--sp-hair));
  right: 0;
  color: var(--c-text-mute);   /* 金額より目立たせない、一段薄い灰色 */
  font-size: var(--fs-xs);
  font-weight: 400;   /* 太字にしない（読みは添え書き） */
  line-height: 1.4;
  white-space: nowrap;
}

/* 欄の下に説明がある所（実行の入力）は、読みを「円」の右に並べる */
.yenwords--inline {
  position: static;
  margin-left: var(--sp-2);
}


/* --- 4.38 経営分析（宿泊の実績と帳票の取り込み。GLIQ-339） -----------------
   実績の表は、区分ごとに 人数・売上・単価 を 本年・前年・前年比 で並べる。
   小計と総合計の行は .is-subtotal / .is-total（集計行の地）。 */
.actuals th.actuals__group {
  text-align: center;
}

.actuals th.actuals__label {
  font-weight: inherit;
  text-align: left;
  white-space: nowrap;
}

/* 区分の行は、小計より 1 段下げる */
.actuals th.actuals__label--item {
  padding-left: var(--sp-4);
}

.actuals .actuals__missing {
  color: var(--c-text-mute);
  font-size: var(--fs-sm);
}

/* 見出しが 2 段の .dtable--sticky（GLIQ-349）。2 段目を、1 段目の高さの分だけ下に止める
   （どちらも top: 0 だと、2 段目が 1 段目に重なる）。高さを決めるので、見出しは折り返さない */
.dtable--sticky.dtable--head2 thead th {
  white-space: nowrap;
}

.dtable--sticky.dtable--head2 thead tr:nth-child(2) th {
  top: var(--h-row);
  border-top-width: 0;
}

/* 実績の表の、見出しと区分の列の固定（GLIQ-349）。
   見出しは 2 段。1 段目を上端に、2 段目を 1 段目の高さの分だけ下に止める（どちらも top: 0 だと重なる）。
   区分の列は左端に止める。横に送っても、どの区分の行かが分かる */
.actuals {
  --actuals-head: var(--h-row);
}

/* 月を横に並べた表の 1 段目は、月の下に添え書き（進捗の時点）が入るので、高くする */
.actuals--period {
  --actuals-head: 44px;
  --actuals-label: 9.5rem;
}

.actuals.dtable--sticky thead th {
  z-index: 2;
  white-space: nowrap;
}

.actuals.dtable--sticky thead tr:first-child th {
  height: var(--actuals-head);
}

.actuals.dtable--sticky thead tr:nth-child(2) th {
  top: var(--actuals-head);
  border-top-width: 0;
}

.actuals.dtable--sticky thead tr:first-child th:first-child {
  left: 0;
  z-index: 3;
}

.actuals.dtable--sticky tbody th.actuals__label,
.actuals.dtable--sticky tbody th.actuals__measure {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--c-bg);
}

.actuals.dtable--sticky tbody tr.is-subtotal > th {
  background: var(--c-bg-sub);
}

.actuals.dtable--sticky tbody tr.is-total > th {
  background: var(--c-th-bg);
}

/* 月を横に並べた表は、区分の列の幅を決めて、その右に「人数・売上・単価」の列も止める */
.actuals--period.dtable--sticky tbody th.actuals__label {
  width: var(--actuals-label);
  min-width: var(--actuals-label);
  max-width: var(--actuals-label);
  white-space: normal;
}

.actuals--period.dtable--sticky tbody th.actuals__label[colspan] {
  width: auto;
  max-width: none;
}

.actuals--period.dtable--sticky tbody th.actuals__measure {
  left: var(--actuals-label);
}

/* 表だけを画面いっぱいに広げる（GLIQ-349。app.js の wireTableMaximize）。
   サイドバーとページの上の部分を覆い、枠の高さの上限を外す。字と行を少し詰めて、1 画面に入る量を増やす */
.panel.is-maximized {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-dropdown) + 10);
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.panel.is-maximized > .panel__body {
  flex: 1;
  min-height: 0;
}

.panel.is-maximized .dtable__scroll {
  height: 100%;
  max-height: none;
}

.panel.is-maximized .actuals {
  --h-row: 24px;
  font-size: var(--fs-xs);
}

.panel.is-maximized .actuals--period {
  --actuals-head: 38px;
}

.panel.is-maximized .actuals :is(th, td) {
  padding: 0 var(--sp-1);
}

body.has-maximized-panel {
  overflow: hidden;
}

/* 前年比の欄の地（GLIQ-351）。その増減が、全体をどれだけ動かしたかで、3 段に濃くする。
   小さい区分の大きな比率（2 人 → 0 人で 0%）は、地が付かないので、目を引かない。
   集計行の地（.is-subtotal）より後に書いて、小計の行でも見えるようにする */
.actuals td.heat--up-1 { background: color-mix(in srgb, var(--c-st-ok) 8%, var(--c-bg)); }
.actuals td.heat--up-2 { background: color-mix(in srgb, var(--c-st-ok) 18%, var(--c-bg)); }
.actuals td.heat--up-3 { background: color-mix(in srgb, var(--c-st-ok) 30%, var(--c-bg)); }
.actuals td.heat--down-1 { background: color-mix(in srgb, var(--c-st-ng) 8%, var(--c-bg)); }
.actuals td.heat--down-2 { background: color-mix(in srgb, var(--c-st-ng) 18%, var(--c-bg)); }
.actuals td.heat--down-3 { background: color-mix(in srgb, var(--c-st-ng) 30%, var(--c-bg)); }

.actuals td.heat .delta {
  font-weight: 600;
}

/* 前年から人数がいちばん増えた・減った区分の印。区分の名前の右に、増減の人数を添える */
.mover {
  display: inline-block;
  margin-left: var(--sp-2);
  padding: 0 var(--sp-1);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.mover--up {
  background: var(--c-st-ok-bg);
  color: var(--c-st-ok);
}

.mover--down {
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
}

/* 進捗の月（まだ締まっていない月）の列。実績の列と、地で見分ける */
.actuals--period .actuals__progress {
  background: var(--c-st-progress-bg);
}

/* 月を横に並べた表（GLIQ-350）。月の組の左に線を引き、区分の先頭の行の上にも線を引く */
.actuals--period .actuals__first {
  border-left: 1px solid var(--c-border-light);
}

.actuals--period tr.actuals__top > * {
  border-top: 1px solid var(--c-border-light);
}

.actuals--period th.actuals__measure {
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  font-weight: 400;
  white-space: nowrap;
}

.actuals--period th.actuals__label {
  vertical-align: top;
}

/* 提出用の集計の表（GLIQ-144）。月・区分・国の見出しは、折り返さない（列が多く、狭くなるため） */
.extreport th {
  white-space: nowrap;
}

.extreport tbody th {
  text-align: left;
}

/* 区分の対応（GLIQ-355）。欄とボタンを 1 行に並べる小さいフォーム。狭い画面では折り返す */
.catassign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.catassign .select,
.catassign .input {
  height: var(--h-btn-sm);
  font-size: var(--fs-sm);
}

/* 区分の表。名前の欄と、並び・表示のボタンは、折り返さずに 1 行で並べる */
.catrows td:first-child,
.catrows td:last-child {
  width: 1%;
  white-space: nowrap;
}

.catrows .catassign,
.catrows .statcell {
  flex-wrap: nowrap;
}

.catrows td:first-child .catassign {
  display: inline-flex;
}

.catrows tr.is-subtotal > th {
  text-align: left;
}

.catassign__check {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* 前年の系列は、グラフと同じ灰色（--c-ch-prev） */
.chartlegend__swatch--prev {
  background: var(--c-ch-prev);
}

/* 帳票を選ぶ欄と「取り込む」を 1 行に。狭い画面では折り返す */
.statupload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.statupload__input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-sm);
}

/* 落とす枠（`.dropzone`）。中に、選ぶ入力と、選んだファイルの名前を縦に並べる */
.statupload__drop {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  cursor: pointer;
}

.statupload__drop .statupload__input {
  flex: 0 0 auto;
  max-width: 100%;
}

.statupload__lead {
  font-size: var(--fs-sm);
  color: var(--c-text);
}

.statupload__picked {
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.statupload__picked:empty {
  display: none;
}

/* 取り込み済みの帳票の「あり」と、その帳票の「取り消す」を 1 行に（GLIQ-347） */
.statcell {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.statdiscard {
  display: inline-block;
}

/* --- 館内マップ（アンケート一覧の display=map） --------------------------- */
.fmap-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-block: var(--sp-3); }
.fmap-bar__end { margin-left: auto; }
.fmap-switch { position: relative; display: inline-flex; border: 1px solid var(--c-border); border-radius: var(--r-sm); overflow: hidden; background: var(--c-bg); }
.fmap-switch[hidden] { display: none; }
/* 切り替えと階のタブは .btn--sm と同じ高さ・字の大きさ・行の高さで、字を箱の真ん中に置く（上ずらない） */
.fmap-switch__item { display: inline-flex; align-items: center; height: var(--h-btn-sm); padding: 0 var(--sp-3); position: relative; z-index: 1; color: var(--c-text-sub); background: transparent; border: 0; font: inherit; font-size: var(--fs-sm); line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; transition: color var(--dur-map-slide) var(--ease-map); }
/* 下線は出さない（base.css の a:hover を打ち消す）。キーボードのフォーカスはブラウザの輪のまま（枠の overflow で切れないよう内側に） */
.fmap-switch__item:hover, .fmap-switch__item:focus, .fmap-switch__item:visited, .fmap-switch__item[aria-current],
.fmap-floors__item:hover, .fmap-floors__item:focus, .fmap-floors__item:visited, .fmap-floors__item[aria-current] { text-decoration: none; }
.fmap-switch__item:focus-visible { outline-offset: calc(var(--sp-hair) * -2); }
.fmap-switch__item + .fmap-switch__item { border-left: 1px solid var(--c-border); }
.fmap-switch__item.is-active, .fmap-switch__item.is-active:hover { color: var(--c-bg); font-weight: 700; }
/* 選んでいる所の地は、項目の後ろの 1 枚（.fmap-ind、survey-map.js が足す）が滑って動く。JS が無いときは項目に地を付ける */
.fmap-switch:not(.has-ind) .fmap-switch__item.is-active { background: var(--c-brand); }
.fmap-ind {
  position: absolute; z-index: 0; top: 0; left: 0; pointer-events: none; border-radius: var(--r-sm); background: var(--c-bg-sub);
  transition: transform var(--dur-map-slide) var(--ease-map), width var(--dur-map-slide) var(--ease-map), height var(--dur-map-slide) var(--ease-map), opacity var(--dur-map-slide) var(--ease-map);
}
.fmap-switch > .fmap-ind { border-radius: 0; background: var(--c-brand); }
.fmap-ind.is-instant { transition: none; }
.fmap-ind[hidden] { display: none; }

/* 階の切り替え: 地図の中の左上に重ねる細い縦の列（上が 6F）。平面でも 3D でも同じ */
.fmap-floors {
  position: absolute; z-index: 1; top: var(--map-flat-pad); left: var(--map-flat-pad);
  display: flex; flex-direction: column-reverse; gap: var(--sp-hair); width: var(--w-map-floors); padding: var(--sp-hair);
  background: var(--map-floors-bg); border: var(--map-hit-line-px) solid var(--c-border); border-radius: var(--r-md);
}
.fmap-floors__item { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; height: var(--h-map-floor); transition: color var(--dur-map-slide) var(--ease-map), background-color var(--dur-map-slide) var(--ease-map); border-radius: var(--r-sm); color: var(--c-text-sub); font-size: var(--fs-sm); line-height: 1; text-decoration: none; }
.fmap-floors__item:hover { background: var(--c-row-hover); color: var(--c-text); }
.fmap-floors__item.is-active, .fmap-floors__item.is-active:hover { color: var(--c-bg); background: transparent; font-weight: 700; }
.fmap-floors:not(.has-ind) .fmap-floors__item.is-active { background: var(--c-brand); }
.fmap-floors > .fmap-ind { background: var(--c-brand); }
/* 「全館」は 3D のときだけ（平面は 1 階ずつ） */
.fmap:not(.is-3d) .fmap-floors__item--all, .fmap:not(.is-3d-ready) .fmap-floors__item--all { display: none; }
.fmap-floors__item--all { font-size: var(--fs-xs); }

.fmap { position: relative; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--r-md); }
.fmap__svg { display: block; width: 100%; height: auto; }
.fmap__art { opacity: var(--map-art-opacity); filter: var(--map-art-filter); pointer-events: none; }

/* 平面: 選んだ階だけを出す。3D の描き先は、survey-map-3d.js が描けると分かるまで（is-3d-ready）出さない。
   JS が無い・WebGL が無いときは、mode=3d で開いても平面と同じ見え方になる */
.fmap__floor { padding: var(--map-flat-pad); }
/* 平面は階の列の幅だけ左を空け、列が場所に重ならないようにする */
.fmap__floor { padding-left: calc(var(--map-flat-pad) * 2 + var(--w-map-floors)); }
.fmap__floor:not(.is-current) { display: none; }
.fmap__3d { display: none; position: relative; height: var(--h-map-3d); overflow: hidden; border-radius: var(--r-md); background: var(--map-3d-bg); }
.fmap.is-3d.is-3d-ready > .fmap__floor { display: none; }
/* 階や見え方を替えたときのフェード。出ていく階は上に重ねたまま消し（is-leaving）、入る階は浮かび上がる（is-entering）。
   クラスは survey-map.js が付け外しする（最初に開いたときは動かさない） */
.fmap__floor.is-leaving { display: block; position: absolute; top: 0; left: 0; width: 100%; pointer-events: none; animation: fmap-fade-out var(--dur-map-fade) var(--ease-map) forwards; }
.fmap__floor.is-entering, .fmap__3d.is-entering { animation: fmap-fade-in var(--dur-map-fade) var(--ease-map); }
@keyframes fmap-fade-in { from { opacity: 0; } }
@keyframes fmap-fade-out { to { opacity: 0; } }
.fmap.is-3d.is-3d-ready .fmap__3d { display: block; }
.fmap__3d canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.fmap__3d.is-hovering canvas { cursor: pointer; }
.fmap__3d.is-dragging canvas { cursor: grabbing; }
/* 3D の操作の説明は、描き先の外（地図の枠の下）に 1 行で置く（床や箱に重ねない） */
.fmap-3d-hint { display: none; margin: var(--sp-1) 0 0; color: var(--c-text-sub); font-size: var(--fs-sm); }
.fmap.is-3d.is-3d-ready ~ .fmap-3d-hint { display: block; }

/* 狭い画面でも 3D は出す（タッチで回す・2 本指で寄る）。描き先の高さと階の列の大きさは、
   下の方の max-width: 767px の節（スマホの上書き）で変える */

/* 場所の重ね: 絵に刷られた名前が読めるよう、淡い色と場所の形の細線だけにする（数字は真ん中に置かない）。
   色は両方の見方で点数の帯（地図だけの淡い色 --map-band-*）。茶（--c-brand）と一覧の点数の棒の色は使わない。
   紐づけはあるが点の無い場所は塗らず灰色の細線だけ、紐づけの無い場所はホバーしたときだけ縁を出す */
.fmap__hit { --hit-fill: transparent; --hit-line: transparent; --hit-line-strong: var(--map-hit-line-color); }
.fmap__hit.is-linked { --hit-line: var(--map-hit-line-color); --hit-line-strong: var(--map-hit-line-strong); }
.fmap__hit.fmap__hit--hi { --hit-fill: var(--map-band-hi); --hit-line: var(--map-band-hi-line); --hit-line-strong: var(--map-band-hi-line-strong); }
.fmap__hit.fmap__hit--mid { --hit-fill: var(--map-band-mid); --hit-line: var(--map-band-mid-line); --hit-line-strong: var(--map-band-mid-line-strong); }
.fmap__hit.fmap__hit--low { --hit-fill: var(--map-band-low); --hit-line: var(--map-band-low-line); --hit-line-strong: var(--map-band-low-line-strong); }
.fmap__hit polygon {
  fill: var(--hit-fill); fill-opacity: var(--map-fill-opacity); stroke: var(--hit-line); stroke-width: var(--map-hit-line-linked); stroke-linejoin: round;
  transition: fill-opacity var(--dur-menu) ease-in-out, stroke-width var(--dur-menu) ease-in-out;
}
.fmap__hit.is-few polygon { fill-opacity: var(--map-few-opacity); stroke-dasharray: var(--map-few-dash); }
/* ホバーした場所は、色を少しだけ濃く、縁を少しだけ太く濃く（細線のまま） */
.fmap__hit:hover polygon, .fmap__hit:focus-visible polygon { fill-opacity: var(--map-fill-opacity-hover); stroke: var(--hit-line-strong); stroke-width: var(--map-hit-line-hover); }
/* 評価の点の札: 白地に細い縁の小さな丸札 */
.fmap__chip { pointer-events: none; }
.fmap__chip rect { fill: var(--c-bg); stroke: var(--hit-line-strong); stroke-width: var(--map-chip-line); }
.fmap__chip text { font-size: var(--map-chip-room); font-weight: 700; text-anchor: middle; dominant-baseline: central; fill: var(--c-text); }
.fmap__hit--facility .fmap__chip text { font-size: var(--map-chip-facility); }
.fmap__hit.is-few .fmap__chip rect { stroke-dasharray: var(--map-few-dash); }
.fmap__hit.is-few .fmap__chip text { fill: var(--c-text-sub); }

.fmap__tip { position: absolute; left: 0; top: 0; padding: var(--sp-1) var(--sp-2); background: var(--c-text); color: var(--c-bg); border-radius: var(--r-sm); font-size: var(--fs-sm); pointer-events: none; white-space: nowrap; z-index: var(--z-dropdown); }

/* アンケートが 2 件以上ある場所を押したときの小窓。押した所のそばに出す（位置は survey-map.js） */
.fmap__pop { position: absolute; left: 0; top: 0; z-index: var(--z-dropdown); min-width: var(--w-map-pop-min); max-width: var(--w-map-pop); padding: var(--sp-2) 0; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); }
.fmap__pop[hidden] { display: none; }
.fmap__pop-title { margin: 0; padding: 0 var(--sp-3) var(--sp-1); color: var(--c-text-sub); font-size: var(--fs-sm); }
.fmap__pop-list { list-style: none; margin: 0; padding: 0; }
.fmap__pop-link { display: flex; gap: var(--sp-2); align-items: baseline; padding: var(--sp-1) var(--sp-3); color: var(--c-text); text-decoration: none; }
.fmap__pop-link:hover, .fmap__pop-link:focus-visible { background: var(--c-row-hover); text-decoration: none; }
.fmap__pop-kind { color: var(--c-text-sub); font-size: var(--fs-sm); white-space: nowrap; }
.fmap__pop-label { flex: 1; min-width: 0; }
.fmap__pop-score { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; padding: 0 var(--sp-1); border-radius: var(--r-sm); border: var(--map-legend-line) solid var(--pop-line, var(--map-hit-line-color)); }
.fmap__pop-score--hi { --pop-line: var(--map-band-hi-line); }
.fmap__pop-score--mid { --pop-line: var(--map-band-mid-line); }
.fmap__pop-score--low { --pop-line: var(--map-band-low-line); }

/* 紐づけが 1 つも無いときの案内。地図の下に小さく */
.fmap-note { margin-top: var(--sp-1); color: var(--c-text-sub); font-size: var(--fs-xs); }
.fmap-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; color: var(--c-text-sub); font-size: var(--fs-sm); margin-top: var(--sp-2); }
.fmap-legend__swatch { display: inline-block; width: var(--sp-3); height: var(--sp-3); border-radius: 50%; border: var(--map-legend-line) solid var(--swatch-line); background: color-mix(in srgb, var(--swatch-fill) 45%, var(--c-bg)); }
.fmap-legend__swatch--hi { --swatch-fill: var(--map-band-hi); --swatch-line: var(--map-band-hi-line); }
.fmap-legend__swatch--mid { --swatch-fill: var(--map-band-mid); --swatch-line: var(--map-band-mid-line); }
.fmap-legend__swatch--low { --swatch-fill: var(--map-band-low); --swatch-line: var(--map-band-low-line); }
.fmap-legend__none { display: inline-block; width: var(--sp-3); height: var(--sp-3); border-radius: 50%; border: var(--map-legend-line) solid var(--map-hit-line-color); }
.fmap-legend__few { display: inline-block; width: var(--sp-3); height: var(--sp-3); border: var(--map-legend-line) dashed var(--c-text-sub); }

/* 動きを止める。3D のカメラの慣性と立ち上がりは survey-map-3d.js が同じ問い合わせで止める */
@media (prefers-reduced-motion: reduce) {
  .fmap__hit polygon { transition: none; }
  .fmap-ind, .fmap-switch__item, .fmap-floors__item { transition: none; }
  .fmap__floor.is-entering, .fmap__floor.is-leaving, .fmap__3d.is-entering { animation: none; }
}

/* --- 取り込みの状況（取り込むデータ → 出すもの。DESIGN.md 4.38） ----------------- */
/* 左は材料の棚（地色の枠、罫線で区切った行、緑の小さなマス）、右は仕上がった資料（茶の名札、茶のつながった棒）。
   緑は「データが入っている」、茶は「出せる」。 */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 5fr) 44px minmax(0, 6fr);
  align-items: stretch;
}

.flow__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-border-strong);
  font-size: var(--fs-2xl);
}

.flow__title {
  margin: 0 0 2px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-sub);
}

.flow__row {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  column-gap: var(--sp-2);
  align-items: center;
}

.flow__head {
  min-width: 0;
}

.flow__name {
  font-size: var(--fs-md);
}

.flow__say {
  margin-top: 1px;
  font-size: var(--fs-xs);
  line-height: 1.35;
  color: var(--c-text-sub);
}

.flow__tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border: 1px solid var(--c-st-ok);
  border-radius: 3px;
  background: var(--c-st-ok-bg);
  color: var(--c-st-ok);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.flow__lane {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow__lane + .flow__lane {
  margin-top: 2px;
}

.flow__lane-label {
  flex: 0 0 52px;
  font-size: 10.5px;
  color: var(--c-text-mute);
  text-align: right;
  white-space: nowrap;
}

.flow__strip {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}

.flow__month {
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
  text-align: center;
}

.flow__month--now {
  color: var(--c-brand);
  font-weight: 700;
}

.flow__cell {
  position: relative;
  display: block;
  height: 11px;
  border: 1px solid var(--c-border-light);
  border-radius: 3px;
  background: var(--c-bg-sub);
}

.flow__cell--full {
  border-color: var(--c-st-ok);
  background: var(--c-st-ok);
}

.flow__cell--part {
  border-color: var(--c-st-ok);
  background: repeating-linear-gradient(135deg, var(--c-st-ok-bg) 0 4px, var(--c-bg) 4px 8px);
}

.flow__cell--now {
  outline: 2px solid var(--c-brand);
  outline-offset: 1px;
}

/* マスに合わせたときの、その月の中身。影は使わず、濃い地に白い字 */
.flow__cell:hover::after,
.flow__cell:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 5;
  padding: 5px 9px;
  border-radius: var(--r-sm);
  background: var(--c-text);
  color: var(--c-text-inv);
  font-size: var(--fs-xs);
  line-height: 1.5;
  white-space: pre;
  pointer-events: none;
}

/* 取り込むデータ */
.flow__side--src {
  padding: var(--sp-2) 10px;
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
}

.flow__side--src .flow__row {
  padding: 6px 8px;
}

.flow__side--src .flow__row--head {
  padding-top: 0;
  padding-bottom: 2px;
}

.flow__side--src .flow__item {
  border-top: 1px solid var(--c-border-light);
}

.flow__side--src .flow__cell--none {
  background: var(--c-bg);
}

/* 出すもの */
.flow__side--out .flow__row {
  grid-template-columns: 216px minmax(0, 1fr);
  column-gap: var(--sp-3);
  padding-right: 10px;
}

.flow__side--out .flow__item {
  align-items: stretch;
  margin-top: 6px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-bg);
  overflow: hidden;
}

.flow__side--out .flow__head {
  padding: 6px 10px;
  background: var(--c-brand);
  color: var(--c-text-inv);
}

.flow__side--out .flow__name {
  font-size: var(--fs-md);
  font-weight: 600;
}

.flow__side--out .flow__name a {
  color: inherit;
}

.flow__formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  margin-top: 4px;
}

.flow__formula .flow__tag {
  margin-right: 0;
  background: var(--c-bg);
}

.flow__plus {
  margin: 0 3px;
  font-size: var(--fs-xs);
  opacity: .8;
}

.flow__side--out .flow__body {
  padding: 6px 0 5px;
}

.flow__side--out .flow__lane-label {
  display: none;
}

.flow__side--out .flow__body .flow__strip {
  gap: 0;
}

.flow__side--out .flow__body .flow__cell {
  height: 22px;
  border-left-width: 0;
  border-radius: 0;
}

.flow__side--out .flow__body .flow__cell:first-child {
  border-left-width: 1px;
  border-radius: 4px 0 0 4px;
}

.flow__side--out .flow__body .flow__cell:last-child {
  border-radius: 0 4px 4px 0;
}

.flow__side--out .flow__cell--full,
.flow__cell--out.flow__cell--full {
  border-color: var(--c-brand);
  background: var(--c-brand);
}

.flow__side--out .flow__cell--part,
.flow__cell--out.flow__cell--part {
  border-color: var(--c-brand);
  background: repeating-linear-gradient(135deg, var(--c-brand-pale) 0 5px, var(--c-bg) 5px 10px);
}

.flow__side--out .flow__say {
  margin-top: 3px;
}

/* これから作るもの */
.flow__planned {
  padding: var(--sp-2) 8px 2px;
  font-size: var(--fs-xs);
  color: var(--c-text-mute);
}

.flow__planned-item {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-sm);
  color: var(--c-text-sub);
}

/* 合わせた箱と、つながる箱だけを濃くする */
.flow [data-flow-key] {
  transition: opacity .12s;
}

.flow.is-focus [data-flow-key] {
  opacity: .32;
}

.flow.is-focus [data-flow-key].is-on,
.flow.is-focus [data-flow-key].is-self {
  opacity: 1;
}

.flow.is-focus .flow__side--src .flow__item.is-on,
.flow.is-focus .flow__side--src .flow__item.is-self {
  background: var(--c-bg);
  outline: 1px solid var(--c-brand);
  outline-offset: -1px;
}

.flow.is-focus .flow__side--out .flow__item.is-on,
.flow.is-focus .flow__side--out .flow__item.is-self {
  border-color: var(--c-brand);
  outline: 1px solid var(--c-brand);
}

.flow.is-focus .flow__planned-item.is-on,
.flow.is-focus .flow__planned-item.is-self {
  border-style: solid;
  border-color: var(--c-brand);
}

.flow__todo {
  margin-bottom: var(--sp-3);
  padding: 7px 12px;
  border: 1px solid var(--c-brand);
  border-radius: var(--r-md);
  background: var(--c-brand-pale);
  font-size: var(--fs-sm);
}

.flow__todo-item {
  margin-left: var(--sp-3);
}

.flow__todo > b {
  color: var(--c-brand-dark);
}

.flow__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--sp-4);
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}

.flow__legend .flow__cell {
  display: inline-block;
  width: 18px;
  height: 14px;
  margin-right: 5px;
  vertical-align: middle;
}

.flow__legend b {
  margin-right: 4px;
  color: var(--c-text);
}

/* 狭い画面では、縦に並べる */
@media (max-width: 1100px) {
  .flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow__arrow {
    transform: rotate(90deg);
    padding: var(--sp-2) 0;
  }
}

/* --- 年度の予算の表（GLIQ-336）。今のブックと同じ並び。左に、まとまりと科目の名前を固定する --- */
.plbudget td,
.plbudget th {
  white-space: nowrap;
}

.plbudget td.num {
  min-width: 4.6rem;
}

.plbudget__section {
  width: 4.5rem;
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  vertical-align: top;
}

.plbudget tr.plbudget__top > * {
  border-top: 1px solid var(--c-border-strong);
}

/* スマホの幅では、科目名の列を折り返して幅を抑える（長い科目名で、科目名の列が画面いっぱいになり、
   数字の列まで届かなくなる）。まとまりの列も細くする。年度の予算、月次の見込み、予算算定基礎係数、
   予算の入力の 12 か月の表に効く */
@media (max-width: 640px) {
  .plbudget th.actuals__label {
    min-width: 7em;
    max-width: 9em;
    white-space: normal;
    overflow-wrap: anywhere;
    padding-left: var(--sp-2);
    padding-right: var(--sp-1);
  }

  .plbudget th.actuals__label--item {
    padding-left: var(--sp-3);
  }

  .plbudget td.plbudget__section {
    width: 3em;
    max-width: 3em;
    padding-left: var(--sp-1);
    padding-right: var(--sp-1);
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* 確定したあとに直したセル（GLIQ-373）。下線で印を付ける（色で良し悪しを言わない） */
.plbudget td.is-edited {
  box-shadow: inset 0 -2px 0 var(--c-text-sub);
}

.plbudget td.plbudget__reason {
  white-space: normal;
  max-width: 28em;
  overflow-wrap: anywhere;
}

.plbudget .plbudget__sum {
  background: var(--c-bg-sub);
  font-weight: 600;
}

.plbudget th.actuals__label .cell-sub {
  font-weight: 400;
}

/* 帳票の取り込みの「まだ上がっていないもの」。月の語と、足りないものを 1 行ずつ */
.statmissing {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-md);
}

.statmissing li + li {
  margin-top: var(--sp-1);
}

.statmissing__when {
  display: inline-block;
  min-width: 7.5rem;
  font-weight: 600;
}

.statmissing__ok {
  color: var(--c-text-sub);
}

/* --- 月次の見込みの表と、今期予算の 2 つの案の説明（GLIQ-361） ------------------- */
.plforecast td.num {
  min-width: 4.2rem;
}

/* 2 つの出し方で、今期予算が合わないセル */
.plforecast td.fcdiff {
  background: var(--c-st-progress-bg);
}

.plforecast td.fcdiff--gap {
  font-weight: 600;
}

.fcchoice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.fcchoice__card {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
}

.fcchoice__card.is-current {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

.fcchoice__card p {
  margin: 0 0 var(--sp-1);
}

.fcchoice__card ul {
  margin: var(--sp-1) 0 0;
  padding-left: 1.3em;
  color: var(--c-text-sub);
}

.fcchoice__name {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.fcchoice__result {
  margin: var(--sp-3) 0 var(--sp-1);
  font-size: var(--fs-md);
}

.fcchoice__accounts {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

/* 月次の見込みの入力。表の下に、入れる月ごとの状態と操作を横に並べる。画面から入れたセルの印 */
.fcentry__months {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
}

.fcentry__month {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
}

.fcentry__monthname {
  color: var(--c-text-sub);
}

.fcentry__status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.fcentry__statusform {
  display: inline;
}

.plinput td.plinput__cell.is-entry::after {
  content: "●";
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 7px;
  line-height: 1;
  color: var(--c-brand);
  pointer-events: none;
}

/* AI の案（予算の下書き）。まとめの文と、科目ごとの表。AI が調整した行は、淡い AI の色 */
.plproposal__summary {
  margin: 0 0 var(--sp-2);
  line-height: 1.8;
}

.plproposal__by {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.plproposal td.plproposal__source,
.plproposal td.plproposal__reason {
  max-width: 22em;
  white-space: normal;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.plproposal tr.is-adjusted > td.num:nth-child(6),
.plproposal tr.is-adjusted > td.plproposal__reason {
  color: var(--c-text);
  font-weight: 600;
}

.plproposal th.actuals__label .cell-sub {
  display: block;
  font-weight: 400;
}

/* 予算の入力の全部門。全社の要約の文と、売上高・GOP の月ごとの折れ線を横に 2 つ */
.plsummary {
  margin: 0 0 var(--sp-3);
  padding-left: 1.3em;
  line-height: 1.7;
}

.plsummary li + li {
  margin-top: var(--sp-1);
}

.plcharts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-3);
}

.plcharts__item {
  min-width: 0;
  margin: 0;
}

.plcharts__item figcaption {
  margin-bottom: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

/* 算定基礎係数の入力。式で出す行は、打てないことが分かるように、地を落とす */
.plpremise tr.plpremise__calc > td,
.plpremise tr.plpremise__calc > th {
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
}

/* 式の行のうち、逆に打てる行（稼働率、同伴係数、単価）の欄。地は式の行のまま、点線の枠で「打てる」と示す */
.plpremise td.plinput__cell--solve .plinput__field {
  border: 1px dashed var(--c-border-strong, var(--c-border));
  border-radius: var(--r-sm);
  color: var(--c-text);
}

.plpremise td.plinput__cell--solve .plinput__field:hover {
  border-color: var(--c-brand);
}

/* 予算の入力（GLIQ-368）。予算の表（.plbudget）の、入れる行のセルを、入力欄にする。
   ますの中の欄は、枠を出さず、セルいっぱいに広げる（Excel のように、表にそのまま打つ）。
   写した値から直したセルには、左上に、小さく ▲（上げた）▼（下げた）を出す。 */
.plinput td.plinput__cell {
  position: relative;
  padding: 0;
}

.plinput__field {
  width: 100%;
  min-width: 4.4rem;
  height: 100%;
  padding: var(--sp-1) var(--sp-2);
  border: 0;
  background: transparent;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--c-text);
}

.plinput__field:hover {
  background: var(--c-row-hover);
}

.plinput__field:focus {
  outline: 2px solid var(--c-brand);
  outline-offset: -2px;
  background: var(--c-bg);
}

.plinput__field:disabled {
  color: var(--c-text-sub);
  background: transparent;
}

.plinput td.plinput__cell.is-up::after,
.plinput td.plinput__cell.is-down::after {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 8px;
  line-height: 1;
  color: var(--c-text-sub);
  pointer-events: none;
}

.plinput td.plinput__cell.is-up::after {
  content: "▲";
}

.plinput td.plinput__cell.is-down::after {
  content: "▼";
}

/* 保存できなかったセル。入れた文字は残し、枠を誤りの色にする */
.plinput td.plinput__cell.is-error .plinput__field {
  outline: 2px solid var(--c-st-ng);
  outline-offset: -2px;
}

/* 月を 1 つ選んで入れる形。列が少ないので、表を画面いっぱいに広げない */
.plinput--month {
  width: auto;
  min-width: 720px;
}

/* 月ごとの形は、入れるセルと、参考の数字を、色で分ける。
   入れるセルは、白い地に枠（フォームの欄に見える）。参考の列は、薄い地に、文字を一段落とす */
.plinput--month th.plinput__in {
  background: var(--c-brand-pale);
  color: var(--c-brand-dark);
}

.plinput--month td.plinput__cell {
  padding: var(--sp-1);
  background: var(--c-brand-pale);
}

.plinput--month .plinput__field {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}

.plinput--month .plinput__field:hover {
  border-color: var(--c-brand);
  background: var(--c-bg);
}

.plinput--month .plinput__field:disabled {
  background: var(--c-bg-sub);
}

.plinput--month th.plinput__refcol,
.plinput--month td.plinput__refcol {
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
}

/* 月ごとの形の、科目の名前は、折り返す（長い名前で、入れる欄が画面の外に出ないように）。
   右の面と並んで表が狭まっても、1 文字ずつ縦に折れないように、最小の幅を持つ */
.plinput--month th.actuals__label,
.plinput--month td.plpremise__detail {
  min-width: 9em;
  max-width: 16em;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* スマホの幅では、科目の名前、入れる欄、左の参考の数字、差だけを出す。
   年の合計と、右の参考の数字は、隠す（PC か、12 か月の表で見る） */
@media (max-width: 640px) {
  .plinput--month {
    width: 100%;
    min-width: 0;
  }

  .plinput--month th.actuals__label,
  .plinput--month td.plpremise__detail {
    min-width: 7em;
    max-width: 9em;
    padding-left: var(--sp-2);
    padding-right: var(--sp-1);
  }

  .plinput--month td.plinput__refcol,
  .plinput--month th.plinput__refcol {
    padding-left: var(--sp-1);
    padding-right: var(--sp-2);
  }

  .plinput--month .plbudget__sum,
  .plinput--month th[data-ref-slot="b"],
  .plinput--month td[data-ref-cell="b"] {
    display: none;
  }

  /* まとまりの列は、幅を無くす。消すと、見出し（2 列ぶん）と列がずれるので、消さない */
  .plinput--month td.plbudget__section {
    width: 0;
    max-width: 0;
    padding: 0;
    border-left: 0;
    border-right: 0;
    overflow: hidden;
    font-size: 0;
  }

  .plinput--month .plinput__field {
    min-width: 5.2rem;
    font-size: 16px; /* iOS は、16px より小さい欄に入ると、画面を拡大する */
  }

  .plinput--month .plinput__refpick {
    max-width: 6rem;
  }

  /* 表の下の欄は、縦に並べる（横に並べると、文が細く折れる） */
  .panel__foot:has(.plinput__saved) {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
  }

  .plinput__add,
  .plinput__saved,
  .plinput__restart {
    min-width: 0;
  }

  .plinput--month .plinput__refnav {
    gap: 0;
  }
}

/* 入れるセルの、右上の角の印。押すと、考え方のサポート（モーダル）が開く。
   印は小さな三角。押せるところは、指で押せる大きさに広げる */
.plinput__hint {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.plinput__hint::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 10px solid var(--c-brand);
  border-left: 10px solid transparent;
}

.plinput__hint:hover::before,
.plinput__hint:focus-visible::before {
  border-top-color: var(--c-brand-dark);
  border-top-width: 14px;
  border-left-width: 14px;
}

/* 考え方のサポートのモーダルの中身 */
.plhint {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.plhint__wait,
.plhint__by {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.plhint__text {
  margin: 0;
  font-size: var(--fs-md);
  line-height: 1.9;
}

.plhint__head {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-sub);
}

.plhint__picks {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.plhint__pick {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.plhint__pick:hover:not(:disabled),
.plhint__pick:focus-visible {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

.plhint__value {
  flex: 0 0 auto;
  min-width: 5.5em;
  font-size: var(--fs-md);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--c-brand-dark);
}

.plhint__how {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.plhint__enter {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.plhint__enter .input {
  width: 9em;
  text-align: right;
}

.plhint__facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-1) var(--sp-3);
  margin: 0;
  font-size: var(--fs-sm);
}

.plhint__facts dt {
  color: var(--c-text-sub);
}

.plhint__facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* 見込みと実績のずれ（GLIQ-359）。セルは割合の差と、その下に「見込み → 確定」。
   良し悪しの色は付けず、1 割以上ずれたセルだけ太くする。まだ確定していない月は薄く */
.fcacc td.fcacc__cell {
  font-variant-numeric: tabular-nums;
}

.fcacc td.fcacc__cell.is-large {
  font-weight: 600;
}

.fcacc td.fcacc__cell.is-pending {
  color: var(--c-text-mute);
}

.fcacc .fcacc__note {
  margin: var(--sp-1) 0 0;
  max-width: 16em;
  font-size: var(--fs-xs, var(--fs-sm));
  font-weight: 400;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.fcacc .fcacc__sum {
  background: var(--c-bg-sub);
  white-space: nowrap;
}

/* 予算とのずれ（GLIQ-368）。差の列は、多い・少ないを、良し悪しの色で分けない
   （売上は多いほうがよく、費用は少ないほうがよい。科目によって意味が逆になる）。
   + と △ で読む。予算より多いものだけ、太くする。原因の列は、備考と、書く欄 */
.fcvar td.fcvar__diff.is-over {
  font-weight: 600;
}

.fcvar td.fcvar__cause {
  min-width: 18em;
  white-space: normal;
}

.fcvar__note {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.fcvar__chip {
  margin-right: var(--sp-2);
  padding: 0 var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-sub);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.fcvar__write > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--c-brand);
}

.fcvar__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.fcvar__form .input {
  flex: 1 1 14em;
  min-width: 0;
}

.fcvar__more {
  margin-top: var(--sp-4);
}

.fcvar__more > summary {
  cursor: pointer;
  color: var(--c-text-sub);
}

/* 表の上の道具。選んだセルを割合で動かす、1 つ戻す */
.plinput__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.plinput__tools [data-budget-undo] {
  margin-left: var(--sp-3);
}

/* 予算の入力の、表と右の面。面は 300px で右に止め、1024px 未満では表の下に積む */
.plside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
}

.plside__main {
  min-width: 0;
}

.plside__pane {
  position: sticky;
  top: var(--sp-3);
  padding: var(--sp-3);
  border-left: 1px solid var(--c-border);
  font-size: var(--fs-sm);
}

.plside__what {
  margin: 0 0 var(--sp-2);
  font-weight: 600;
  color: var(--c-text);
}

.plside__pane .chartbox--sm {
  height: 160px;
}

/* 面の切り替え。小さな下線のタブ */
.plside__tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--c-border);
}

.plside__tab {
  padding: var(--sp-1) 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  cursor: pointer;
}

.plside__tab:hover {
  color: var(--c-text);
}

.plside__tab.is-active {
  border-bottom-color: var(--c-brand);
  color: var(--c-brand-dark);
  font-weight: 600;
}

/* 数字の表。月が縦、4 列まで。選んだ月の行に、入れるセルと同じ淡い地 */
.plside__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.plside__table th,
.plside__table td {
  padding: 2px var(--sp-1);
  border-bottom: 1px solid var(--c-border-light, var(--c-border));
  text-align: right;
  white-space: nowrap;
}

.plside__table th:first-child,
.plside__table td:first-child {
  text-align: left;
  color: var(--c-text-sub);
}

.plside__table thead th {
  font-weight: 400;
  color: var(--c-text-sub);
}

.plside__table tr.is-here > * {
  background: var(--c-brand-pale);
  font-weight: 600;
}

/* 面の中の、考え方のサポートと備考。モーダルより一回り小さく */
.plhint--pane {
  font-size: var(--fs-sm);
}

.plhint--pane .plhint__text {
  font-size: var(--fs-sm);
}

.chartlegend--left {
  justify-content: flex-start;
  margin-top: var(--sp-1);
}

.plside__facts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-1) var(--sp-2);
  margin: var(--sp-3) 0 0;
  color: var(--c-text-sub);
}

.plside__facts dt {
  font-weight: 400;
}

.plside__facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.plside__facts dd .cell-sub {
  display: block;
}

.plside__trend {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light, var(--c-border));
}

.plside__trendhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
  color: var(--c-text-sub);
}

.plside__trendbtns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-1);
}

.plside__trendbtns .btn {
  flex-direction: column;
  height: auto;
  padding: var(--sp-1);
  line-height: 1.3;
}

.plside__trendvalue {
  display: block;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

@media (max-width: 1023px) {
  .plside {
    grid-template-columns: minmax(0, 1fr);
  }

  .plside__pane {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--c-border);
  }
}

/* 1 科目ずつの形の、動かす範囲の欄（選んだセル、12 か月すべて、夏、冬）。道具の帯に収める小さな欄 */
.plinput__range {
  height: 1.9rem;
  padding: 0 var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-text);
}

/* 1 科目ずつの形の、科目を選ぶ欄と、前後の科目。表の上に、◀ 欄 ▶ で並べる */
.plinput__account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
}

.plinput__account .select {
  min-width: 12em;
}

.plinput__account [aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

/* 年の合計を月に割る形。列が少ないので広げない。配り方の欄は、行の中に収める */
.plinput--annual {
  min-width: 640px;
}

.plinput--annual .plinput__range {
  max-width: 14em;
}

/* 1 科目ずつの形。月の列は短いので、折り返さない。合計の行は、入れない */
.plinput--account {
  min-width: 560px;
}

.plinput--account th.actuals__label {
  min-width: 4em;
  white-space: nowrap;
}

/* スマホの幅では、月、入れる欄、前の年度の予算、差だけを出す（確定・見込みと、その前の年度の実績は隠す） */
@media (max-width: 640px) {
  .plinput--account {
    min-width: 0;
  }

  .plinput--account th.actuals__label {
    min-width: 3em;
  }

  .plinput--account .plinput__more {
    display: none;
  }

  .plinput__account .select {
    flex: 1 1 100%;
    order: -1;
  }
}

/* 考え方のサポートの中の、備考（これまでのものと、残す欄） */
.plhint__notes {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.plhint__notes:empty {
  display: none;
}

.plhint__notes li {
  padding: var(--sp-2) var(--sp-3);
  border-left: 3px solid var(--c-brand-pale);
  background: var(--c-bg-sub);
  font-size: var(--fs-sm);
}

.plhint__notewhen {
  color: var(--c-text-sub);
}

.plhint__notecause {
  margin-left: var(--sp-2);
  padding: 0 var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  font-size: var(--fs-xs);
}

.plhint__notedel {
  float: right;
  padding: 0 var(--sp-1);
  border: 0;
  background: none;
  color: var(--c-text-sub);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.plhint__notedel:hover:not(:disabled) {
  color: var(--c-st-ng);
}

.plhint__notebody {
  margin: var(--sp-1) 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.plhint__noteform {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

/* 見込みの理由を促す一言（見込みを大きく動かして保存したとき、備考の欄の上に出す） */
.plhint__nudge {
  flex: 1 1 100%;
  margin: 0;
  padding: var(--sp-2);
  border-left: 3px solid var(--c-text-sub);
  background: var(--c-bg-sub);
  font-size: var(--fs-sm);
}

.plhint__noteform label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.plhint__notetext {
  flex: 1 1 100%;
  min-height: 3.4em;
  resize: vertical;
}

.plhint__notesaid {
  color: var(--c-text-sub);
}

/* 参考の列の見出し。◀ 欄 ▶ で、出す数字を替える */
.plinput__refnav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}

.plinput__refpick {
  max-width: 13.5rem;
  padding: 1px var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
}

.plinput__refstep {
  padding: 0 var(--sp-1);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  line-height: 1.6;
  cursor: pointer;
}

.plinput__refstep:hover,
.plinput__refstep:focus-visible {
  background: var(--c-brand-pale);
  color: var(--c-brand-dark);
}

/* 横の「今年度の予算」の数。押すと、その数が入る */
.plinput__ref {
  padding: 0 var(--sp-1);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-brand);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.plinput__ref:hover,
.plinput__ref:focus-visible {
  background: var(--c-brand-pale);
}

.plinput__lead {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-md);
}

.plinput__hint {
  margin: var(--sp-2) 0 0;
  max-width: 60em;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.plinput__start {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.plinput__add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
}

.plinput__saved {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.plinput__saved.is-error {
  color: var(--c-st-ng);
}

.plinput__restart {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
}

.plinput__restart > summary {
  cursor: pointer;
  color: var(--c-text-sub);
}

.plinput__restart .plinput__start {
  margin-top: var(--sp-2);
}

/* 算定基礎係数。内訳（館や会場）の列は、左に寄せて、折り返さない */
.plpremise td.plpremise__detail {
  text-align: left;
  white-space: nowrap;
}

/* 運営会議の資料。GOP 率の行は、率なので、細い字で、色を落とす */
.opsummary tr.opsummary__rate > th,
.opsummary tr.opsummary__rate > td {
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

/* 月次の見込みの「わからない点」。文の並ぶ表なので、折り返して、上にそろえる */
.fcopen__lead {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.fcopen th,
.fcopen td {
  white-space: normal;
  vertical-align: top;
  line-height: 1.6;
}

.fcopen tbody th {
  min-width: 9rem;
  font-weight: 600;
}

.fcopen td {
  min-width: 14rem;
}

@media (max-width: 900px) {
  .fcchoice {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 部門の担当（GLIQ-372）。入れられる人のチェックを、セルの中で折り返して並べる */
.plassign__picks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-1) 0;
}

.plassign__picks .checkline {
  margin-right: 0;
}

.plassign__picks .cell-sub {
  margin-left: var(--sp-1);
}

/* 全部門の状況から担当を決めるモーダル（GLIQ-375）。検索の欄、選ぶ人の一覧、決めるボタン */
.plassign__modal {
  display: grid;
  gap: var(--sp-2);
}

.plassign__modal .plassign__picks {
  flex-direction: column;
  flex-wrap: nowrap;
  max-height: 50vh;
  overflow-y: auto;
}

.plassign__modal .checkline[hidden] {
  display: none;
}

.plassign__foot {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  margin: 0;
}

/* 部門の担当の表。入れられる人の列が高いので、ほかの列も行いっぱいにして上に寄せる */
.plassign th,
.plassign td {
  height: auto;
  vertical-align: top;
}

.plassign td:nth-child(2) {
  white-space: nowrap;
}

.plassign td:nth-child(3) {
  min-width: 14em;
}

/* ---- 販促カレンダー（GLIQ-330、DESIGN §4.41） ----
   施策・行事を、年度の 12 か月に帯で並べる。帯は、月の列をまたぐセル（colspan） */
.promo-cal {
  table-layout: fixed;
}

.promo-cal .promo-cal__name {
  width: 30%;
  text-align: left;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.promo-cal .promo-cal__month {
  text-align: center;
  font-weight: 400;
  color: var(--c-text-sub);
}

.promo-cal .promo-cal__month.is-current {
  font-weight: 600;
  color: var(--c-text);
}

.promo-cal td.promo-cal__gap {
  border-left: var(--sp-hair) solid var(--c-border-light);
}

.promo-cal td.promo-cal__bar {
  text-align: center;
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--c-st-progress-bg);
  box-shadow: inset 0 calc(var(--sp-hair) * 2) 0 var(--c-st-progress);
}

/* 種類で色を分ける。キャンペーン・販促は青、行事・イベントは緑、世の中の動きは灰 */
.promo-cal td.promo-cal__bar--event {
  background: var(--c-st-ok-bg);
  box-shadow: inset 0 calc(var(--sp-hair) * 2) 0 var(--c-st-ok);
}

.promo-cal td.promo-cal__bar--external {
  background: var(--c-st-skip-bg);
  box-shadow: inset 0 calc(var(--sp-hair) * 2) 0 var(--c-st-skip);
}

/* 年度の外から続く、外へ続く帯は、端を点線にする */
.promo-cal td.promo-cal__bar.is-from-before {
  border-left: calc(var(--sp-hair) * 2) dashed var(--c-border-strong);
}

.promo-cal td.promo-cal__bar.is-to-after {
  border-right: calc(var(--sp-hair) * 2) dashed var(--c-border-strong);
}

/* チェックをいくつか並べる欄（館、チャネル、地域） */
.checkgroup {
  border: 0;
  padding: 0;
  margin: 0 0 var(--sp-3);
}

.checkgroup legend {
  padding: 0;
  margin-bottom: var(--sp-1);
}

.checkgroup__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
}

/* ほかの画面に添える、その期間の施策・行事（実績など） */
.promo-mentions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.promo-mentions li + li {
  margin-top: var(--sp-2);
}

/* --- 過去の資料（GLIQ-390）。シートを元の並びで出す表 --- */
.archive-meta th { width: 8em; white-space: nowrap; background: var(--c-th-bg); font-weight: 600; }
.archive-grid__scroll { max-height: 70vh; overflow: auto; }
.archive-grid th.archive-grid__row,
.archive-grid th.archive-grid__corner { position: sticky; left: 0; z-index: 2; background: var(--c-th-bg); text-align: right; font-weight: 600; color: var(--c-text-sub); }
.archive-grid th.archive-grid__corner { z-index: 3; }
.archive-grid th.archive-grid__col { text-align: center; color: var(--c-text-sub); min-width: 4em; }
.archive-grid td { white-space: pre-wrap; vertical-align: top; font-size: var(--fs-xs); }
.archive-grid td.archive-grid__formula { cursor: help; box-shadow: inset 0 -2px 0 var(--c-brand-pale); }
.plhint__refs { font-size: var(--fs-xs); color: var(--c-text-sub); margin-top: var(--sp-1); }
.plhint__refs a { color: var(--c-brand); }

/* --- レポート（GLIQ-398）。文書モデルの block と、スライドの見せ方 --- */
.report-summary { margin: 0; padding-left: 0; list-style: none; }
.report-summary li { margin: var(--sp-1) 0; font-size: var(--fs-lg); }
.report-summary li.report-summary__lead { font-size: var(--fs-xl); font-weight: 700; line-height: 1.5; }
.report-lead { margin: var(--sp-2) 0; font-size: var(--fs-lg); font-weight: 700; line-height: 1.6; }
.report-kpis { margin-bottom: var(--sp-3); }
.report-hero { text-align: center; margin: var(--sp-3) 0 var(--sp-4); }
.report-hero__label { font-size: var(--fs-sm); color: var(--c-text-sub); }
.report-hero__value { font-size: var(--fs-3xl); font-weight: 700; line-height: 1.2; font-variant-numeric: normal; }
.report-hero__compare { font-size: var(--fs-md); color: var(--c-text-sub); }
.report-highlight {
  padding: var(--sp-3) var(--sp-4); margin: var(--sp-2) 0 var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-bg);
}
.report-highlight__num { font-size: var(--fs-xs); color: var(--c-text-sub); }
.report-highlight__label { font-size: var(--fs-sm); color: var(--c-text-sub); }
.report-highlight__value { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; font-variant-numeric: normal; }
.report-highlight__compare { font-size: var(--fs-md); color: var(--c-text-sub); }
.report-step { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-sub); }
.report-step b { color: var(--c-brand); }
.report-highlight .report-caption { margin: var(--sp-3) 0 0; }
.report-chart { margin: var(--sp-2) 0 var(--sp-3); }
.report-chart__notes { margin: var(--sp-1) 0 0; padding-left: var(--sp-4); font-size: var(--fs-xs); color: var(--c-text-sub); }
.report-chart__title { font-size: var(--fs-sm); color: var(--c-text-sub); margin-bottom: var(--sp-1); }
.report-caption { margin: var(--sp-2) 0 0; font-size: var(--fs-md); }
.report-caption--muted { color: var(--c-text-sub); }
.report-table__title { caption-side: top; text-align: left; font-size: var(--fs-sm); color: var(--c-text-sub); padding: var(--sp-1) 0; }
.report-text { margin: var(--sp-2) 0; line-height: 1.7; }
.report-text__kind {
  display: inline-block; margin-right: var(--sp-2); padding: 0 var(--sp-2); border-radius: var(--r-xs);
  font-size: var(--fs-xs); vertical-align: baseline;
  background: var(--c-bg-sub); color: var(--c-text-sub);
}
button.report-text__kind { border: 0; font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.report-text--assessment .report-text__kind { background: var(--c-st-progress-bg); color: var(--c-st-progress); }
.report-text--conjecture .report-text__kind { background: var(--c-st-draft-bg); color: var(--c-st-draft-ink); }
.report-text--conjecture { color: var(--c-text); }
.report-text__meta { display: block; font-size: var(--fs-sm); color: var(--c-text-sub); }
.report-text__meta[hidden] { display: none; }
.report-list { margin: var(--sp-2) 0; padding-left: 1.2em; }
.report-perspective.is-hidden { display: none; }
.report-refs a { margin-right: var(--sp-hair); }
.report-notes { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.report-notes__item { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: baseline; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); }
.report-notes__kind { font-size: var(--fs-sm); padding: 0 var(--sp-2); border-radius: var(--r-xs); background: var(--c-bg-sub); }
.report-notes__where, .report-notes__meta { font-size: var(--fs-sm); color: var(--c-text-sub); }
.report-notes__body { flex: 1 1 50%; }
.report-notes__delete { margin-left: auto; }
.report-versions { margin: 0; padding-left: 1.2em; }
.report-foot { font-size: var(--fs-sm); color: var(--c-text-sub); margin-top: var(--sp-4); }
.report-wait { margin: 0; }
.report-wait::after { content: " …"; animation: report-dots 1.2s steps(3, end) infinite; }
@keyframes report-dots { to { content: " ……"; } }

/* スライド: 1 枚ずつ。16:9 の枠で、本文は中でスクロールして収める */
.slides { position: relative; }
.slide {
  display: none; aspect-ratio: 16 / 9; min-height: var(--h-slide-min); overflow-y: auto;
  padding: var(--sp-5) var(--sp-6); margin: 0 0 var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-bg);
}
.slide.is-active { display: block; }
.slide__title { margin: 0 0 var(--sp-3); font-size: var(--fs-2xl); }
.slide__sub { margin: calc(var(--sp-2) * -1) 0 var(--sp-4); color: var(--c-text-sub); }
.slide__who { font-size: var(--fs-md); font-weight: 400; color: var(--c-text-sub); margin-left: var(--sp-2); }
.slide__summary { font-size: var(--fs-lg); line-height: 1.8; padding-left: 1.2em; }
.slide .report-text { font-size: var(--fs-lg); }
.slide .dtable { font-size: var(--fs-md); }
.slides__nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin: var(--sp-1) 0 var(--sp-4); }
.slides__count { color: var(--c-text-sub); font-variant-numeric: tabular-nums; }
[data-slides-stage]:fullscreen { background: var(--c-bg); padding: var(--sp-3); display: flex; flex-direction: column; }
[data-slides-stage]:fullscreen .slide { height: calc(100vh - var(--h-btn-lg) - var(--sp-3) * 3); margin: 0; }
[data-slides-stage]:fullscreen .slides__nav { margin: var(--sp-3) 0 0; min-height: var(--h-btn-lg); }
@media (max-width: 767px) {
  .slide { padding: var(--sp-4); aspect-ratio: auto; min-height: 0; }
  [data-perspective-tabs] { overflow-x: auto; flex-wrap: nowrap; }
}

.report-failed__reason { margin: 0 0 var(--sp-3); }
.report-news { list-style: none; margin: 0; padding: 0; }
.report-news__item { padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); }
/* ニュースの全件は折りたたむ（月に 30 件ほどになる）。開いた一覧は 1 件 1 行に詰める */
.report-news-more { margin-top: var(--sp-3); }
.report-news-more > summary { cursor: pointer; color: var(--c-text-sub); font-size: var(--fs-sm); }
.report-news--compact .report-news__item { padding: var(--sp-1) 0; font-size: var(--fs-sm); }
.report-news--compact .report-news__item.is-cited > a { font-weight: 700; }

/* --- 一覧の表をカードの行にする（dtable--cards） --------------------------
   1 件を 1 枚の白いカードにして、行の間を空けて並べる。罫線と見出しの帯は引かない。
   数字の表（会議資料の実績・予算など）には付けない。稟議一覧と同じ見た目。
   既存の .dtable / .dtable--sticky / .dtable__scroll の罫線の規則より強くするため、クラスを重ねる。
   カードの枠は罫線でなく inset の影で描く（角の丸めに沿い、セルの罫線の規則とぶつからない） */
.dtable.dtable--cards.dtable--cards {
  border-collapse: separate;
  border-spacing: 0 4px;
  border-style: none;
  background: transparent;
  font-size: var(--fs-md);
  --cards-line: var(--c-border-light);
}

.dtable.dtable--cards.dtable--cards :is(th, td) {
  border: 0;
  height: auto;
}

.dtable.dtable--cards.dtable--cards thead th {
  padding: var(--sp-1) var(--sp-3) 0;
  background: var(--c-bg-sub);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--c-text-mute);
}

.dtable.dtable--cards.dtable--cards tbody tr,
.dtable.dtable--cards.dtable--cards tbody tr:hover {
  background: transparent;
}

.dtable.dtable--cards.dtable--cards tbody td {
  padding: 8px var(--sp-3);
  background: var(--c-bg);
  box-shadow: inset 0 1px 0 var(--cards-line), inset 0 -1px 0 var(--cards-line);
  transition: background-color 0.15s;
}

.dtable.dtable--cards.dtable--cards tbody td:first-child {
  border-radius: var(--r-md) 0 0 var(--r-md);
  box-shadow: inset 0 1px 0 var(--cards-line), inset 0 -1px 0 var(--cards-line), inset 1px 0 0 var(--cards-line);
}

.dtable.dtable--cards.dtable--cards tbody td:last-child {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  box-shadow: inset 0 1px 0 var(--cards-line), inset 0 -1px 0 var(--cards-line), inset -1px 0 0 var(--cards-line);
}

.dtable.dtable--cards.dtable--cards tbody td:only-child {
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--cards-line);
}

.dtable.dtable--cards.dtable--cards tbody tr:hover > td {
  --cards-line: var(--c-border);
  background: var(--c-row-hover);
}

/* 状態の地は残す（淡い地だけ）。急ぎの行の赤い地はやめ、件名の前のバッジで示す */
.dtable.dtable--cards.dtable--cards tbody tr.is-st-draft > td    { background: var(--c-st-draft-bg); }
.dtable.dtable--cards.dtable--cards tbody tr.is-st-progress > td { background: var(--c-st-progress-bg); }
.dtable.dtable--cards.dtable--cards tbody tr.is-st-ok > td       { background: var(--c-st-ok-bg); }
.dtable.dtable--cards.dtable--cards tbody tr.is-st-ng > td       { background: var(--c-st-ng-bg); }
.dtable.dtable--cards.dtable--cards tbody tr.is-st-skip > td     { background: var(--c-st-skip-bg); }
.dtable.dtable--cards.dtable--cards tbody tr.is-selected > td    { background: var(--c-brand-pale); }

/* 部署などの区切りの行（職員の組織の表の部署の行）は、カードにせず見出しの字だけ */
.dtable.dtable--cards.dtable--cards tbody tr.orgtable__dept > td,
.dtable.dtable--cards.dtable--cards tbody tr.orgtable__dept:hover > td {
  padding: var(--sp-3) var(--sp-1) 0;
  background: transparent;
  box-shadow: none;
}

/* カードの表を入れた欄は、箱と見出しの帯を消して、題と件数を表の上に小さく置く */
.panel:has(.dtable--cards) {
  background: transparent;
  border: 0;
}

.panel:has(.dtable--cards) > .panel__head {
  padding: 0 var(--sp-1);
  background: transparent;
  border-bottom: 0;
}

.panel:has(.dtable--cards) > .panel__body,
.panel:has(.dtable--cards) > .panel__body--flush:last-child {
  border-radius: 0;
  overflow: visible;
}

.panel:has(.dtable--cards) > .panel__foot {
  padding: var(--sp-1) var(--sp-1) 0;
  background: transparent;
  border-top: 0;
}

.dtable__scroll:has(> .dtable--cards) {
  max-height: none;
}

/* --- 宿泊券 1 枚（voucher.html、DESIGN.md 4.40） ------------------------------
   1 列（2 列にしない）。上から券そのもの → 記録 → いまできる操作。券は、本体と番号の半券を
   ミシン目（点線）で分け、ミシン目の上下に丸い切り欠き。影は付けない */
/* 幅を絞った中身は、左に寄せず左右の真ん中に置く（ぱんくずと見出しは、ほかの画面と同じ左のまま） */
.vdetail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  max-width: var(--w-read);
  margin-inline: auto;
}
.vdetail__main, .vdetail__side { display: grid; gap: var(--sp-4); min-width: 0; }
.vdetail__main > .note { margin: 0; }
.vdetail__side > .panel { margin: 0; }
.vdetail__pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-3); }
.vdetail__pair > .fieldrow--stack + .fieldrow--stack { margin-top: 0; }
.vdetail__hint { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--c-text-sub); }
/* 無効にするのは、操作の欄のすぐ下に、欄の内側と同じ左右の余白で小さくたたむ（線は引かない） */
.ringi-fold.ringi-fold--row.vdetail__void { margin: calc(-1 * var(--sp-2)) 0 0; padding: 0 var(--sp-3); border-top: 0; }
.vdetail__void > .ringi-fold__head { justify-content: flex-start; gap: 4px; padding: var(--sp-2) 0; }

.vticket {
  --notch: 12px;
  --stub: 168px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  overflow: hidden;
}

/* ミシン目の上下の切り欠き。地の色の丸を縁に重ね、外にはみ出た半分は券の外なので切る */
.vticket::before,
.vticket::after {
  content: "";
  position: absolute;
  right: calc(var(--stub) - var(--notch));
  width: calc(var(--notch) * 2);
  height: calc(var(--notch) * 2);
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-bg-sub);
}
.vticket::before { top: calc(var(--notch) * -1 - 1px); }
.vticket::after { bottom: calc(var(--notch) * -1 - 1px); }

.vticket__body { padding: var(--sp-5) var(--sp-5) var(--sp-4); min-width: 0; }
.vticket__kind { margin: 0; font-size: var(--fs-md); font-weight: 700; color: var(--c-brand); letter-spacing: .04em; }
.vticket__amount {
  margin: var(--sp-1) 0 var(--sp-4);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.vticket__unit { margin-left: 4px; font-size: var(--fs-md); font-weight: 600; color: var(--c-text-sub); }
.vticket__facts { display: grid; gap: var(--sp-2); margin: 0; }
.vticket__facts > div { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: var(--sp-2); align-items: baseline; }
.vticket__facts dt { font-size: var(--fs-sm); color: var(--c-text-sub); }
.vticket__facts dd { margin: 0; overflow-wrap: anywhere; }
.vticket__gift {
  display: inline-block;
  margin-left: var(--sp-2);
  padding: 0 var(--sp-2);
  border-radius: 999px;
  background: var(--c-st-ai-bg);
  color: var(--c-brand);
  font-size: var(--fs-xs);
  line-height: 1.8;
  vertical-align: 1px;
}

/* 半券。ミシン目は点線。番号を大きく */
.vticket__stub {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-3);
  border-left: 2px dashed var(--c-border);
  background: var(--c-bg-sub);
  text-align: center;
}
.vticket__no-label { font-size: var(--fs-xs); color: var(--c-text-sub); }
.vticket__no { font-size: var(--fs-lg); font-weight: 800; letter-spacing: .04em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* 使い終わった・無効の券は、本体を少し薄くする（読める濃さは残す） */
.vticket--used .vticket__body > *,
.vticket--void .vticket__body > * { opacity: .72; }
.vticket--void .vticket__amount { text-decoration: line-through; text-decoration-thickness: 2px; }

/* 記録: 発行 → 利用（または無効）。丸を縦の線でつなぐ（承認欄の段の丸と同じ形） */
/* 記録のたたみ。いちばん下に、無効にする行と同じ小さな行で（線は引かない） */
.ringi-fold.ringi-fold--row.vdetail__track { margin: calc(-1 * var(--sp-4)) 0 0; padding: 0 var(--sp-3); border-top: 0; }
.vdetail__track > .ringi-fold__head { justify-content: flex-start; gap: 4px; padding: var(--sp-2) 0; }
.vdetail__track-body { padding: var(--sp-2) 0 0; }
.vtrack { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-4); }
.vtrack__step {
  position: relative;
  display: grid;
  grid-template-columns: 14px 4em minmax(0, 1fr);
  column-gap: var(--sp-3);
  align-items: center;
}
.vtrack__step + .vtrack__step::before {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 50%;
  height: calc(100% + var(--sp-4));
  border-left: 2px solid var(--c-border);
  z-index: 0;
}
.vtrack__step.is-done + .vtrack__step.is-done::before { border-left-color: var(--c-brand-dark); }
.vtrack__dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid var(--c-border-strong);
  border-radius: 50%;
  background: var(--c-bg);
}
.vtrack__step.is-done .vtrack__dot { border-color: var(--c-brand-dark); background: var(--c-brand-dark); }
.vtrack__step.is-void .vtrack__dot { border-color: var(--c-st-none); background: var(--c-st-none); }
.vtrack__name { font-weight: 700; }   /* 右の字と同じ大きさにして、墨の上下をそろえる */
.vtrack__step:not(.is-done) .vtrack__name,
.vtrack__step:not(.is-done) .vtrack__what { color: var(--c-text-mute); }
.vtrack__what { min-width: 0; overflow-wrap: anywhere; }
.vtrack__who { margin-left: var(--sp-2); font-size: var(--fs-xs); color: var(--c-text-sub); }
.vtrack__sub { grid-column: 3; font-size: var(--fs-xs); color: var(--c-text-sub); }
.vtrack__note {
  margin: var(--sp-4) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-light);
  display: grid;
  grid-template-columns: 4em minmax(0, 1fr);
  column-gap: var(--sp-3);
  padding-left: calc(14px + var(--sp-3));
}
.vtrack__note-key { font-size: var(--fs-sm); font-weight: 700; }

@media (max-width: 480px) {
  .vticket { --stub: 116px; }
  .vticket__no { font-size: var(--fs-md); white-space: nowrap; }
  .vticket__body { padding: var(--sp-4); }
  .vticket__amount { font-size: var(--fs-2xl); }
  .vdetail__pair { grid-template-columns: 1fr; }
}

/* --- 宿泊券の申請のフォーム（voucher_form.html） ---------------------------------
   件名と表のあいだを空け、表の見出しを置く。文字の欄は字が読める幅、有効期限は
   前日・今日のボタンを出さない（期限に今日・昨日を入れることはまず無く、表が横に伸びる） */
.voucher-lines__head { margin-top: var(--sp-5); }
.voucher-lines__head > .sectionhead { margin-bottom: var(--sp-2); }
.voucher-lines .select { width: auto; min-width: 0; }   /* 選択肢の幅（空の行も「選ぶ」「—」が入る） */
.voucher-lines .input--num { width: var(--w-voucher-num); }
.voucher-lines .input:not([class*="input--"]) { min-width: var(--w-voucher-text); }
.voucher-lines .td-date-quick { display: none; }
.dtable__scroll + .formactions { margin-top: var(--sp-4); }

/* --- 模範例（exemplars.html / exemplar_form.html） ------------------------------ */
/* 一覧: 件名の下に注釈を 2 行まで。件名は太く、注釈は小さく薄く */
.exlist__main { min-width: 22em; max-width: 40em; }
.exlist__subject { display: block; font-weight: 700; text-decoration: none; }
.exlist__note {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: var(--fs-xs);
  color: var(--c-text-sub);
}
.exlist__at { font-size: var(--fs-xs); color: var(--c-text-sub); font-variant-numeric: tabular-nums; }

/* 編集: 上に、しくみを 1→2→3 の流れで 1 行に（濃い注記の箱にしない） */
.exflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  max-width: var(--w-exedit);
  margin: 0 auto var(--sp-4);
  padding: 0;
  list-style: none;
}
.exflow__step {
  position: relative;
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}
.exflow__step b { display: block; margin-bottom: 2px; font-size: var(--fs-md); color: var(--c-text); }
/* 段と段のあいだの矢印 */
.exflow__step + .exflow__step::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--sp-3) * -1 + 2px);
  width: 8px;
  height: 8px;
  border: solid var(--c-border-strong);
  border-width: 2px 2px 0 0;
  translate: 0 -50%;
  rotate: 45deg;
}
.exflow__no {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-brand-dark);
  color: var(--c-text-inv);
  font-size: var(--fs-xs);
  font-weight: 700;
  /* 上の行の字（本文・手本カード）の墨の真ん中にそろえる（4 倍の画面で測ると、丸が 2px 下だった） */
  margin-top: -2px;
}

/* 直す画面は、本文か手本カードのどちらか 1 つを、読める幅（820px まで）の 1 列で出す */
/* 幅を絞った中身は左右の真ん中に（ぱんくずと見出しは左のまま） */
.exedit { display: grid; gap: var(--sp-4); align-items: start; max-width: var(--w-exedit); margin-inline: auto; }
.exedit__tabs { margin: 0 0 var(--sp-4); }
.exedit__main { min-width: 0; }
.exedit__main .panel + .panel { margin-top: var(--sp-4); }
.exedit__side { min-width: 0; }
.exedit__side > .panel { margin: 0; }
.exedit .fieldrow--stack { max-width: none; }
.exedit .fieldrow--stack > .textarea,
.exedit .fieldrow--stack > .input { width: 100%; }
.exedit__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3); align-items: end; }
.exedit__row + .fieldrow--stack { margin-top: var(--sp-3); }
.exedit__hint { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); color: var(--c-text-sub); }
.exedit__source { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--c-text-sub); }
/* 本文の保存の帯は、欄の左右の端にそろえ、線を引かない（下の削除・変更履歴と線が重ならないように） */
.exedit .formfoot { margin-top: var(--sp-3); padding: 0; border-top: 0; background: none; }
/* 削除は保存の帯の下に、線なしの小さな 1 行で */
.ringi-fold.ringi-fold--row.exedit__delete { margin-top: var(--sp-4); border-top: 0; }
.exedit__delete > .ringi-fold__head { justify-content: flex-start; gap: 4px; padding: var(--sp-2) 0; }
.exedit__delete[open] > form { margin-top: var(--sp-2); }

@media (max-width: 720px) {
  .exflow { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .exflow__step { padding: var(--sp-2) var(--sp-3); }
  .exflow__step + .exflow__step::before { display: none; }
  .exedit__row { grid-template-columns: minmax(0, 1fr); }
}

/* 模範例の書いていない欄・現れていない基準のたたみ（本文の欄の流れの最後に、上に線の 1 行） */
.ringi-fold.ringi-fold--row.exedit__empty,
.ringi-fold.ringi-fold--row.excard__blank { margin: var(--sp-3) 0 0; }
/* 本文の最後の行なので、欄の下の余白を食って、行の上下と同じ余白で欄を閉じる */
.ringi-fold.ringi-fold--row.exedit__empty:last-child { margin-bottom: calc(-1 * var(--sp-3)); }
/* 字に全角の括弧（件数）が付くと墨が上下に広がるので、「く」の字は上げずにそろう（4 倍の画面で測った） */
.exedit__empty > .ringi-fold__head .ringi-fold__chev { top: 0; }
.excard__blank > .ringi-fold__head .ringi-fold__chev { top: 1px; }
.exedit__empty[open] > .fieldrow--stack:first-of-type,
.excard__blank[open] > .fieldrow--stack:first-of-type { margin-top: 0; }

/* 手本カードの中の区切り。小見出し（太字）と一言、その下に欄。区切りのあいだに細い線 */
.excard__sec { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--c-border-light); }
.excard__title { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.excard__title > label { font: inherit; color: inherit; }
.excard__hint { margin: 2px 0 var(--sp-3); font-size: var(--fs-xs); color: var(--c-text-sub); }
.excard__sec > .fieldrow--stack + .fieldrow--stack { margin-top: var(--sp-3); }
.excard__sec > .textarea { width: 100%; }
.excard__none { margin: 0; font-size: var(--fs-sm); color: var(--c-text-mute); }
.excard__actions { justify-content: space-between; align-items: center; margin-top: var(--sp-4); }
#exemplar-card .fieldrow--stack { max-width: none; }
#exemplar-card .fieldrow--stack > .textarea { width: 100%; }

/* 模範例の読む画面（exemplar_view.html）。左に本文の紙、右に手本カード。どちらも入力欄ではなく文で読む */
/* 1 列（2 列にしない）。本文の下に手本カード。幅を絞って左右の真ん中に（ぱんくずと見出しは左のまま） */
.exview { display: grid; gap: var(--sp-4); max-width: var(--w-read); margin: 0 auto var(--sp-4); }
.exview__paper { margin: 0; }
.exview__paper > .panel__body { padding: var(--sp-5) var(--sp-5) var(--sp-4); }
.exview__meta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: 0 0 var(--sp-3); font-size: var(--fs-xs); color: var(--c-text-sub); }
.exview__meta > span + span::before { content: "／"; margin-right: var(--sp-3); color: var(--c-border-strong); }
/* 注釈（どこが手本か）は、紙の上の淡い地の 1 枚に（左の線は付けない） */
.exview__note {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--c-depth-1);
  line-height: 1.7;
}
.exview__note-key { display: block; margin-bottom: 2px; font-size: var(--fs-xs); font-weight: 700; color: var(--c-brand-dark); }

/* 本文の紙の下に続ける。本文とのあいだは線 1 本 */
.excard-read { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--c-border); }
.excard-read__head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.excard-read__name { margin: 0; font-size: var(--fs-md); font-weight: 700; }
.excard-read__none, .excard-read__foot { margin: 0; font-size: var(--fs-sm); color: var(--c-text-mute); }
.excard-read__foot { margin-top: var(--sp-3); }
.excard-read__sec + .excard-read__sec { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--c-border-light); }
.excard-read__title { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); font-weight: 700; }
.excard-read__list { display: grid; gap: var(--sp-2); margin: 0; }
.excard-read__list > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: var(--sp-2); align-items: baseline; }
.excard-read__list dt { font-size: var(--fs-xs); color: var(--c-text-sub); }
.excard-read__list dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.excard-read__phrases { display: grid; gap: var(--sp-1); margin: 0; padding: 0; list-style: none; }
.excard-read__phrases li { padding: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); background: var(--c-bg-sub); line-height: 1.6; }

/* --- 4.43 ホームページ更新のモック（templates/website/、website-mock.js） --------------
   業務ポータルの中で公式サイトを更新したらどう見えるか。右のプレビュー（.webprev）だけは、
   公式サイトの見え方の目安として明朝の見出し・白い地にする（業務ポータルの部品と混ぜない） */
.webmock__band {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-st-draft-bg);
  color: var(--c-st-draft-ink, var(--c-text));
  font-size: var(--fs-sm);
}

/* 入口: 左に数と最近の更新、右にいまのトップページ */
.webhome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--sp-4); align-items: start; }
.webhome__main { display: grid; gap: var(--sp-4); min-width: 0; }
.webhome__main > .panel { margin: 0; }
.webhome__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.webstat {
  display: grid;
  gap: 2px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c-text);
  text-decoration: none;
}
.webstat:hover { border-color: var(--c-brand); }
.webstat__n { font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; color: var(--c-st-ok); font-variant-numeric: tabular-nums; }
.webstat--progress .webstat__n { color: var(--c-st-progress); }
.webstat--draft .webstat__n { color: var(--c-st-draft); }
.webstat__l { font-size: var(--fs-sm); color: var(--c-text-sub); }

.weblist { margin: 0; padding: 0; list-style: none; }
.weblist__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--sp-3);
  align-items: center;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border-light);
}
.weblist__row:last-child { border-bottom: 0; }
.weblist__title { grid-column: 1; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.weblist__meta { grid-column: 1; font-size: var(--fs-xs); color: var(--c-text-sub); }
.weblist__row > .badge { grid-column: 2; grid-row: 1 / span 2; }

.webhome__site { min-width: 0; }
.webhome__site-label { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); font-weight: 700; color: var(--c-text-sub); }

/* プレビュー: 公式サイトの見え方の目安 */
.webprev {
  --wp-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --wp-ink: var(--c-webprev-ink);
  --wp-sub: var(--c-webprev-sub);
  --wp-line: var(--c-webprev-line);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-webprev-bg);
  color: var(--wp-ink);
  overflow: hidden;
}
.webprev__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 14px 20px;
  border-bottom: 1px solid var(--wp-line);
}
.webprev__logo { font-family: var(--wp-serif); font-size: 15px; letter-spacing: .12em; white-space: nowrap; }
.webprev__nav { font-size: 11px; color: var(--wp-sub); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.webprev__section { padding: 20px; }
.webprev__section + .webprev__section { border-top: 1px solid var(--wp-line); }
.webprev__h { margin: 0 0 12px; font-family: var(--wp-serif); font-size: 18px; letter-spacing: .1em; }
.webprev__h span { margin-left: 10px; font-family: inherit; font-size: 11px; color: var(--wp-sub); letter-spacing: .2em; }
.webprev__news { margin: 0; padding: 0; list-style: none; }
.webprev__news li { border-bottom: 1px solid var(--wp-line); }
.webprev__news a { display: flex; gap: 16px; padding: 10px 0; color: inherit; text-decoration: none; font-size: 13px; line-height: 1.6; }
.webprev__news a:hover { color: var(--c-brand); }
.webprev__news time { flex: none; color: var(--wp-sub); font-variant-numeric: tabular-nums; }
.webprev__news li.is-this a,
.webprev__mag li.is-this .webprev__mag-title { font-weight: 700; color: var(--c-brand-dark); }
.webprev__more { margin: 12px 0 0; font-size: 12px; color: var(--wp-sub); text-align: right; }
.webprev__mag { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.webprev__mag a { display: grid; gap: 6px; color: inherit; text-decoration: none; }
.webprev__mag a:hover .webprev__mag-title { color: var(--c-brand); }
.webprev__thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2px; background: linear-gradient(135deg, var(--c-webprev-photo), var(--c-webprev-photo-2)); }
.webprev__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.webprev__mag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: var(--wp-sub); }
.webprev__cat { padding: 0 6px; border: 1px solid var(--wp-line); font-size: 10px; letter-spacing: .06em; }
.webprev__new { color: var(--c-webprev-new); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.webprev__mag-title { font-size: 12px; line-height: 1.6; }
.webprev__banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.webprev__banners a { position: relative; isolation: isolate; display: grid; align-content: end; gap: 2px; aspect-ratio: 16 / 9; padding: 16px; overflow: hidden; background: linear-gradient(135deg, var(--c-webprev-banner), var(--c-webprev-banner-2)); color: var(--c-webprev-bg); text-decoration: none; }
/* 写真のバナーは、白い字が読めるよう下を暗くする */
.webprev__banners img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.webprev__banners a:has(img)::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--c-webprev-scrim), var(--c-webprev-scrim-light)); }
.webprev__banners b { font-family: var(--wp-serif); font-size: 14px; font-weight: 600; }
.webprev__banners span { font-size: 11px; opacity: .85; }

/* 記事のページ */
.webprev__article { padding: 24px 28px 32px; }
.webprev__crumb { margin: 0 0 14px; font-size: 11px; color: var(--wp-sub); letter-spacing: .08em; }
.webprev__meta { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 12px; color: var(--wp-sub); }
.webprev__title { margin: 0 0 8px; font-family: var(--wp-serif); font-size: 22px; font-weight: 600; line-height: 1.55; letter-spacing: .04em; overflow-wrap: anywhere; }
.webprev__facilities { margin: 0 0 18px; font-size: 11px; color: var(--wp-sub); }
.webprev__hero { aspect-ratio: 16 / 9; margin-bottom: 20px; overflow: hidden; background: var(--c-webprev-photo); }
.webprev__hero[hidden] { display: none; }
.webprev__hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.webprev__body { font-size: 14px; line-height: 2; overflow-wrap: anywhere; }
.webprev__body h2 { margin: 1.4em 0 .4em; padding-bottom: 6px; border-bottom: 1px solid var(--wp-line); font-family: var(--wp-serif); font-size: 17px; font-weight: 600; }
.webprev__body p { margin: 0 0 1em; }
.webprev__body h3 { margin: 1.2em 0 .3em; font-family: var(--wp-serif); font-size: 15px; font-weight: 600; }
.webprev__body ul, .webprev__body ol { margin: 0 0 1em; padding-left: 1.6em; }
.webprev__body li > p { margin: 0; }
.webprev__body blockquote { margin: 0 0 1em; padding: 4px 0 4px 1.2em; color: var(--wp-sub); }
.webprev__body blockquote::before { content: "“"; float: left; margin-left: -1em; font-family: var(--wp-serif); font-size: 20px; line-height: 1.4; color: var(--wp-line); }
.webprev__body a { color: var(--c-brand); text-decoration: underline; }
.webprev__empty { color: var(--wp-sub); }

/* 記事を書く画面: 左に欄、右にプレビュー。下に保存の帯 */
.webedit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4) var(--sp-5); align-items: start; }
.webedit__form { display: grid; gap: var(--sp-3); min-width: 0; }
.webedit__form .fieldrow--stack { max-width: none; margin: 0; }
.webedit__state { display: flex; align-items: center; gap: var(--sp-2); }
.webedit__updated { font-size: var(--fs-xs); color: var(--c-text-sub); }
.webedit__kind { justify-self: start; }
.webedit__kind input { position: absolute; opacity: 0; pointer-events: none; }
.webedit__title { width: 100%; font-size: var(--fs-lg); font-weight: 700; }
.webedit__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12em, max-content)); gap: var(--sp-3); }
.webedit__row > [hidden] { display: none; }
.webedit__facilities { margin: 0; padding: 0; border: 0; }
.webedit__facilities legend { margin-bottom: var(--sp-1); padding: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-sub); }
.webedit__pin { margin-left: var(--sp-3); color: var(--c-text-sub); }
/* 本文の欄（Tiptap）。ツールバーと書く所を 1 つの枠に入れる。website-mock.js の mountBodyEditor */
.webedit__editor { border: 1px solid var(--c-border); border-radius: var(--r-sm); background: var(--c-bg); }
.webedit__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-hair); padding: var(--sp-1); border-bottom: 1px solid var(--c-border-light); background: var(--c-bg-sub); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.webedit__tools[hidden] { display: none; }
.webedit__tool { height: var(--h-btn-sm); padding: 0 var(--sp-2); border: 0; border-radius: var(--r-xs); background: none; color: var(--c-text); font-size: var(--fs-sm); cursor: pointer; }
.webedit__tool:not(:disabled):hover { background: var(--c-brand-pale); color: var(--c-brand-dark); }
.webedit__tool.is-active { background: var(--c-brand-pale); color: var(--c-brand); font-weight: 600; }
.webedit__tool:disabled { color: var(--c-text-mute); cursor: default; }
.webedit__tool--b { font-weight: 700; }
.webedit__tools-sep { width: 1px; height: var(--sp-4); margin: 0 var(--sp-1); background: var(--c-border); }
.webedit__tools-right { display: flex; gap: var(--sp-hair); margin-left: auto; }
.webedit__tools-hint { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); color: var(--c-text-mute); }
/* リンクの先の欄。「リンク」を押すと高さを 0 から広げて下へ開く（DESIGN.md §0-8） */
.webedit__linkbar { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--dur-slide) ease-in-out, opacity var(--dur-slide) ease-in-out; }
.webedit__linkbar.is-open { grid-template-rows: 1fr; opacity: 1; }
.webedit__linkbar-in { display: flex; align-items: center; gap: var(--sp-1); min-height: 0; overflow: hidden; padding: 0 var(--sp-2); }
.webedit__linkbar.is-open .webedit__linkbar-in { padding: var(--sp-2); border-bottom: 1px solid var(--c-border-light); }
.webedit__linkbar-in .input { flex: 1; height: var(--h-btn-sm); }
.webedit__linkbar-in [hidden] { display: none; }
.webedit__body-raw { display: block; border: 0; }
.webedit__body-raw[hidden], .webedit__body[hidden] { display: none; }
/* 書く所。中の見出し・箇条書き・引用は、プレビューより控えめに（業務ポータルの字のまま） */
.webedit__prose { min-height: var(--h-webedit-body); max-height: calc(100vh - var(--h-webedit-body)); overflow-y: auto; padding: var(--sp-2) var(--sp-3); line-height: 1.8; overflow-wrap: anywhere; }
.webedit__prose > * + * { margin-top: var(--sp-2); }
.webedit__prose p { margin: 0; }
.webedit__prose h2 { margin: var(--sp-3) 0 0; font-size: var(--fs-lg); font-weight: 700; }
.webedit__prose h3 { margin: var(--sp-3) 0 0; font-size: var(--fs-md); font-weight: 700; }
.webedit__prose > :first-child { margin-top: 0; }
.webedit__prose ul, .webedit__prose ol { margin-bottom: 0; padding-left: var(--sp-5); }
.webedit__prose li > p { margin: 0; }
.webedit__prose blockquote { margin: var(--sp-2) 0 0; padding: var(--sp-1) var(--sp-3); background: var(--c-bg-sub); border-radius: var(--r-sm); color: var(--c-text-sub); }
.webedit__prose a { color: var(--c-brand); text-decoration: none; background: var(--c-brand-pale); border-radius: var(--r-xs); }
.webedit__prose p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: left; height: 0; color: var(--c-text-mute); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .webedit__linkbar { transition: none; } }
.webedit__preview { position: sticky; top: var(--sp-4); display: grid; gap: var(--sp-2); min-width: 0; }
.webedit__preview-bar { display: flex; justify-content: space-between; gap: var(--sp-2); }
.webedit__frame { max-height: calc(100vh - 220px); overflow: auto; border-radius: var(--r-md); }
.webedit__frame.is-sp > .webprev { width: 375px; margin: 0 auto; }
.webedit__frame.is-sp .webprev__nav { display: none; }
.webedit__frame.is-sp .webprev__article { padding: 18px 16px 24px; }
.webedit__frame.is-sp .webprev__title { font-size: 19px; }
.webedit__preview-note { margin: 0; font-size: var(--fs-xs); color: var(--c-text-mute); }
.webedit__foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--c-border); }
.webedit__foot-right { display: flex; gap: var(--sp-2); }

/* 記事の一覧 */
.webposts__main { min-width: 20em; max-width: 36em; }
.webposts__title { display: block; font-weight: 700; text-decoration: none; }
.webposts__sum { display: -webkit-box; margin-top: 2px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; font-size: var(--fs-xs); color: var(--c-text-sub); }
.webposts__at { font-variant-numeric: tabular-nums; }

/* トップのバナー */
.webbanners__list { margin: 0; padding: 0; list-style: none; }
.webbanners__row {
  display: grid;
  grid-template-columns: 1.5em auto minmax(0, 1fr) auto auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border-light);
}
.webbanners__row:last-child { border-bottom: 0; }
.webbanners__row.is-off > :not(.webbanners__on):not(.iconmove) { opacity: .45; }
.webbanners__no { font-weight: 700; color: var(--c-text-sub); text-align: center; font-variant-numeric: tabular-nums; }
.webbanners__text { display: grid; gap: 2px; min-width: 0; }
.webbanners__text > span { font-size: var(--fs-xs); color: var(--c-text-sub); overflow-wrap: anywhere; }
.webbanners__href { color: var(--c-text-mute); }
.webbanners .webedit__foot { margin-top: var(--sp-3); }

/* 項目のタブ（概要・お知らせ・マガジン・客室…）。10 個あるので、狭い幅では横にすべらせる */
.webtabs { display: flex; gap: var(--sp-1); margin: 0 0 var(--sp-3); overflow-x: auto; border-bottom: 1px solid var(--c-border); scrollbar-width: none; }
.webtabs::-webkit-scrollbar { display: none; }
.webtabs__item { flex: none; padding: var(--sp-2) var(--sp-3); border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--c-text-sub); font-size: var(--fs-md); text-decoration: none; white-space: nowrap; }
.webtabs__item:hover { color: var(--c-brand); }
.webtabs__item.is-active { border-bottom-color: var(--c-brand); color: var(--c-brand); font-weight: 700; }

/* 一覧の上の絞り込み（館・カテゴリ・サイト・検索） */
.webfilter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.webfilter__search { width: var(--w-webfilter-search); }
.webnote { margin: 0 0 var(--sp-3); }

/* 記事・客室の一覧 */
.webposts-layout { display: grid; gap: var(--sp-4); align-items: start; }
@media (min-width: 1600px) { .webposts-layout.has-side { grid-template-columns: minmax(0, 1fr) var(--w-webside); } }
.webposts-layout > .panel { margin: 0; }
.webposts__photo-h { width: var(--w-webthumb); }
.webposts__photo { width: var(--w-webthumb); }
.webposts__photo img { display: block; width: var(--w-webthumb); aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-xs); }
.webposts__cats { min-width: 8em; }
.webtag { display: inline-block; margin: 0 var(--sp-1) var(--sp-hair) 0; padding: 0 var(--sp-1); border: 1px solid var(--c-border); border-radius: var(--r-xs); font-size: var(--fs-xs); line-height: 1.6; white-space: nowrap; }
.webtag--plain { border-color: transparent; background: var(--c-bg-sub); color: var(--c-text-sub); }
.webrooms .webposts__main { min-width: 14em; }

/* よく読まれている記事（順位つき） */
.webrank { margin: 0; padding: 0; list-style: none; counter-reset: webrank; }
.webrank li { counter-increment: webrank; border-bottom: 1px solid var(--c-border-light); }
.webrank li:last-child { border-bottom: 0; }
.webrank a { display: grid; grid-template-columns: 1.5em var(--w-webthumb-sm) minmax(0, 1fr); gap: var(--sp-2); align-items: center; padding: var(--sp-2) 0; color: inherit; text-decoration: none; font-size: var(--fs-sm); line-height: 1.5; }
.webrank a::before { content: counter(webrank); font-weight: 800; color: var(--c-brand); text-align: center; font-variant-numeric: tabular-nums; }
.webrank a:hover span { color: var(--c-brand); }
.webrank img { width: var(--w-webthumb-sm); aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-xs); }
.webrank a:not(:has(img)) { grid-template-columns: 1.5em minmax(0, 1fr); }
.webstat--plain .webstat__n { color: var(--c-text); }

/* 画像を 1 枚選ぶ欄（_media.html の image_field） */
.webimg { display: flex; align-items: center; gap: var(--sp-3); }
.webimg__thumb { display: grid; place-items: center; flex: none; width: var(--w-webimg); aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--c-border-light); border-radius: var(--r-sm); background: var(--c-bg-sub); color: var(--c-text-mute); font-size: var(--fs-xs); }
.webimg__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.webimg__actions { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.webimg__actions [hidden] { display: none; }
.webimg--banner .webimg__thumb { width: var(--w-webthumb-lg); aspect-ratio: 16 / 9; }
.webimg--banner { flex-direction: column; align-items: flex-start; gap: var(--sp-1); }

/* 画像を選ぶモーダル（メディアの写真の一覧） */
.webpick .modal__body { display: grid; gap: var(--sp-3); }
.webpick__bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.webpick__search { flex: 1; min-width: 12em; }
.webpick__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--w-webpick), 1fr)); gap: var(--sp-2); max-height: var(--h-webpick); margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.webpick__grid [hidden] { display: none; }
.webpick__item { display: grid; gap: var(--sp-1); width: 100%; padding: var(--sp-1); border: 1px solid var(--c-border-light); border-radius: var(--r-sm); background: var(--c-bg); cursor: pointer; text-align: left; }
.webpick__item:hover { border-color: var(--c-brand); background: var(--c-brand-pale); }
.webpick__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-xs); }
.webpick__name { overflow: hidden; font-size: var(--fs-xs); color: var(--c-text-sub); white-space: nowrap; text-overflow: ellipsis; }
.webpick__empty, .webpick__note { margin: 0; font-size: var(--fs-xs); color: var(--c-text-mute); }
.webpick__empty[hidden] { display: none; }

/* 直す画面の欄（記事・客室・ページ・設定に共通） */
.webedit__live { margin-left: auto; font-size: var(--fs-xs); }
.webedit__label { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-sub); }
.webedit__hint { margin: 0; font-size: var(--fs-xs); color: var(--c-text-mute); }
.webedit__group { display: grid; gap: var(--sp-2); min-width: 0; margin: 0; padding: var(--sp-3) 0 0; border: 0; border-top: 1px solid var(--c-border-light); }
.webedit__group legend { float: left; width: 100%; margin-bottom: var(--sp-1); padding: 0; font-weight: 700; }
.webedit__row--3 { grid-template-columns: repeat(auto-fit, minmax(11em, 1fr)); }
.webedit__row .fieldrow--stack { min-width: 0; }
.webedit__slugwrap { display: flex; align-items: center; gap: var(--sp-1); }
.webedit__slugbase { font-size: var(--fs-sm); color: var(--c-text-mute); white-space: nowrap; }
.webedit__cats { display: grid; gap: var(--sp-1); margin: 0; padding: 0; border: 0; }
.webedit__cats legend { margin-bottom: var(--sp-1); padding: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-sub); }
.webedit__catrow { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.webedit__topic { width: auto; min-width: 9em; }
.fmap-switch label.fmap-switch__item { cursor: pointer; }
.fmap-switch label.fmap-switch__item input { position: absolute; opacity: 0; pointer-events: none; }
.webchecks { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.webedit__count { font-size: var(--fs-xs); color: var(--c-text-mute); }
.webedit__preview-title { align-self: center; font-size: var(--fs-sm); font-weight: 700; color: var(--c-text-sub); }
.webedit__theme { padding: var(--sp-3); border-radius: var(--r-sm); background: var(--c-bg-sub); font-size: var(--fs-sm); }
.webedit__theme p { margin: 0 0 var(--sp-1); }
.webedit__theme-h { font-weight: 700; }
.webedit__theme code { font-size: var(--fs-xs); }

/* 客室の写真（並べ替え・外す・足す） */
.webgallery { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.webgallery__item { position: relative; width: var(--w-webthumb-lg); margin: 0; }
.webgallery__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); }
.webgallery__item img { border: 2px solid transparent; }
.webgallery__item:first-child img { border-color: var(--c-brand); }
.webgallery__tools { display: flex; justify-content: center; gap: var(--sp-hair); margin-top: var(--sp-hair); }
.webgallery__btn { width: var(--h-btn-sm); height: var(--h-btn-sm); border: 0; border-radius: var(--r-xs); background: none; color: var(--c-text-sub); cursor: pointer; }
.webgallery__btn:hover { background: var(--c-brand-pale); color: var(--c-brand); }
.webgallery__add { display: grid; place-items: center; width: var(--w-webthumb-lg); aspect-ratio: 4 / 3; border: 1px dashed var(--c-border-strong); border-radius: var(--r-sm); background: var(--c-bg); color: var(--c-brand); font-size: var(--fs-sm); cursor: pointer; }
.webgallery__add:hover { background: var(--c-brand-pale); }

/* 客室のページの見え方（.webprev の中。公式サイトの目安なので、サイトの字の大きさで書く） */
.webroom__class { margin: 0 0 4px; font-size: 11px; color: var(--wp-sub); letter-spacing: .1em; }
.webroom__title { margin-bottom: 0; }
.webroom__en { margin: 0 0 14px; font-family: var(--wp-serif); font-size: 12px; color: var(--wp-sub); letter-spacing: .08em; }
.webroom__main { aspect-ratio: 16 / 9; overflow: hidden; background: var(--c-webprev-photo); }
.webroom__main img, .webroom__thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.webroom__thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 4px 0 18px; }
.webroom__thumbs img { aspect-ratio: 4 / 3; }
.webroom__type { margin: 0 0 6px; font-size: 12px; color: var(--wp-sub); }
.webroom__smoke { margin-left: 6px; padding: 0 6px; border: 1px solid var(--wp-line); font-size: 10px; }
.webroom__catch { margin: 0 0 6px; font-family: var(--wp-serif); font-size: 17px; font-weight: 600; line-height: 1.7; }
.webroom__desc { margin: 0 0 10px; font-size: 13px; line-height: 2; white-space: pre-line; }
.webroom__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.webroom__tags span { padding: 1px 10px; border: 1px solid var(--wp-line); border-radius: 999px; font-size: 11px; }
.webroom__spec { margin: 0 0 16px; border-top: 1px solid var(--wp-line); }
.webroom__spec > div { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--wp-line); font-size: 12px; }
.webroom__spec > div[hidden], .webroom__book[hidden], .webroom [hidden] { display: none; }
.webroom__spec dt { color: var(--wp-sub); }
.webroom__spec dd { margin: 0; white-space: pre-line; }
.webroom__book { margin: 0 0 16px; padding: 12px 14px; background: var(--c-webprev-photo); font-size: 12px; line-height: 1.9; }
.webroom__book p { margin: 0; white-space: pre-line; }
.webroom__reserve { margin: 0 0 18px; text-align: center; }
.webroom__reserve span { display: inline-block; padding: 10px 40px; background: var(--c-webprev-banner); color: var(--c-webprev-bg); font-size: 12px; letter-spacing: .1em; }
.webroom h2 { margin: 18px 0 6px; font-family: var(--wp-serif); font-size: 14px; font-weight: 600; }
.webroom__list { margin: 0; font-size: 12px; line-height: 1.9; }
.webroom__spa, .webroom__note { margin: 6px 0 0; font-size: 11px; color: var(--wp-sub); }
.webroom .webprev__mag { margin-top: 8px; }
.webedit__frame.is-sp .webroom__thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ページの一覧（館ごと） */
.webpages { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--w-webpagecol), 1fr)); gap: var(--sp-3); align-items: start; }
.webpages > .panel { margin: 0; }
.webpagelist { margin: 0; padding: 0; list-style: none; }
.webpagelist__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--c-border-light); }
.webpagelist__row:last-child { border-bottom: 0; }
.webpagelist__row.is-top { background: var(--c-bg-sub); }
.webpagelist__title { font-weight: 600; text-decoration: none; }
.webpagelist__url { grid-column: 1; font-size: var(--fs-xs); color: var(--c-text-mute); overflow-wrap: anywhere; }
.webpagelist__meta { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: var(--sp-1); }

/* 検索結果と共有の見え方（ページ・サイトの設定） */
.webserp { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--c-border-light); border-radius: var(--r-md); background: var(--c-bg); font-family: Arial, sans-serif; }
.webserp__site { display: grid; margin: 0 0 var(--sp-1); font-size: var(--fs-sm); color: var(--c-text); }
.webserp__site span { font-size: var(--fs-xs); color: var(--c-text-sub); overflow-wrap: anywhere; }
.webserp__title { margin: 0 0 var(--sp-1); font-size: var(--fs-xl); color: var(--c-serp-title); line-height: 1.4; }
.webserp__desc { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: var(--fs-sm); color: var(--c-text-sub); line-height: 1.6; }
.webshare { display: grid; overflow: hidden; border: 1px solid var(--c-border-light); border-radius: var(--r-md); background: var(--c-bg); }
.webshare__img { display: block; aspect-ratio: 1.91 / 1; background: var(--c-bg-sub); }
.webshare__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.webshare__body { display: grid; gap: var(--sp-hair); padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--c-border-light); }
.webshare__host { font-size: var(--fs-xs); color: var(--c-text-mute); text-transform: uppercase; }
.webshare__title { font-weight: 700; }
.webshare__desc { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; font-size: var(--fs-sm); color: var(--c-text-sub); }
[data-web-show][hidden] { display: none; }

/* メディア（写真の一覧と、選んだ写真の詳しいこと） */
.webmedia { display: grid; grid-template-columns: minmax(0, 1fr) var(--w-webmedia-detail); gap: var(--sp-4); align-items: start; }
.webmedia > .panel { margin: 0; }
.webmedia__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--w-webpick), 1fr)); gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.webmedia__item { display: block; overflow: hidden; border: 2px solid transparent; border-radius: var(--r-sm); }
.webmedia__item:hover { border-color: var(--c-border-strong); }
.webmedia__item.is-active { border-color: var(--c-brand); }
.webmedia__item img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.webmedia__detail { position: sticky; top: var(--sp-4); padding: var(--sp-3); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-bg); }
.webmedia__detail form { display: grid; gap: var(--sp-2); }
.webmedia__detail .fieldrow--stack { max-width: none; margin: 0; }
.webmedia__big img { display: block; width: 100%; max-height: var(--h-webmedia-big); object-fit: contain; border-radius: var(--r-sm); background: var(--c-bg-sub); }
.webmedia__facts { display: grid; gap: var(--sp-hair); margin: 0; font-size: var(--fs-xs); }
.webmedia__facts > div { display: grid; grid-template-columns: 5em minmax(0, 1fr); }
.webmedia__facts dt { color: var(--c-text-sub); }
.webmedia__facts dd { margin: 0; }
.webmedia__url { overflow-wrap: anywhere; color: var(--c-text-sub); }
.webmedia__uses-h { margin: 0; font-size: var(--fs-sm); font-weight: 700; }
.webmedia__uses { margin: 0; padding-left: var(--sp-4); font-size: var(--fs-sm); }
.webmedia__foot { display: flex; justify-content: flex-end; }

/* メニュー（上・下）。行は語と行き先、↑↓× */
.webmenus__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--sp-4); align-items: start; }
.webmenus__cols > .panel { margin: 0; }
.webmenu { display: grid; gap: var(--sp-1); margin: 0 0 var(--sp-2); padding: 0; list-style: none; counter-reset: webmenu; }
.webmenu__row { display: grid; grid-template-columns: 1.5em minmax(6em, .8fr) minmax(0, 1.4fr) auto; gap: var(--sp-1); align-items: center; counter-increment: webmenu; }
.webmenu__row::before { content: counter(webmenu); font-size: var(--fs-xs); color: var(--c-text-mute); text-align: center; font-variant-numeric: tabular-nums; }
.webmenu__url { color: var(--c-text-sub); font-size: var(--fs-sm); }
.webmenus .webedit__foot, .websettings .webedit__foot { margin-top: var(--sp-3); }
.websettings { display: grid; gap: var(--sp-3); max-width: var(--w-websettings); }
.websettings > .panel { margin: 0; }
.websettings .fieldrow--stack { max-width: none; }

@media (max-width: 1100px) {
  .webhome, .webedit { grid-template-columns: minmax(0, 1fr); }
  .webmedia, .webmenus__cols { grid-template-columns: minmax(0, 1fr); }
  .webmedia__detail { position: static; }
  .webedit__preview { position: static; }
  .webedit__frame { max-height: none; }
}
@media (max-width: 640px) {
  .webhome__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
  .webbanners__row { grid-template-columns: 1.5em minmax(0, 1fr) auto; }
  .webbanners__row .webimg { display: none; }
  .webbanners__on { grid-column: 2; }
}

/* ホームページ更新: パネルの中に縦に並ぶ欄の間（設定・お問い合わせ） */
.webedit__form .panel .fieldrow--stack, .websettings .panel .fieldrow--stack { margin: 0 0 var(--sp-3); }
.webedit__form .panel .fieldrow--stack:last-child, .websettings .panel .fieldrow--stack:last-child { margin-bottom: 0; }

/* ===================================================================== */
/* 業務連絡ボード（ログブック）と共用端末                                  */
/* ===================================================================== */

/* 書き込みの札（logbook/_entry_card.html）。罫線で区切り、影は付けない */
.entrylist {
  display: grid;
}

.entrycard {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border-light);
}

.entrycard:first-child {
  padding-top: 0;
}

.entrycard:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.entrycard.is-withdrawn .entrycard__body {
  color: var(--c-text-mute);
}

.entrycard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.entrycard__audience,
.entrycard__period {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.entrycard__period {
  font-weight: 600;
  color: var(--c-text);
}

.entrycard__body {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.entrycard__rooms {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.entrycard__label {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

/* 部屋番号（_components/data.html の chips）。部屋ごとに枠で区切り、狭ければ折り返す */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-hair) var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg-sub);
  font-size: var(--fs-sm);
  color: var(--c-text);
  white-space: nowrap;
}

.entrycard__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.entrycard__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.entrycard__done {
  color: var(--c-st-ok);
  font-weight: 600;
}

.entrycard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
}

.entrycard__actions form {
  display: contents;
}

.entrycard__confirmed {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-st-ok);
}

/* あなたへの連絡（logbook/me.html）と待ち受け。管理の画面の灰の帯の欄はやめ、
   あいさつと、人から手渡されるメモを縦に並べる */
.greeting {
  max-width: var(--w-letters);
  margin: var(--sp-2) auto var(--sp-5);
  text-align: center;   /* あいさつは左右の真ん中 */
}

.greeting__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
}

.greeting__hello {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.4;
  color: var(--c-text);
}

.greeting__name {
  font-size: var(--fs-3xl);   /* 名前だけ大きく */
}

.greeting__nowrap {
  white-space: nowrap;   /* 狭い画面では「、」のあとで折り返す（「す」だけが次の行に落ちないように） */
}

/* 案内の一言はふきだし。紺の地に白い字で目立たせ、件数は黄色で大きく。
   下の三角で、下に並ぶ連絡を指す */
.greeting__lead {
  position: relative;
  display: inline-block;
  margin: var(--sz-bubble-tail) 0;   /* 下の三角のぶんを上にも取り、あいさつと高さの真ん中をそろえる */
  /* 文（読んでほしい連絡が・件あります。）をふきだしの上下の真ん中に置く。上下の余白は同じ。
     大きい数字は行の高さに入れず（line-height: 0）、字の下にそろえて上にはみ出させる。
     LINE Seed JP は字が枠の少し上に寄るので、0.05em だけ下げて見た目の真ん中に合わせる */
  padding: calc(var(--sp-4) + 0.05em + var(--sz-bubble-nudge)) var(--sp-5) calc(var(--sp-4) - 0.05em - var(--sz-bubble-nudge));
  background: var(--c-brand);
  border-radius: var(--r-bubble);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.6;
  color: var(--c-text-inv);
}

/* 出すときにポップアップする。三角の根元（左下）から大きくなる。動きを減らす設定では出すだけ */
.greeting__lead {
  transform-origin: calc(var(--sp-6) + var(--sz-bubble-tail)) 100%;
  animation: greeting-bubble-pop var(--dur-bubble-pop) var(--ease-bubble-pop) var(--delay-bubble-pop) both;
}

@keyframes greeting-bubble-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .greeting__lead {
    animation: none;
  }
}

/* 共用端末の大きい字では、下げなくても見た目の真ん中に来る（測って合わせた） */
.is-terminal .greeting__lead {
  padding-top: calc(var(--sp-4) + var(--sz-bubble-nudge));
  padding-bottom: calc(var(--sp-4) - var(--sz-bubble-nudge));
}

.greeting__lead::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--sp-6);
  border: var(--sz-bubble-tail) solid transparent;
  border-bottom: 0;
  border-top-color: var(--c-brand);
}

.greeting__count {
  font-size: var(--fs-3xl);   /* 数字だけ大きく。まわりの字とは下（ベースライン）でそろえる */
  line-height: 0;             /* 行の高さは文の字で決める。文はふきだしの上下の真ん中、数字は字の下にそろえて上にはみ出す */
  font-weight: 800;
  color: var(--c-ch-4-alt);   /* ロゴの黄。紺の地で 9:1 */
}

.letterbox {
  width: 100%;   /* グリッドの中（待ち受け）でも、本文が短い欄だけ細くならないように */
  max-width: var(--w-letters);
  margin: 0 auto var(--sp-6);   /* カードは左右の真ん中 */
}

/* 必読の束。右上の角に件数の赤い丸（LINE の未読の数と同じ形）。丸の上半分のぶん、上を空ける */
.letterbox--deck {
  padding-top: calc(var(--sz-deck-badge) * 0.8);
}

.letterdeck__anchor {
  position: relative;
}

.deckbadge {
  position: absolute;
  top: calc(var(--sz-deck-badge) * -0.8);   /* ほとんど束の上に出し、三角だけが札の角にかかる（札の頭の字にかけない） */
  right: calc(var(--sz-deck-badge) / -3);
  z-index: 20;
  width: var(--sz-deck-badge);
  height: var(--sz-deck-badge);
  color: var(--c-text-inv);
  font-weight: 800;
  line-height: 1;
  transform-origin: 10% 95%;
  animation: greeting-bubble-pop var(--dur-bubble-pop) var(--ease-bubble-pop) var(--delay-bubble-pop) both;
}

/* 字は丸の中心（形の 46% の高さ）にそろえる */
.deckbadge__text {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  translate: 0 -50%;
}

/* 丸と左下の三角を、1 本の線で囲んだひとつの形にする（白いふちが途切れない） */
.deckbadge__shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(var(--shadow-badge));
}

.deckbadge__shape path {
  fill: var(--c-st-ng);
  stroke: var(--c-bg);
  stroke-width: 3px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  paint-order: stroke;
}

.deckbadge__pre {
  font-size: var(--fs-sm);
}

.deckbadge__n {
  font-size: var(--fs-2xl);
  font-variant-numeric: tabular-nums;
}

.deckbadge.is-pop {
  animation: greeting-bubble-pop var(--dur-bubble-pop) var(--ease-bubble-pop) both;
}

@media (prefers-reduced-motion: reduce) {
  .deckbadge,
  .deckbadge.is-pop { animation: none; }
}

.letterbox__title {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-text-sub);
}

/* 必ず読んでくださいの束（十勝川の「まとめて決裁」の紙の束にならう）。
   全部の札を同じ升に重ね（升の高さ = いちばん高い札）、奥の札ほど下にずらし、細く、濃くする。
   上の 1 枚だけが中身を見せ、奥は縁だけ。動きは logbook-deck.js（右へはらう・飛ぶ・繰り上がる） */
.letterdeck {
  --k: 0;
  display: grid;
  padding-bottom: calc(var(--sz-stack-offset) * var(--k));
}

.letterdeck--1 { --k: 1; }
.letterdeck--2 { --k: 2; }
.letterdeck--3 { --k: 3; }

.letterdeck > .letter {
  --depth: 0;
  grid-area: 1 / 1;
  align-self: start;      /* 束の高さは上の札の高さ。奥の札は、上の札と同じ高さにする（JS が --deck-top-h を測る） */
  align-content: start;
  z-index: calc(10 - var(--depth));
  box-shadow: var(--shadow-stack);
  transform-origin: 50% 100%;
  translate: 0 calc(var(--sz-stack-offset) * var(--depth));
  scale: calc(1 - var(--depth) * var(--stack-shrink)) 1;
  transition: translate var(--dur-deck) var(--ease-deck), scale var(--dur-deck) var(--ease-deck),
    background-color var(--dur-deck) ease-in-out, transform var(--dur-deck) var(--ease-deck),
    opacity var(--dur-deck) ease-in-out;
}

.letterdeck > .letter--depth-1 { --depth: 1; background: var(--c-stack-1); }
.letterdeck > .letter--depth-2 { --depth: 2; background: var(--c-stack-2); }
.letterdeck > .letter--depth-3 { --depth: 3; background: var(--c-stack-2); opacity: 0; }

/* 奥の札は縁だけ。中身は見せない。高さは上の札にそろえ、はみ出す中身は切る */
.letterdeck > .letter:not(.is-top) {
  height: var(--deck-top-h, auto);
  overflow: hidden;
  pointer-events: none;
  border-color: var(--c-border-strong);
}

.letterdeck > .letter:not(.is-top) > * { visibility: hidden; }

/* 上の札は指で左・右・上にはらえる。上にもはらうので、札の上では縦のスクロールに指を渡さない */
.letterdeck > .letter.is-top { touch-action: none; user-select: none; cursor: grab; }
.letterdeck > .letter.is-dragging { cursor: grabbing; transition: none; }
.letterdeck > .letter.is-flying {
  opacity: 0;
  transition-duration: var(--dur-deck-fly);
}

/* はらった向きへ飛んでいく（ボタンとキーは右） */
.letterdeck > .letter.is-flying.to-right { transform: translateX(120%) rotate(12deg); }
.letterdeck > .letter.is-flying.to-left { transform: translateX(-120%) rotate(-12deg); }
.letterdeck > .letter.is-flying.to-up { transform: translateY(-120%); }

/* 束の下の丸いボタン（十勝川の「まとめて決裁」の承認の丸にならう）。丸の中にチェック、下に「チェックしました！」 */
.letterdeck__actions {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-4);
}

.deckbtn {
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-st-ok);
  font: inherit;
  cursor: pointer;
}

.deckbtn__circle {
  display: grid;
  place-items: center;
  width: var(--sz-deck-btn);
  height: var(--sz-deck-btn);
  border-radius: 50%;
  background: var(--c-st-ok);
  color: var(--c-text-inv);
  box-shadow: var(--shadow-stack);
  transition: transform var(--dur-deck) var(--ease-bubble-pop);
}

.deckbtn__circle svg {
  width: 50%;
  height: 50%;
}

.deckbtn__label {
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;   /* 1 行で出す */
}

.deckbtn:hover .deckbtn__circle {
  transform: scale(1.06);
}

.deckbtn:active .deckbtn__circle {
  transform: scale(0.94);
}

.deckbtn:focus-visible {
  outline: none;
}

.deckbtn:focus-visible .deckbtn__circle {
  outline: 3px solid var(--c-brand);
  outline-offset: 3px;
}

/* はらっているあいだ、右上に「読みました」の印が濃くなる（JS が --seal に 0〜1 を入れる） */
.letter__seal {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 1;
  padding: 0 var(--sp-2);
  border: 3px solid currentColor;
  border-radius: var(--r-sm);
  color: var(--c-stamp-ok);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.5;
  rotate: 10deg;
  opacity: var(--seal, 0);
  pointer-events: none;
}

/* 開いたとき、奥の札から順に上から落ちて積み重なる（重なりのずれとは別の transform で動かす） */
.letterdeck > .letter.is-entering {
  animation: letter-deck-enter var(--dur-deck-enter) var(--ease-bubble-pop) var(--enter-delay, 0ms) both;
}

@keyframes letter-deck-enter {
  0% { opacity: 0; transform: translateY(calc(var(--sz-stack-offset) * -5)) rotate(-4deg); }
  60% { opacity: 1; }
  100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .letterdeck > .letter { transition: none; }
  .letterdeck > .letter.is-entering { animation: none; }
}

.letters {
  display: grid;
  gap: var(--sp-3);
}

.letter {
  position: relative;
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-bg);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
}

.letter.is-withdrawn .letter__body {
  color: var(--c-text-mute);
  text-decoration: line-through;
}

/* 種類のラベル（お知らせ・引き継ぎ・予定・マニュアル）。色を塗った札。色は状態の色と同じ割り当て（KIND_TONES） */
.kindlabel {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-hair) var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--c-st-none);
  color: var(--c-text-inv);
  font-size: var(--fs-md);
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.kindlabel--progress { background: var(--c-st-progress); }
.kindlabel--draft { background: var(--c-st-draft); }
.kindlabel--ok { background: var(--c-st-ok); }
.kindlabel--none { background: var(--c-st-none); }

.kindlabel--sm {
  padding: 0 var(--sp-2);
  font-size: var(--fs-xs);
}

/* 札の左上の角に置く。角の丸みは札に合わせ、反対の角だけ小さく丸める */
.letter__kindtag {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--r-md-inner) 0 var(--r-sm) 0;
}

/* 角のラベルの下から名前を始める */
.letter:has(> .letter__kindtag) {
  padding-top: calc(var(--sp-4) + var(--fs-md) * 1.5);
}

/* 枠の無い所（メールの右の全文）では、縁にかけずに名前の上に置く */
.mailbox__read > .letter > .letter__kindtag {
  position: static;
  justify-self: start;
  border-radius: var(--r-sm);
}

.mailbox__read > .letter:has(> .letter__kindtag) {
  padding-top: 0;
}

/* だれから。名前を先に、太く。時刻は小さく横に */
.letter__from {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
}

.letter__who {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-text);
}

.letter__when {
  font-size: var(--fs-md);
  color: var(--c-text-sub);
  translate: 0 -0.15em;   /* 小さい字は下に寄って見えるので、「さんからのメッセージ」と字の高さをそろえる（測って合わせた） */
}

/* 差出人の名前だけ大きく（「さんからのメッセージ」はふつうの大きさ） */
.letter__name {
  font-size: var(--fs-2xl);
  line-height: 1.2;
}

.letter__period {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-brand-dark);
}

/* 本文はふきだし。左上の三角で、上の「〇〇さんからのメッセージ」を指す */
.letter__body {
  position: relative;
  /* 札の行のあいだ（--sp-3）に三角が入るように詰め、三角の先を名前のすぐ下に置く */
  margin-top: calc(var(--sz-bubble-tail) - var(--sp-2));
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-bubble);
  background: var(--c-msg-bg);
  font-size: var(--fs-lg);
  font-weight: 700;   /* 本文は太字（試し） */
  line-height: var(--lh-letter);
  color: var(--c-text);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.letter__body::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: var(--sp-5);
  border: var(--sz-bubble-tail) solid transparent;
  border-top: 0;
  border-bottom-color: var(--c-msg-bg);
}

.letter__rooms {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.letter__label {
  font-size: var(--fs-md);
  color: var(--c-text-sub);
}

.letter__done {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-st-ok);
}

/* コメント必須の札の、ひとこと書く欄（GLIQ-520） */
.letter__ask {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.letter__ask-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-st-ng);
}

.letter__ask-note {
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--c-text-sub);
}

.letter__ask-input {
  width: 100%;
  min-height: 5.5em;
  font-size: var(--fs-lg);
  resize: vertical;
}

/* 相談して出したとき（GLIQ-521）。書いた人と出した人が違う */
.letter__publisher {
  font-size: var(--fs-md);
  color: var(--c-text-sub);
}

/* 自分の画面の相談の帯（GLIQ-521）。来ているものは目立たせ、出しているものは控えめに */
.consultband {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  border: 2px solid var(--c-brand);
  background: var(--c-brand-pale);
}

.consultband--out {
  border-width: 1px;
  border-color: var(--c-border);
  background: var(--c-bg);
}

.consultband__title {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-md);
  font-weight: 800;
}

.consultband__n {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 var(--sp-1);
  border-radius: 999px;
  background: var(--c-brand);
  color: #fff;
  text-align: center;
}

.consultband__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.consultband__link {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  color: inherit;
  text-decoration: none;
}

.consultband__link:hover .consultband__body {
  text-decoration: underline;
}

.consultband__body {
  flex: 1 1 20em;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-brand);
}

.consultband__who {
  font-size: var(--fs-md);
  color: var(--c-text-sub);
}

.consultpick__people {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-2);
}

.consultnote {
  margin: var(--sp-3) 0;
}

.letter__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
}

.letter__actions form {
  display: contents;
}

/* 「取り消す」は段の右の端に（読みましたやリアクションと離して、押し間違えないように） */
.letter__actions form.letter__undo {
  display: block;
  order: 10;
  margin-left: auto;
}

/* 「読みました」の左のチェック。字と同じ色、字の高さにそろえる */
.letter__confirmed,
.mailrow__done {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.letter__confirmed .check,
.mailrow__done .check {
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
}

.letter__confirmed {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-st-ok);
}

/* 絵文字のリアクション。丸いつまみに絵文字と数。自分が付けたものは紺の淡い地と枠 */
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.reactions form {
  display: contents;
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-width: var(--sz-reaction);
  height: var(--sz-reaction);
  padding: 0 var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  cursor: pointer;
  transition: background-color var(--dur-deck) ease-in-out, border-color var(--dur-deck) ease-in-out;
}

.reaction:hover {
  border-color: var(--c-brand);
}

.reaction.is-mine {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

.reaction:focus-visible {
  outline: 3px solid var(--c-brand);
  outline-offset: 2px;
}

.reaction__emoji {
  font-size: var(--fs-lg);
  line-height: 1;
}

.reaction__n {
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-brand-dark);
}

.reaction__n:empty {
  display: none;
}

.reaction.is-pop .reaction__emoji {
  animation: reaction-pop var(--dur-bubble-pop) var(--ease-bubble-pop);
}

@keyframes reaction-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .reaction.is-pop .reaction__emoji { animation: none; }
}

.letter__more {
  margin-left: auto;
  font-size: var(--fs-md);
}

/* 狭い画面では「読みました」を横いっぱいにして、押し損じを無くす */
@media (max-width: 767px) {
  .deckbadge {
    right: 0;   /* 画面の右の端からはみ出さない */
  }

  .greeting__name {
    font-size: var(--fs-2xl);
  }

  /* ふきだしの文を 1 行に収める（数字を一段小さくし、左右の余白を詰める） */
  .greeting__lead {
    padding-right: var(--sp-4);
    padding-left: var(--sp-4);
  }

  .greeting__count {
    font-size: var(--fs-2xl);
  }

  .letter {
    padding: var(--sp-4);
  }

  .letter__actions .btn-primary {
    width: 100%;
  }

  .letter__more {
    margin-left: 0;
  }
}

/* あなたへの連絡のメールの箱（logbook-mailbox.js）。上に大きなタブ、PC は左に一覧・右に全文。
   スマホは一覧だけを出し、押すと全文を画面いっぱいに出す（.is-reading） */
/* 舞台。メーラーを画面いっぱいに置き、必読が残っているあいだは、その上にあいさつと束を重ねる */
.mestage {
  position: relative;
  /* 本文の余白（.main の上・左右・下）まで広げて、メーラーを画面いっぱいに敷く */
  margin: calc(var(--sp-4) * -1) calc(var(--main-pad-x) * -1) calc(var(--main-pad-bottom) * -1);
  height: var(--h-me-stage);
}

.mestage.is-empty {
  display: grid;
  align-content: center;
}

.mestage__over {
  position: absolute;
  inset: 0;   /* 舞台は画面の端まで広がっているので、重ねも端まで届く */
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-4) var(--sp-5);
  /* 後ろのメーラーは、重ねの面がぼかす（メーラーそのものをぼかすと、縁がにじんで切れて見える） */
  background: color-mix(in srgb, var(--c-bg-sub) 55%, transparent);
  backdrop-filter: blur(var(--mestage-blur));
  -webkit-backdrop-filter: blur(var(--mestage-blur));
}

/* 必読を重ねている画面は、本文全体のフェードインをしない（layout.css）。代わりに重ねの中身だけをふわっと出す */
.mestage__center {
  animation: td-page-in var(--dur-page) ease-in-out both;
}

@media (prefers-reduced-motion: reduce) {
  .mestage__center { animation: none; }
}

/* あいさつと束を、上下の真ん中に置く。収まらなければ上から並べて送る */
.mestage__center {
  width: 100%;
  margin: auto 0;
}

/* 重ねの中では、あいさつと束のあいだを詰める（束の上には「あと 3」のぶんの余白がある） */
.mestage__over .greeting {
  margin: 0 auto var(--sp-2);
}

.mestage.has-required > .mailbox {
  pointer-events: none;
  user-select: none;
}

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

.mailbox__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.mailbox__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* タブの段の探す欄。丸い枠に虫めがね */
.mailbox__search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 1 var(--w-mail-search);
  min-width: 0;
  height: var(--h-mail-tab);   /* タブと上下をそろえる */
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-text-sub);
}

.mailbox__search:focus-within {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-pale);
}

.mailbox__search svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.mailbox__search-input {
  flex: 1 1 auto;
  font-size: var(--fs-lg);
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--c-text);
  font: inherit;
}

/* 探す欄の右の「くわしく探す」（期間や種類で探す画面へ） */
.mailbox__more {
  flex: 0 0 auto;
  font-size: var(--fs-md);
  color: var(--c-brand);
  white-space: nowrap;
}

/* 読むものが無い日の、あいさつの下の「前の連絡を探す」 */
.greeting__more {
  margin: var(--sp-4) 0 0;
}

.mailbox__none {
  margin: 0;
  padding: var(--sp-5) var(--sp-4);
  color: var(--c-text-sub);
}

/* タブの段の右上のあいさつ */
.mailbox__hello {
  margin: 0 0 0 auto;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
}

.mailbox__hello-name {
  margin-right: var(--sp-hair);
  font-size: var(--fs-xl);
}

.mailbox__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--h-mail-tab);
  padding: 0 var(--sp-4);
  line-height: 1.5;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-lg);
  font-weight: 700;
  cursor: pointer;
}

.mailbox__tab.is-active {
  border-color: var(--c-brand);
  background: var(--c-brand);
  color: var(--c-text-inv);
}

.mailbox__tab-n {
  min-width: 1.6em;
  padding: 0 var(--sp-1);
  border-radius: 999px;
  background: var(--c-bg-sub);
  color: var(--c-text);
  font-size: var(--fs-md);
  text-align: center;
}

.mailbox__tab.is-active .mailbox__tab-n {
  background: var(--c-bg);
  color: var(--c-brand-dark);
}

.mailbox__body {
  display: grid;
  grid-template-columns: var(--w-maillist) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--c-bg);
}

.mailbox__list {
  overflow-y: auto;
  border-right: 1px solid var(--c-border);
}

.mailbox__rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mailrow {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border-light);
  color: var(--c-text);
  text-decoration: none;
}

.mailrow:hover {
  background: var(--c-row-hover);
}

/* 読んだもの（Gmail の既読と同じ）。地の色は変えず（乗せたときの色とまぎれないように）、字を細く薄くする。
   まだのものは太字で濃いまま */
.mailrow.is-read .mailrow__who {
  font-weight: 400;
  color: var(--c-text-sub);
}

.mailrow.is-read .mailrow__text {
  color: var(--c-text-mute);
}

.mailrow.is-read .kindlabel {
  opacity: 0.6;
}

/* まだ読んでいないものは、本文の頭も濃く */
.mailrow:not(.is-read) .mailrow__text {
  color: var(--c-text);
}

.mailrow.is-active {
  background: var(--c-brand-pale);
  box-shadow: inset 4px 0 0 var(--c-brand);
}

.mailrow__top {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.mailrow__who {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.mailrow__san {
  margin-left: var(--sp-hair);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.mailrow__when {
  margin-left: auto;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
  white-space: nowrap;
}

.mailrow__period {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-brand-dark);
}

.mailrow__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--c-text-sub);
}

.mailrow__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.mailrow__done {
  font-weight: 700;
  color: var(--c-st-ok);
}

/* 右の全文。札の枠は外し、写真とコメントを下に続ける */
.mailbox__pane {
  overflow-y: auto;
}

.mailbox__pane-head {
  display: none;
}

.mailbox__read {
  padding: var(--sp-5);
}

.mailbox__read > .letter {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.mailbox__extra {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border-light);
}

.mailbox__hint {
  margin: 0;
  color: var(--c-text-sub);
}

@media (max-width: 767px) {
  .mailbox__body {
    display: block;
    overflow-y: auto;
  }

  .mailbox__list {
    border-right: 0;
  }

  .mailbox__pane {
    display: none;
  }

  /* 押したら、全文を画面いっぱいに出す。上に大きな「もどる」 */
  .mailbox.is-reading .mailbox__pane {
    position: fixed;
    inset: var(--h-header) 0 0;
    z-index: 30;
    display: block;
    background: var(--c-bg);
  }

  .mailbox.is-reading .mailbox__pane-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: block;
    padding: var(--sp-2) var(--sp-4);
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
  }

  .mailbox__read {
    padding: var(--sp-4);
  }
}

.mailbox__back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-lg);
  font-weight: 700;
  cursor: pointer;
}

.mailbox__back::before {
  content: "‹";
  font-size: 1.4em;
  line-height: 1;
}

/* 右下の丸いボタン（連絡を書く・連絡を探す）。舞台の右下に置き、必読の重ねより上に出す */
.mefab {
  position: absolute;
  right: var(--sp-4);   /* 舞台は画面の端まで広がっているので、そのまま右下の角 */
  bottom: var(--sp-4);
  z-index: 10;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-4);
}

/* 舞台の無い画面（確認の状況）では、画面の右下に止める */
.mefab--fixed {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
}

/* その画面の終わりが、丸いボタンに隠れないように */
.stboard {
  padding-bottom: calc(var(--sz-mefab) + var(--sp-6));
}

.mefab__btn {
  display: grid;
  justify-items: center;
  gap: var(--sp-1);
  color: var(--c-text);
  text-decoration: none;
}

.mefab__circle {
  display: grid;
  place-items: center;
  width: var(--sz-mefab);
  height: var(--sz-mefab);
  border-radius: 50%;
  background: var(--c-brand);
  color: var(--c-text-inv);
  box-shadow: var(--shadow-stack);
  transition: transform var(--dur-deck) var(--ease-bubble-pop);
}

.mefab__circle--sub {
  background: var(--c-bg);
  color: var(--c-brand);
  border: 2px solid var(--c-brand);
}

.mefab__circle svg {
  width: 45%;
  height: 45%;
}

.mefab__label {
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
}

.mefab__btn:hover .mefab__circle { transform: scale(1.06); }
.mefab__btn:active .mefab__circle { transform: scale(0.94); }
.mefab__btn:focus-visible { outline: none; }
.mefab__btn:focus-visible .mefab__circle { outline: 3px solid var(--c-brand); outline-offset: 3px; }

/* 一覧の最後の行と全文の最後（コメントを送る）が、丸いボタンに隠れないように */
.mailbox__read,
.mailbox__rows {
  padding-bottom: calc(var(--sz-mefab) + var(--sp-6));
}

/* 連絡を書くモーダル（logbook-write-modal.js）。書く画面のフォームを、欄の枠と帯を外して出す。
   下に「やめる」「送る」を止めておく。スマホでは画面いっぱいのシート */
/* 項目ごとの区切り。見出しは太字、欄は横いっぱい */
.wm__sheet {
  display: grid;
  gap: var(--sp-5);
}

.wm__sec {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
}

.wm__sec[hidden] {
  display: none;
}

.wm__label {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--c-text);
}

.wm__note {
  margin-left: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--c-text-mute);
}

/* 種類: 色の付いたつまみ。選ぶと、その種類の色で塗る */
.wm__kinds,
.wm__seg {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.wm__kind,
.wm__seg-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--h-mail-tab);
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  font-weight: 700;
  cursor: pointer;
}

.wm__kind input,
.wm__seg-item input,
.wm__person input,
.wm__switch input,
.wm__file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wm__kind:has(input:focus-visible),
.wm__seg-item:has(input:focus-visible),
.wm__person:has(input:focus-visible),
.wm__switch:has(input:focus-visible),
.wm__photo:has(input:focus-visible) {
  outline: 3px solid var(--c-brand);
  outline-offset: 2px;
}

.wm__kind:has(input:checked) {
  border-color: transparent;
  color: var(--c-text-inv);
}

.wm__kind--progress:has(input:checked) { background: var(--c-st-progress); }
.wm__kind--draft:has(input:checked) { background: var(--c-st-draft); }
.wm__kind--ok:has(input:checked) { background: var(--c-st-ok); }
.wm__kind--none:has(input:checked) { background: var(--c-st-none); }

.wm__seg-item:has(input:checked) {
  border-color: var(--c-brand);
  background: var(--c-brand);
  color: var(--c-text-inv);
}

.wm__body,
.wm__input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-lg);
  line-height: 1.7;
}

.wm__body {
  resize: vertical;
  min-height: 8em;
}

.wm__body:focus,
.wm__input:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-pale);
}

/* 写真: 点線の枠。選んだら、小さな写真と名前と × */
.wm__photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px dashed var(--c-border);   /* 点線は細く淡く。乗せると紺 */
  border-radius: var(--r-md);
  color: var(--c-brand);
  font-weight: 700;
  cursor: pointer;
}

.wm__photo:hover {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

.wm__photo[hidden],
.wm__preview[hidden] {
  display: none;
}

.wm__photo svg {
  width: 22px;
  height: 22px;
}

.wm__preview {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}

.wm__preview img {
  width: var(--sz-lm-send);
  height: var(--sz-lm-send);
  border-radius: var(--r-sm);
  object-fit: cover;
}

.wm__preview img[hidden] {
  display: none;
}

.wm__preview-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm__preview-x {
  display: grid;
  place-items: center;
  width: var(--sz-reaction);
  height: var(--sz-reaction);
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-bg);
  color: var(--c-text-sub);
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
}

/* だれに送る: 人を選ぶときの人の一覧（勤務ごと）。押した人は紺で塗る */
.wm__people {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
}

.wm__people[hidden] {
  display: none;
}

.wm__people .recipientpick__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.wm__people .recipientpick__label {
  min-width: 4em;
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.wm__person {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  cursor: pointer;
}

.wm__person:has(input:checked) {
  border-color: var(--c-brand);
  background: var(--c-brand);
  color: var(--c-text-inv);
}

/* 必ず読んでもらう: 横に滑るスイッチと、説明 */
.wm__switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
}

/* 必ず読んでもらうの下に出す、コメントも書いてもらう（GLIQ-520）。少し右に下げて、従うものと分かるように */
.wm__switch--sub {
  margin-left: var(--sp-5);
}

/* display: flex が hidden 属性に勝つので、隠すときは明示する */
.wm__switch[hidden],
.wm__when[hidden],
.wm__people[hidden] {
  display: none;
}

.wm__hint {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-md);
  color: var(--c-text-sub);
}

.wm__hint[hidden] {
  display: none;
}

/* いま気をつけること（GLIQ-522）。待ち受けと自分の画面のいちばん上の帯。貼り紙の代わりに、遠くからでも目に入る黄色 */
.hlband {
  margin: 0 0 var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border: 2px solid #d9a400;
  border-radius: var(--r-lg, 12px);
  background: #fff6d6;
  color: #3d2e00;
}

.hlband__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-lg);
  font-weight: 800;
}

.hlband__title svg {
  width: 22px;
  height: 22px;
  color: #b07f00;
}

.hlband__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hlband__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-4);
}

.hlband__body {
  flex: 1 1 20em;
  font-size: var(--fs-xl, 1.35rem);
  font-weight: 800;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* 自分の画面の帯は薄く。見出しと本文を 1 行に並べる */
.hlband--compact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-4);
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
}

.hlband--compact .hlband__title {
  margin: 0;
  font-size: var(--fs-md);
}

.hlband--compact .hlband__list {
  flex: 1 1 24em;
  gap: var(--sp-1);
}

.hlband--compact .hlband__body {
  font-size: var(--fs-lg);
}

.hlband__when {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #6b5300;
  white-space: nowrap;
}

.wm__switch:has(input:checked) {
  border-color: var(--c-st-ng);
  background: var(--c-st-ng-bg);
}

.wm__switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--c-border-strong);
  transition: background-color var(--dur-deck) ease-in-out;
}

.wm__switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-bg);
  box-shadow: var(--shadow-badge);
  transition: translate var(--dur-deck) var(--ease-deck);
}

.wm__switch:has(input:checked) .wm__switch-track {
  background: var(--c-st-ng);
}

.wm__switch:has(input:checked) .wm__switch-track::after {
  translate: 18px 0;
}

.wm__switch-text {
  display: grid;
  gap: var(--sp-hair);
}

.wm__switch-text span {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

/* 予定の日時: 始まり から 終わり まで */
.wm__when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.wm__when .wm__input {
  width: auto;
  flex: 1 1 14rem;
}

.wm__when-sep {
  color: var(--c-text-sub);
}

.wm__foot {
  position: sticky;
  bottom: calc(var(--sp-4) * -1);
  display: flex;
  justify-content: center;   /* やめる・送るは真ん中に、同じ大きさで */
  gap: var(--sp-3);
  margin: var(--sp-4) calc(var(--sp-4) * -1) calc(var(--sp-4) * -1);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg);
  border-top: 1px solid var(--c-border-light);
}

.wm__foot .btn {
  min-width: var(--w-wm-btn);
  justify-content: center;
}

/* 書くモーダルは高さを決めておく（予定を選んで欄が増えても、枠は伸び縮みさせず、中を送る） */
.modal__box--sheet {
  display: flex;
  flex-direction: column;
  height: var(--h-write-modal);
}

.modal__box--sheet .modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 767px) {
  .modal:has(.modal__box--sheet) {
    padding: 0;
  }

  .modal__box--sheet {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .modal__box--sheet .modal__head {
    border-radius: 0;
  }

  .wm__foot .btn {
    flex: 1 1 0;
  }
}

/* 写真とコメント（logbook-detail-modal.js が組み立てる。モーダルと、メールの右の全文の下で同じ形）。
   写真は小さく並べ、「写真をつける」は大きな点線の枠。コメントはふきだしで、下に名前と時刻。
   書く欄は丸い枠に、右に丸い送るボタン */
.lm {
  display: grid;
  gap: var(--sp-5);
}

/* くわしく（確認の状況から）: 上に札の頭と本文の全文。下に写真とコメント */
.lm__letter {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border-light);
}

.stcard__msg.is-full .stcard__body {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.lm__loading {
  margin: 0;
  color: var(--c-text-sub);
}

.lm__sec {
  display: grid;
  gap: var(--sp-3);
}

.lm__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 800;
}

.lm__count {
  min-width: 1.6em;
  padding: 0 var(--sp-1);
  border-radius: 999px;
  background: var(--c-bg-sub);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
  text-align: center;
}

.lm__photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--sz-lm-photo), 1fr));
  gap: var(--sp-2);
}

.lm__photo {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-bg-sub);
}

.lm__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lm__file {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--sp-1);
  aspect-ratio: 1;
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-sub);
  font-size: var(--fs-xs);
  text-align: center;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.lm__file svg {
  width: 28px;
  height: 28px;
}

/* 写真をつける: 点線の大きな枠。押すと写真を選ぶ画面が開き、選ぶとそのまま送る */
.lm__add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px dashed var(--c-border);   /* 点線は細く淡く。乗せると紺 */
  border-radius: var(--r-md);
  color: var(--c-brand);
  font-weight: 700;
  cursor: pointer;
}

.lm__add:hover {
  border-color: var(--c-brand);
  background: var(--c-brand-pale);
}

.lm__add:focus-within {
  outline: 3px solid var(--c-brand);
  outline-offset: 2px;
}

.lm__add.is-busy {
  pointer-events: none;
  opacity: 0.6;
}

.lm__add svg {
  width: 22px;
  height: 22px;
}

.lm__fileinput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lm__comments {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.lm__comment {
  display: grid;
  gap: var(--sp-1);
  justify-items: start;
}

.lm__bubble {
  max-width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-bubble);
  border-top-left-radius: var(--r-xs);
  background: var(--c-msg-bg);
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.lm__meta {
  padding-left: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.lm__empty {
  margin: 0;
  color: var(--c-text-sub);
}

.lm__compose {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
}

.lm__input {
  flex: 1 1 auto;
  min-height: var(--sz-lm-send);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-bubble);
  background: var(--c-bg);
  color: var(--c-text);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
}

.lm__input:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-pale);
}

.lm__send {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--sz-lm-send);
  height: var(--sz-lm-send);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c-brand);
  color: var(--c-text-inv);
  cursor: pointer;
}

.lm__send:disabled {
  opacity: 0.5;
  cursor: default;
}

.lm__send:focus-visible {
  outline: 3px solid var(--c-brand);
  outline-offset: 2px;
}

.lm__send svg {
  width: 50%;
  height: 50%;
}

/* 確認の状況（logbook/status.html）。必読ごとの札。まだの人を赤い枠で大きく、読んだ人は薄く。
   上に「読んだ人 2 / 7 人」の帯 */
.stboard {
  display: grid;
  gap: var(--sp-4);
  max-width: var(--w-letters);
  margin: 0 auto;
}

.stboard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;   /* ふきだしは左右の真ん中 */
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

/* 確認の状況のふきだしは、三角も真ん中。ポンと出るのも三角の根元（下の真ん中）から */
.stboard__head .greeting__lead {
  transform-origin: 50% 100%;
}

.stboard__head .greeting__lead::after {
  left: 50%;
  translate: -50% 0;
}

.stcard {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-bg);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-stack);
}

/* 開いたとき、1 枚ずつ下からせり上がって出る。9 枚目からはまとめて出す */
.stcard {
  --i: 0;
  animation: stcard-rise var(--dur-stcard) var(--ease-deck) calc(var(--dur-stcard-step) * var(--i) + var(--delay-bubble-pop)) both;
}

.stcard--n1 { --i: 1; }
.stcard--n2 { --i: 2; }
.stcard--n3 { --i: 3; }
.stcard--n4 { --i: 4; }
.stcard--n5 { --i: 5; }
.stcard--n6 { --i: 6; }
.stcard--n7 { --i: 7; }
.stcard--n8 { --i: 8; }

@keyframes stcard-rise {
  from {
    opacity: 0;
    transform: translateY(var(--sz-stcard-rise));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stcard { animation: none; }
}

.stcard.is-done {
  box-shadow: none;
}

.stcard__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-3);
}

.stcard__who {
  font-size: var(--fs-md);
  font-weight: 700;
}

.stcard__name {
  font-size: var(--fs-lg);
}

.stcard__when {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

.stcard__more {
  margin-left: auto;
  font-size: var(--fs-sm);
}

/* 本文のふきだし（.letter__body と同じ形）。三角は切らないよう、2 行で切るのは中の p で */
.stcard__msg {
  position: relative;
  margin-top: calc(var(--sz-bubble-tail) - var(--sp-2));
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-bubble);
  background: var(--c-msg-bg);
}

.stcard__msg::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: var(--sp-5);
  border: var(--sz-bubble-tail) solid transparent;
  border-top: 0;
  border-bottom-color: var(--c-msg-bg);
}

.stcard__body {
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  line-height: 1.7;
  white-space: pre-line;
}

.stcard__rooms {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.stcard__progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-3);
}

.stcard__count {
  font-size: var(--fs-md);
  color: var(--c-text-sub);
  white-space: nowrap;
}

.stcard__count b {
  font-size: var(--fs-xl);
  color: var(--c-text);
}

/* 帯: 読んだ割合を緑で。溝は淡い灰 */
.stcard__bar {
  width: 100%;
  height: 10px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--c-bg-sub);
  overflow: hidden;
}

.stcard__bar::-webkit-progress-bar {
  background: var(--c-bg-sub);
  border-radius: 999px;
}

.stcard__bar::-webkit-progress-value {
  background: var(--c-st-ok);
  border-radius: 999px;
}

.stcard__bar::-moz-progress-bar {
  background: var(--c-st-ok);
  border-radius: 999px;
}

.stcard__group {
  display: grid;
  gap: var(--sp-2);
}

.stcard__label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-text-sub);
}

/* 読んだ人のアコーディオン。見出しの右の山形が、開くと下を向く */
.stcard__read {
  display: grid;
  gap: var(--sp-2);
}

.stcard__summary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  width: fit-content;
  cursor: pointer;
  list-style: none;
}

.stcard__summary::-webkit-details-marker {
  display: none;
}

.stcard__summary::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  margin-left: var(--sp-1);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: -45deg;
  transition: rotate var(--dur-deck) var(--ease-deck);
}

.stcard__read[open] > .stcard__summary::after {
  rotate: 45deg;
}

.stcard__read > .stpeople {
  margin-top: var(--sp-2);
}

.stcard__n {
  margin-left: var(--sp-1);
  padding: 0 var(--sp-2);
  border-radius: 999px;
  background: var(--c-bg-sub);
}

.stpeople {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 確認の状況のコメント（コメント必須の答え。GLIQ-520） */
.stanswers {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stanswer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-bg);
}

.stanswer__name,
.stanswer__about {
  font-weight: 700;
}

.stanswer__about {
  color: var(--c-text-sub);
}

.stanswer__text {
  flex: 1 1 16em;
  white-space: pre-wrap;
}

.stperson {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  border-radius: 999px;
  white-space: nowrap;
}

/* まだの人: 赤い枠で大きく。声をかける相手 */
.stperson--pending {
  padding: var(--sp-1) var(--sp-4);
  border: 2px solid var(--c-st-ng);
  background: var(--c-st-ng-bg);
  color: var(--c-st-ng);
  font-size: var(--fs-lg);
  font-weight: 800;
}

/* 読んだ人: チェックと名前と時刻を、小さく薄く */
.stperson--read {
  padding: var(--sp-hair) var(--sp-3);
  border: 1px solid var(--c-border-light);
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

.stperson--read .check {
  width: 1em;
  height: 1em;
  color: var(--c-st-ok);
}

.stperson__time {
  margin-left: var(--sp-1);
  color: var(--c-text-mute);
}

.stcard__alldone {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin: 0;
  color: var(--c-st-ok);
  font-weight: 800;
}

.stcard__alldone .check {
  width: 1.2em;
  height: 1.2em;
}

/* 共用端末の画面: 押しやすい高さのボタン */
.is-terminal .main .btn {
  height: var(--h-btn-terminal);
  padding: 0 var(--sp-5);
}

.is-terminal .main .btn--sm {
  height: var(--h-btn-lg);
  padding: 0 var(--sp-3);
}

/* ヘッダーの「〇〇さん」と「終わる」 */
.gheader__terminal {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-3);
  color: var(--c-text-inv);
}

.gheader__terminal-name {
  font-weight: 600;
  font-size: var(--fs-lg);
  white-space: nowrap;
}

.gheader__terminal form {
  display: contents;
}

.gheader__terminal .btn {
  height: var(--h-btn-lg);
  border-color: var(--c-on-dark-stroke);
}

/* 待ち受け（terminal/standby.html）。広い画面では名前の欄を右に置く */
.terminal-main {
  display: grid;
  align-content: start;
  gap: var(--sp-4);
}

.standby {
  display: grid;
  gap: var(--sp-4);
  align-items: start;
}

.standby__board {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
}

@media (min-width: 768px) {
  .standby {
    grid-template-columns: minmax(0, 1fr) var(--w-standby-names);
  }

  .standby__names {
    position: sticky;
    top: 0;
  }
}

.namegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--w-name-terminal), 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.namegrid:last-child {
  margin-bottom: 0;
}

.is-terminal .namegrid .btn {
  width: 100%;
  height: var(--h-key-terminal);
  font-size: var(--fs-2xl);
  justify-content: center;
}

.terminal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* 番号の画面（terminal/identify.html） */
.identify-wrap {
  width: 100%;
  max-width: var(--w-identify);
  justify-self: center;
}

.identify {
  display: grid;
  gap: var(--sp-4);
}

.identify .input {
  width: 100%;
  height: var(--h-key-terminal);
  font-size: var(--fs-3xl);
  letter-spacing: var(--w-pin-gap);
  text-align: center;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, var(--w-key-terminal)));
  justify-content: center;
  gap: var(--sp-3);
}

.is-terminal .keypad .btn {
  width: 100%;
  min-width: 0;   /* .btn--lg の最小幅（108px）が列（96px）よりひろく、横のすき間を埋めてしまう */
  height: var(--h-key-terminal);
  font-size: var(--fs-2xl);
  justify-content: center;
}

/* 書く画面の種類（大きなボタンで選ぶ。radio_group を .kindpick で包む） */
.kindpick .radiogroup__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.kindpick .radioline {
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: var(--fs-lg);
  font-weight: 600;
  cursor: pointer;
}

.kindpick .radioline:has(input:checked) {
  background: var(--c-brand-pale);
  border-color: var(--c-brand);
  color: var(--c-brand-dark);
}

/* 書く画面の宛先の人（勤務ごとに 1 行。名前のチェックを横に並べる） */
.recipientpick__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
}

.recipientpick__label {
  min-width: 4em;
  color: var(--c-text-sub);
  font-size: var(--fs-sm);
}

.recipientpick__note {
  color: var(--c-text-mute);
  font-size: var(--fs-sm);
  font-weight: 400;
}

/* 書き込みの写真と添付（詳細） */
.entryfiles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.entryfiles__photo {
  display: block;
  max-width: var(--w-entryphoto);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}

/* コメント（詳細） */
.entrycomments {
  display: grid;
  gap: var(--sp-3);
}

.entrycomment {
  display: grid;
  gap: var(--sp-1);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-border-light);
}

.entrycomment__body {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.entrycomment__meta {
  font-size: var(--fs-sm);
  color: var(--c-text-sub);
}

/* 確認の状況の「人ごと」（GLIQ-432）。まだ読んでいない必読を 1 行ずつ。押すとくわしく見るのモーダル */
.stunread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stunread__link {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) 10px;
  padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 8px;
  color: inherit; text-decoration: none; background: var(--c-bg);
}
.stunread__link:hover { border-color: var(--c-brand); }
.stunread__body { flex: 1 1 16em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stunread__when { color: var(--c-text-sub); font-size: var(--fs-xs); white-space: nowrap; }

/* 話して入力（voice-input.js）。入力欄の下に大きめのボタン。聞いている間は赤で知らせる */
.voicefield {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  width: 100%;
}
.voicebtn[hidden] { display: none; }
.voicebtn svg { width: 22px; height: 22px; }
.voicebtn.is-listening {
  background: var(--c-accent-pale);
  border-color: var(--c-accent);
  color: var(--c-accent-dark);
}
.voicebtn.is-listening svg { animation: voicebtn-pulse 1.2s ease-in-out infinite; }
@keyframes voicebtn-pulse {
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .voicebtn.is-listening svg { animation: none; }
}

/* コメント欄の丸いマイク（送るの左）。送ると同じ大きさで、白地に紺の線 */
.lm__mic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--sz-lm-send);
  height: var(--sz-lm-send);
  padding: 0;
  border: 2px solid var(--c-brand);
  border-radius: 50%;
  background: var(--c-bg);
  color: var(--c-brand);
  cursor: pointer;
}
.lm__mic svg { width: 50%; height: 50%; }
.lm__mic:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; }
.lm__mic.is-listening { border-color: var(--c-accent); }
