/* ASPI Forms のトップと管理（NAK-2179・NAK-2180）。#root（.forms-main・紺）の中だけ。箱・角丸・影は使わない（浮くメニューだけ影）
   コントラスト: 縞（管理の表）#E9ECF2、補助の文字 #4A505A（縞の上で 7:1 以上）、状態の色は縞の上で 6:1 以上 */
.forms-main { --fm-warn-wash: #FFF7CC; --fm-zebra: #E9ECF2; --fm-note: #4A505A; --fm-ok: #24603A; --fm-warn: #7A4E00; }

/* 状態のアイコン（文字は出さず、名前はアイコンに重ねると出る） */
.fm-sx { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; vertical-align: middle; flex: none; }
.fm-sx svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fm-sx--draft, .fm-sx--todo { color: var(--fm-warn); }
.fm-sx--open, .fm-sx--done { color: var(--fm-ok); }
.fm-sx--before { color: var(--ink); }
.fm-sx--closed, .fm-sx--none { color: var(--fm-note); }

/* トップは最大 960px で左寄せ（店長プレゼンの投票画面 .pv-app と同じ幅）。帯・切替・見出し・罫は全部この幅の右端で切れる。
   列 = 種類 132px／名前 残り全部／状態 28px／締切 184px／矢印 14px。状態・締切・矢印は右端に寄せる。
   揃え線: 左 = 行の左の余白 12px（帯のアイコン・種類のアイコン・任意の投票・過去の回答の左端）。
           右 = 締切の列の左端は右端から 234px（帯・一覧とも）、状態の列は右端から 270px（見出しの凡例も同じ列）。
   余白の段階: 段の間 32px（--sp-4。帯→切替／受付中の閉じ罫→これから／これからの閉じ罫→過去の回答）／見出しと一覧 0／行の内側 上下 12px */
.fm-home { max-width: var(--fm-max); --fm-max: 960px; --fm-pad: 12px; --fm-kind: 132px; --fm-due: 184px; --fm-gap: var(--sp-4); --fm-line: var(--gray-rule-strong); }

/* 未提出の帯（黄は信号。角丸・枠・影なし）。アイコンと文字の列は、一覧の種類の列（アイコン 20px＋8px）と同じ。
   締切の列は、下の一覧の締切の列と同じ x（右から 矢印 14px＋24px の空き） */
.fm-banner { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 0 8px; padding: 14px var(--fm-pad) 8px; margin: 0 0 var(--fm-gap); background: var(--fm-warn-wash); color: var(--ink); }
.fm-banner__icon { width: 20px; height: 20px; margin-top: 4px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fm-banner__head { font-size: 16px; font-weight: 700; line-height: 28px; }
.fm-banner__n { font-family: var(--font-num); font-size: 22px; font-weight: 700; }
.fm-banner__u { font-size: 16px; font-weight: 700; margin-right: 1px; }
/* 件の間の罫は帯の右端まで（一覧の行の罫と同じ右端） */
.fm-banner ul { grid-column: 2; list-style: none; margin: 2px calc(-1 * var(--fm-pad)) 0 0; padding: 0; font-size: 14px; }
.fm-banner li { position: relative; display: grid; grid-template-columns: minmax(0, max-content) minmax(8em, 1fr) var(--fm-due) 14px; column-gap: 24px; align-items: center; min-height: 44px; padding: 4px var(--fm-pad) 4px 0; box-sizing: border-box; }
.fm-banner li + li { border-top: 1px solid rgba(122, 78, 0, .18); }
.fm-banner a { color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fm-banner a::after { content: ""; position: absolute; inset: 0; }
.fm-banner li:hover a { text-decoration-thickness: 2px; }
/* 店舗は1行。入り切らない分は「…」（スマホと同じ扱い）。題が長い時は題が折り返し、店舗の列は最低 8em 残る */
.fm-banner__stores { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fm-note); }
.fm-banner__due { color: var(--fm-warn); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fm-banner li.fm-banner__more { display: flex; color: var(--fm-note); }

/* トップ: 受付中・これから */
.fm-sec { margin: 0 0 var(--fm-gap); }
/* 見出しの右の列は行と同じ（状態 28px・締切・矢印）。凡例は状態の列から始まる */
.fm-sec > h2 { display: grid; grid-template-columns: minmax(0, 1fr) 28px var(--fm-due) 14px; column-gap: 16px; align-items: baseline; margin: 0; padding: 0 var(--fm-pad) 10px 0; border-bottom: 2px solid var(--ink); font-size: 18px; font-weight: 700; line-height: 1.4; }
.fm-sec__title { display: flex; align-items: baseline; gap: 12px; }
.fm-sec__n { font-family: var(--font-num); font-size: 20px; font-weight: 700; }
.fm-sec__u { font-size: 15px; font-weight: 700; margin-left: 1px; }
.fm-legend { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; font-weight: 600; color: var(--fm-note); }
.fm-legend > span { display: inline-block; white-space: nowrap; }
.fm-legend .fm-sx { width: 28px; height: 20px; vertical-align: -5px; }
.fm-legend .fm-sx svg { width: 17px; height: 17px; }
.fm-list { list-style: none; margin: 0; padding: 0; }
/* 行の間は 1px の罫（帯の件の間と同じ扱い）。縞は使わない＝少ない行で選択中に見えないように */
.fm-list li + li { border-top: 1px solid var(--fm-line); }
/* 受付中・これからの段は 1px の罫で閉じる（段の間の余白は罫の下から 32px。過去の回答は罫を持たない） */
.fm-sec .fm-list, .fm-sec .fm-empty { border-bottom: 1px solid var(--fm-line); }
.fm-row { display: grid; grid-template-columns: var(--fm-kind) minmax(0, 1fr) 28px var(--fm-due) 14px; align-items: center; gap: 0 16px; min-height: 52px; padding: 12px var(--fm-pad); box-sizing: border-box; color: var(--ink); text-decoration: none; }
/* 押せる範囲は行全体。マウスを重ねている間だけ淡い地色（常時の地色は付けない＝選択に見せない） */
@media (hover: hover) { .fm-row:hover { background: var(--fm-zebra); } }
.fm-row:hover .fm-row__name { text-decoration: underline; }
/* リンクにしない行（年末アワードの準備中など）は押せる見た目にしない */
.fm-row--static:hover { background: none; }
.fm-row--static:hover .fm-row__name { text-decoration: none; }
.fm-row__kind { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.fm-row__kind svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fm-row__name { min-width: 0; font-size: 15px; font-weight: 700; }
.fm-row__faces { display: flex; gap: 4px; margin-top: 6px; }
.fm-row__faces img { width: 56px; height: 28px; object-fit: cover; background: var(--gray-band); }
.fm-row__thumb { display: block; width: min(100%, 320px); height: auto; aspect-ratio: 2 / 1; margin-top: 8px; object-fit: cover; background: #000; }
.fm-row__state { display: flex; }
.fm-row__due { margin-left: -8px; font-size: 13px; font-weight: 500; color: var(--fm-note); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fm-row--todo .fm-row__due { color: var(--fm-warn); font-weight: 700; }
.fm-row__due small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--fm-note); }
.fm-row__go { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 2; }
.fm-empty { margin: 0; padding: 16px var(--fm-pad); font-size: 14px; color: var(--fm-note); }

/* 任意の投票: 文字のリンク。種類の列に名前、回の名前の列にリンク。受付中の一覧の罫の下に続き、自分の下の罫で段を閉じる */
.fm-optional { display: grid; grid-template-columns: var(--fm-kind) minmax(0, 1fr); align-items: center; gap: 0 16px; min-height: 44px; margin: 0; padding: 0 var(--fm-pad); border-bottom: 1px solid var(--fm-line); box-sizing: border-box; font-size: 14px; }
.fm-optional__label { padding-left: 28px; font-size: 13px; font-weight: 600; color: var(--fm-note); }
.fm-optional__links { color: var(--fm-note); }
.fm-optional a { display: inline-block; padding: 12px 0; color: var(--ink); font-weight: 700; }

/* 過去の回答（押すまで出さない・文字だけ） */
.fm-past-answers { margin: 0 0 var(--fm-gap); }
.fm-history-toggle { appearance: none; background: none; border: 0; min-height: 44px; padding: 0 var(--fm-pad); font: inherit; font-size: 14px; font-weight: 700; color: var(--brand-text); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.fm-history-toggle:hover { text-decoration: underline; }
.fm-history-toggle__caret { width: 20px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.fm-history-toggle[aria-expanded="true"] .fm-history-toggle__caret { transform: rotate(90deg); }
.fm-history-toggle__n { font-family: var(--font-num); font-size: 16px; font-weight: 700; }
.fm-history-toggle__u { font-size: 12px; font-weight: 700; margin-left: 1px; }
.fm-history { margin: 0; padding: 0 0 8px; list-style: none; font-size: 14px; }
.fm-history li { display: grid; grid-template-columns: var(--fm-kind) minmax(0, 1fr); gap: 0 16px; align-items: center; min-height: 36px; padding: 0 var(--fm-pad); }
.fm-history time { padding-left: 28px; color: var(--fm-note); font-variant-numeric: tabular-nums; }
.fm-history-none { margin: 0; padding: 12px var(--fm-pad); font-size: 14px; color: var(--fm-note); }

/* 店長プレゼン: HP写真で店舗を選ぶ */
.fm-month { margin: var(--sp-3) 0 var(--sp-5); }
.fm-month h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 var(--sp-3); padding: 0 0 12px; border-bottom: 2px solid var(--ink); font-size: 18px; }
.fm-month h2 a { color: var(--ink); text-decoration: none; }
.fm-month h2 a:hover { text-decoration: underline; }
.fm-month h2 span { font-size: 13px; font-weight: 500; color: var(--fm-note); }
.fm-thumbs { list-style: none; margin: var(--sp-3) 0 var(--sp-5); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--sp-4) var(--sp-3); }
.fm-month .fm-thumbs { margin-top: 0; }
.fm-thumb { display: block; color: var(--ink); text-decoration: none; }
.fm-thumb img, .fm-thumb__blank { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--gray-band); }
.fm-thumb__blank { display: grid; place-items: center; font-size: 40px; font-weight: 700; color: var(--fm-note); }
a.fm-thumb:hover .fm-store { text-decoration: underline; }
.fm-store { display: block; margin-top: 12px; font-size: 16px; font-weight: 700; }
.fm-state { display: block; margin-top: 2px; font-size: 13px; color: var(--fm-note); font-variant-numeric: tabular-nums; }
.fm-state.is-todo { color: var(--fm-warn); font-weight: 600; }
.fm-thumb.is-done img { opacity: .55; }

/* 管理（回答する側と見分ける: 墨と灰。全種類の回を1つの表に。絞り込み・検索・並び替えは見出しで） */
.mx-summary { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 var(--sp-3); }
.mx-summary button { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.mx-summary button:hover { text-decoration: underline; }
.mx-summary b { font-family: var(--font-num); font-size: 18px; font-weight: 600; margin-left: 4px; }
.mx-summary small { font-size: 13px; }
.mx-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.mx-col-k { width: 16%; } .mx-col-n { width: 33%; } .mx-col-s { width: 9%; } .mx-col-r { width: 18%; } .mx-col-d { width: 14%; } .mx-col-a { width: 10%; }
.mx-table thead th { position: relative; background: none; padding: 0; border: 0; border-bottom: 2px solid var(--ink); text-align: left; vertical-align: bottom; }
.mx-h { appearance: none; background: none; border: 0; width: 100%; display: flex; align-items: center; gap: 6px; padding: 10px 12px 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.mx-h:hover { background: var(--fm-zebra); }
.mx-h svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.mx-h .is-on { color: var(--brand-text); }
.mx-h-static { display: block; padding: 10px 12px 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.mx-search { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 12px; }
.mx-search svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--fm-note); stroke-width: 2; }
.mx-search input { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--control-line); padding: 5px 2px; font: inherit; font-size: 13px; background: transparent; color: var(--ink); }
.mx-search input:focus { outline: none; border-bottom-color: var(--ink); }
.mx-pop { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 230px; background: #fff; border: 1px solid var(--gray-rule-strong); box-shadow: 0 8px 24px rgba(26, 26, 26, .12); padding: 6px 0; }
.mx-pop button { appearance: none; background: none; border: 0; width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 14px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; }
.mx-pop button:hover, .mx-pop button:focus-visible { background: var(--fm-zebra); outline: none; }
.mx-pop .fm-sx { width: 22px; height: 22px; } .mx-pop .fm-sx svg { width: 18px; height: 18px; }
.mx-pop__chk { width: 14px; flex: none; font-weight: 700; }
.mx-pop__n { margin-left: auto; font-family: var(--font-num); color: var(--fm-note); font-variant-numeric: tabular-nums; }
.mx-pop hr { border: 0; border-top: 1px solid var(--gray-rule); margin: 6px 0; }
.mx-table td { padding: 11px 12px; border: 0; vertical-align: middle; text-align: left; }
.mx-table tbody tr.mx-row:nth-child(odd of .mx-row) { background: var(--fm-zebra); }
.mx-sub td { padding-top: 8px; padding-bottom: 8px; font-size: 13px; border-top: 1px solid #D5D9E1; }
.mx-sub .mx-c-name { padding-left: 34px; font-weight: 600; }
.mx-kind { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.mx-kind svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mx-c-name { font-weight: 700; }
.mx-open { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-align: left; }
.mx-open svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.mx-open[aria-expanded="true"] svg { transform: rotate(90deg); }
.mx-c-due { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-c-due small { display: block; margin-top: 2px; font-size: 12px; color: var(--fm-note); }
.mx-table .mx-c-act { text-align: right; white-space: nowrap; }
.mx-c-act a { color: var(--ink); font-weight: 600; }
.mx-year td { padding: 18px 12px 6px; font-size: 13px; font-weight: 700; background: #fff; }
.mx-empty td { padding: 20px 12px; color: var(--fm-note); }
.mx-more td { padding: 14px 12px; border-top: 1px solid var(--gray-rule); }
.mx-more button { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--brand-text); cursor: pointer; }
.mx-kinds { margin: var(--sp-5) 0 0; font-size: 13px; color: var(--fm-note); }
.mx-kinds b { color: var(--ink); margin-right: 12px; }
.mx-kinds span + span::before { content: "·"; margin: 0 8px; }
.mg-rate { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.mg-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-num b { font-family: var(--font-num); font-size: 18px; font-weight: 600; }
.mg-num small { font-size: 13px; color: var(--fm-note); margin-left: 2px; }
.mg-bar { width: 80px; height: 4px; background: #C9CED8; flex: none; }
.mg-bar i { display: block; height: 100%; background: var(--ink); }
.mg-note { color: var(--fm-note); }

.forms-main .fm-home a:focus-visible, .forms-main .fm-home button:focus-visible, .forms-main .fm-manage a:focus-visible, .forms-main .fm-manage button:focus-visible, .fm-thumb:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 760px) {
  /* 1段目 種類…状態／2段目 名前（顔）／3段目 締切…矢印。状態と矢印は同じ縦の線 */
  .fm-row { grid-template-columns: minmax(0, 1fr) 28px; gap: 4px 12px; min-height: 0; padding: 10px var(--fm-pad); }
  .fm-row__kind { grid-column: 1; grid-row: 1; gap: 6px; font-size: 12px; color: var(--fm-note); }
  .fm-row__kind svg { width: 16px; height: 16px; }
  .fm-row__state { grid-column: 2; grid-row: 1 / 3; align-self: start; }
  .fm-row__name { grid-column: 1; grid-row: 2; font-size: 16px; }
  .fm-row__due { grid-column: 1; grid-row: 3; margin-left: 0; font-size: 13px; }
  .fm-row__go { grid-column: 2; grid-row: 3; justify-self: center; align-self: center; }
  .fm-sec > h2 { display: flex; padding-right: 0; }
  .fm-legend { display: none; }
  .fm-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-2); }
  /* 帯: 1件 = 名前の1行＋締切・店舗の1行 */
  .fm-banner { padding: 12px var(--fm-pad) 6px; }
  .fm-banner ul { grid-column: 1 / -1; width: auto; margin-top: 4px; }
  .fm-banner li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 8px var(--fm-pad) 8px 0; }
  .fm-banner a { grid-column: 1 / -1; }
  .fm-banner__due { grid-row: 2; grid-column: 1; font-size: 13px; }
  .fm-banner__stores { grid-row: 2; grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .fm-optional { grid-template-columns: auto minmax(0, 1fr); }
  .fm-optional__label { padding-left: 0; }
  .fm-history li { grid-template-columns: 7.5em minmax(0, 1fr); }
  .fm-history time { padding-left: 0; }
  .mx-table colgroup { display: none; }
  .mx-table thead tr { display: flex; flex-wrap: wrap; border-bottom: 2px solid var(--ink); }
  .mx-table thead th { border: 0; flex: 1 1 auto; }
  .mx-table thead th.mx-th-rate, .mx-table thead th.mx-th-act { display: none; }
  .mx-table thead th.mx-th-search { flex-basis: 100%; order: 3; }
  .mx-table tbody { display: block; }
  .mx-table tr.mx-row, .mx-table tr.mx-sub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 4px; }
  .mx-table tr.mx-sub { margin-left: 16px; border-top: 1px solid #D5D9E1; }
  .mx-table tr.mx-year, .mx-table tr.mx-more, .mx-table tr.mx-empty { display: block; }
  .mx-table td { padding: 0; border: 0; }
  .mx-c-kind, .mx-c-name, .mx-c-rate, .mx-c-due { grid-column: 1 / 2; }
  .mx-sub .mx-c-kind { display: none; }
  .mx-sub .mx-c-name { padding-left: 0; }
  .mx-c-state { grid-column: 2 / 3; grid-row: 1 / 3; }
  .mx-c-act { grid-column: 2 / 3; grid-row: 3 / 5; align-self: center; }
  .mx-c-due { font-size: 12px; }
  .mx-c-due::before { content: "締切 "; }
  .mx-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { .fm-history-toggle__caret, .mx-open svg { transition: none; } }
