/* ui.css ─ ツール画面の値（トークン）と部品（接頭辞 ui-）
   骨組みは今の浮いた丸いヘッダー（style.css の .hd と、1023px 以下の二本線のメニュー .sheet）と .container のまま。
   ui.css は骨組みを作らない（左ナビ・上の細いバー・下のタブバーは 2026-09-29 に取りやめ）。
   見た目の原本は design/d3-taskfirst（丸いヘッダーのままの見本）。丸みと奥行きは v8（style.css の .card・.btn・.modal）にそろえる。
   値（数・色・影）を書いてよいのは、このファイルの :root と style.css の既存の :root だけ。
   CSP のため style 属性とインラインの <style> は使わない。データで決まる幅は JS の el.style で当てる。

   ── 読む順 ─────────────────────────────────────────────
   <link rel="stylesheet" href="/style.css">
   <link rel="stylesheet" href="/ui.css">        ← style.css の直後（ツールの CSS より前）
   <script src="/app.js" defer></script>
   <script src="/ui.js" defer></script>          ← app.js の直後（ツールの JS より前）
   server.js の STATIC_FILES にも '/ui.css' と '/ui.js' を足す。

   ── 面の組み方 ──────────────────────────────────────────
   - 面は .ui-panel（= .card と同じ白・角丸 --r-l・影 --e1。枠線は付けない）。表・数の枠・今日の仕事・次にやることは必ず面の中に置く
   - 面の中の区切りだけ 1px の罫（--c-line・--c-line-soft）。面そのものを罫だけで区切らない
   - 面の見出し: .ui-panel ＞ .ui-sec-hd ＞ .ui-sec-t（名詞）＋.ui-sec-n（件数）＋.ui-sec-aside（右）。中身の余白は .ui-panel-body（UI.panel が作る）
   - 面の外の節の見出し: .ui-sec ＞ .ui-sec-hd
   - 一覧の面: UI.panel の中に UI.tabs → UI.filterBar → UI.table → UI.pager の順（面の内側の左右の余白は --pad-panel でそろう）
   - 見えなくする: .ui-only-pc（1023px 以下で隠す）・.ui-only-sp（1024px 以上で隠す）
   - シート（UI.sheet）とダイアログ（FT.openModal）を開いている間は、要望の浮くボタン .rq-fab を隠す

   ── 部品（ui.js の window.UI が作る。クラスは ui.js の先頭の一覧を見る） ──
   ボタン .ui-btn（--primary 黒い丸・1画面に1つ ／ --secondary 白地の枠 ／ --text 文字＋› ／ --danger 白地・墨の文字・線アイコン）
   ほかに ui-panel・ui-page-head・ui-next・ui-tasks・ui-table・ui-filter・ui-actionbar・ui-empty・ui-tabs・ui-pager・ui-stat・ui-status・ui-sheet・ui-input・ui-combo */

/* ═════════ 1. トークン ═════════ */
:root {
  /* 色（本文テキスト #111111・Brand #096FC8・白の透明度で作る派生だけ。色そのものは style.css の :root） */
  --c-on-dark: #F6F6F6;                 /* 黒い主ボタンの文字と右の丸（v8） */
  --c-ink-hover: rgba(17,17,17,.04);    /* 押せる行の hover */
  --c-select: rgba(9,111,200,.07);      /* 一覧で開いている行 */
  --c-shade: rgba(17,17,17,.055);       /* 済んだ行の網掛け（UI.table の shade） */
  --c-mark: rgba(242,178,0,.16);         /* 目印の行の網掛け（UI.table の rowClass の ui-row-mark。調査対策の推定の利用日に並べた行） */
  --c-est-text: #C62828;                  /* 推定の日付の字（調査対策の推定の利用日。.sec-au-exp-est-d） */
  --c-hi: rgba(214,48,49,.12);            /* 目立たせる行の1列目（UI.table の rowClass の ui-row-hi。調査対策の1件10万円以上） */
  --c-scrim: rgba(10,15,28,.32);        /* シートの幕（style.css の .modal-overlay と同じ） */
  --c-edge: rgba(17,17,17,.46);         /* 入力欄・選ぶ欄の縁（白地で 3:1） */
  --c-bar-bg: rgba(255,255,255,.94);    /* 下が透ける帯の地（チャットページの上の帯と入力の帯） */
  --g-float: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.80));  /* 浮いた帯の地（ヘッダー .hd と同じ）: スマホの操作の帯 */
  --g-ghost: linear-gradient(180deg, #FFFFFF 0%, #F3F5F8 100%);                     /* 副ボタンの地（style.css の .btn と同じ） */
  --blur: 14px;                         /* 浮いた帯の透け（ヘッダー .hd と同じ） */
  --blur-scrim: 6px;                    /* シートの幕の透け（.modal-overlay と同じ） */

  /* 影（style.css の --e1〜--e3 に足す分。box-shadow に書いてよいのは var(--e*) だけ） */
  --e-ghost: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(17,17,17,.16), 0 1px 2px rgba(14,26,44,.10), 0 8px 18px -8px rgba(14,26,44,.30);       /* 副ボタン（.btn と同じ） */
  --e-ghost-hi: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(17,17,17,.22), 0 2px 4px rgba(14,26,44,.12), 0 12px 22px -10px rgba(14,26,44,.34); /* 副ボタンの hover（.btn:hover と同じ） */
  --e-ring: inset 0 0 0 1px rgba(17,17,17,.18);   /* 行の操作の丸（v8 のメニューの矢印と同じ） */
  --e-float: 0 16px 34px -16px rgba(14,26,44,.30), 0 2px 6px -3px rgba(14,26,44,.14), inset 0 1px 0 rgba(255,255,255,.92);  /* 浮いた帯（ヘッダー .hd と同じ） */

  /* 文字（7段。本文と表は 14、画面の題名は PC 24・スマホ 20、いちばん小さい字は 12） */
  --fs-12: 12px;   /* 補足・表の見出し・ラベル */
  --fs-13: 13px;   /* 件数の数字・ヘッダーの実行中 */
  --fs-14: 14px;   /* 本文・表・ボタン */
  --fs-16: 16px;   /* 面の見出し・行の題名・指の端末の入力欄 */
  --fs-20: 20px;   /* スマホの画面の題名・中くらいの数字 */
  --fs-24: 24px;   /* PC の画面の題名・数字 */
  --fs-32: 32px;   /* 特大の数字 */
  --lh-tight: 1.4; /* 見出し・数字 */
  --lh-ui: 1.5;    /* 画面の文字・表 */
  --lh-text: 1.7;  /* 読む文 */
  --ls-ui: .02em;  /* 字間（画面） */
  --ls-label: .04em; /* 字間（ボタン・小さなラベル） */
  --ls-wm: .16em;  /* 字間（ワードマーク） */

  /* 余白（4 の倍数の 10 値） */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  --sp-hair: 2px;  /* 線とアイコンの位置合わせだけ */
  --pad-panel: 24px; /* 面の内側の左右（767px 以下 16px） */

  /* 角丸（v8 の丸み。4〜12px の小さい角丸は使わない。グラフの棒のような小さい印も 50% か --r-pill） */
  --r-s: 14px;     /* 面の中の面（画像・メールの見本・サムネイル）。style.css の .mail-preview・textarea と同じ */
  --r-m: 16px;     /* 入力欄・選ぶ欄・浮くメニュー。style.css のヘッダーのメニューと同じ */
  --r-l: 20px;     /* 面（カード・表・数の枠・今日の仕事・次にやること）。style.css の .card と同じ */
  --r-xl: 24px;    /* ダイアログ・シート。style.css の .modal と同じ */
  --r-pill: 999px; /* ボタン・浮いた帯（ヘッダー .hd と同じ）・行の操作の丸 */

  /* 重なり順（下から。style.css の .hd 40・.modal-overlay 60・.toast-area 80 に合わせる） */
  --z-sticky: 10;     /* 表の見出し */
  --z-actionbar: 30;  /* スマホの下の操作の帯（二本線のメニュー .sheet 39 の下） */
  --z-topbar: 40;     /* 上に貼り付く帯（ヘッダー .hd と同じ段。チャットページの上の帯） */
  --z-sheet: 50;      /* 下から出るシート（幕はヘッダーの上にかかる） */
  --z-fab: 55;        /* 要望の浮くボタン（シートとダイアログの間は隠す） */
  --z-modal: 60;      /* ダイアログ（.modal-overlay と同じ） */
  --z-phone: 70;      /* テレアポの画面の電話機（架電の小窓の上に出す） */
  --z-toast: 80;      /* トースト（.toast-area と同じ） */

  /* 押せる所・高さ */
  --tap: 44px;          /* 指で押す所の下限 */
  --ctl-h: 40px;        /* PC のボタン・入力欄・選ぶ欄 */
  --ctl-h-sm: 32px;     /* PC の小さいボタン */
  --ctl-h-cta: 48px;    /* 指の端末の主ボタン・スマホの操作の帯の中のボタン */
  --row-h: 44px;        /* 表の行 */
  --th-h: 40px;         /* 表の見出し */

  /* アイコン */
  --ic-s: 14px; --ic-m: 16px; --ic-l: 20px; --ic-xl: 22px;
  --ar: 24px;           /* 主ボタンの右の白い丸 */
  --arc: 28px;          /* 行の操作の丸（今日の仕事・次にやること） */

  /* 寸法 */
  --actionbar-h: 64px;  /* スマホの操作の帯（余白 8＋ボタン 48＋余白 8） */
  --float-x: 24px;      /* 浮いた帯の左右の余白（767px 以下は 10px。ヘッダー .hd と同じ） */
  --search-w: 280px;    /* PC の検索欄 */
  --stat-min: 140px;    /* 数字の並びの1つの最小幅 */
  --sheet-max: 560px;   /* シートとスマホの操作の帯の幅の上限 */
  --home-side-w: 360px; /* ホームの右の列（実行中・今日の数字）の幅の上限 */
  --home-side-min: 280px; /* 同 下限 */
  --home-tool-min: 200px; /* ホームのツールの一覧の1列の最小幅 */

  /* 動き */
  --dur: .15s;
  --dur-sheet: .22s;
}
/* 指の端末とスマホ幅: 押せる所は --tap 以上、主ボタンは --ctl-h-cta */
@media (pointer: coarse), (max-width: 767px) {
  :root { --ctl-h: var(--tap); --ctl-h-sm: var(--tap); --ar: 32px; }
}
@media (max-width: 767px) {
  :root { --pad-panel: 16px; --float-x: 10px; }
}

/* ═════════ 2. 土台の補正（既存のクラスと要素。足すだけで、既存の名前は変えない） ═════════ */
/* フォーカスの枠は Brand の 2px（白地で 5.1:1。style.css の半透明は 2.2:1 で足りない） */
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.pool-grid.is-top .ck:has(input:focus-visible) { outline-color: var(--c-brand); }

/* iPhone は 16px 未満の入力欄を押すと画面を拡大する。指の端末とスマホ幅は 16px 以上 */
@media (pointer: coarse), (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="button"]):not([type="submit"]),
  select, textarea { font-size: var(--fs-16) !important; }
}

/* 既存の .btn.btn-sm（文字＋›）が .btn-primary の黒い塗りを消していたのを戻す（黒い丸・右に ›） */
.btn.btn-primary.btn-sm {
  min-height: var(--ctl-h); padding: 0 var(--sp-4) 0 var(--sp-5); gap: var(--sp-2); border-radius: var(--r-pill);
  color: var(--c-on-dark); background: var(--g-black); box-shadow: var(--e1);
}
.btn.btn-primary.btn-sm:hover { color: var(--c-on-dark); box-shadow: var(--e2); transform: translateY(-1px); }
.btn.btn-primary.btn-sm:disabled, .btn.btn-primary.btn-sm.is-disabled { color: var(--c-on-dark); transform: none; box-shadow: var(--e1); }

/* 危険な操作 .btn-danger（停止・削除）: 白地・墨の文字・線アイコン。信号色と右の黒い丸は使わない */
.btn.btn-danger { padding: 0 var(--sp-6) 0 var(--sp-5); color: var(--c-text); }
.btn.btn-danger:hover { color: var(--c-text); }
.btn.btn-danger .ar { display: none; }
.btn.btn-danger > .btn-label:not(:has(.ic)) { display: inline-flex; align-items: center; gap: var(--sp-2); }
.btn.btn-danger > .btn-label:not(:has(.ic))::before {
  content: ""; flex: none; width: var(--ic-m); height: var(--ic-m);
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.6 1.9h4.8l3.7 3.7v4.8l-3.7 3.7H5.6L1.9 10.4V5.6z'/%3E%3Cpath d='M5.4 8h5.2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.6 1.9h4.8l3.7 3.7v4.8l-3.7 3.7H5.6L1.9 10.4V5.6z'/%3E%3Cpath d='M5.4 8h5.2'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* .btn と .btn-text を重ねたもの（請求書の「取り下げる」など）: 文字の形（右の丸い矢印と影を出さない） */
.btn.btn-text { gap: var(--sp-1); padding: 0 var(--sp-1); background: none; box-shadow: none; }
.btn.btn-text:hover { box-shadow: none; transform: none; }
.btn.btn-text .ar { display: none; }

/* 要望の浮くボタン: 重なり順をそろえ、シートとダイアログの間は隠す */
body .rq-fab { z-index: var(--z-fab); }
body.modal-open .rq-fab, body.ui-sheet-open .rq-fab { display: none; }
/* トースト: 重なり順をトークンにそろえる */
.toast-area { z-index: var(--z-toast); }

/* ═════════ 3. 部品 ═════════ */
/* 見えなくする */
@media (max-width: 1023px) { .ui-only-pc { display: none !important; } }
@media not all and (max-width: 1023px) { .ui-only-sp { display: none !important; } }
.ui-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 線アイコン（FT.icon と同じ 16px・線 1.6。.ic は style.css） */
.ui-ic-l { width: var(--ic-l); height: var(--ic-l); }
.ui-num { font-family: var(--f-en); font-variant-numeric: tabular-nums; letter-spacing: 0; }
/* ワードマーク（チャットページの上の帯。ツールの画面はヘッダーの .hd-brand） */
.ui-wm {
  display: inline-flex; align-items: center; min-height: var(--tap);
  font-family: var(--f); font-size: var(--fs-16); font-weight: 900; letter-spacing: var(--ls-wm); line-height: 1;
  color: var(--c-text); white-space: nowrap;
}
.ui-wm:hover { color: var(--c-text); }

/* ── 面（.card と同じ白・角丸・影）と節 ── */
.ui-panel { background: var(--c-surface); border-radius: var(--r-l); box-shadow: var(--e1); min-width: 0; }
.ui-panel + .ui-panel { margin-top: var(--sp-5); }
.ui-panel-body { padding: 0 var(--pad-panel) var(--pad-panel); }
.ui-panel-body:first-child { padding-top: var(--pad-panel); }
.ui-sec { margin-top: var(--sp-8); }
.ui-sec:first-child { margin-top: 0; }
.ui-sec-hd { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--ctl-h-sm); margin-bottom: var(--sp-3); }
.ui-panel > .ui-sec-hd { margin: 0; padding: var(--sp-5) var(--pad-panel) var(--sp-3); }
.ui-sec-t { margin: 0; font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); letter-spacing: var(--ls-ui); color: var(--c-text); }
.ui-sec-n { font-family: var(--f-en); font-size: var(--fs-16); font-weight: 800; color: var(--c-text); }
.ui-sec-aside { margin-left: auto; display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-12); color: var(--c-text-3); }
/* 一覧の面（タブ・絞り込み・表・ページ送りを1枚に入れる） */
.ui-panel > .ui-tabs { padding: 0 var(--pad-panel); }
.ui-panel > .ui-filter { padding: var(--sp-4) var(--pad-panel); border-bottom: 1px solid var(--c-line); }
.ui-panel > .ui-filter:first-child { padding-top: var(--sp-5); }

/* ── ボタン 4段（主は1画面に1つ）。形は v8 の .btn（丸・黒のグラデーション／白の地と細い縁の影） ── */
.ui-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--ctl-h); padding: 0 var(--sp-5); border: 0; border-radius: var(--r-pill);
  font-family: var(--f); font-size: var(--fs-14); font-weight: 700; line-height: 1; letter-spacing: var(--ls-label);
  white-space: nowrap; text-decoration: none; cursor: pointer; vertical-align: middle;
  transition: box-shadow var(--dur) ease, color var(--dur) ease, background-color var(--dur) ease, transform var(--dur) ease;
}
.ui-btn .ic { width: var(--ic-m); height: var(--ic-m); }
.ui-btn-t { overflow: hidden; text-overflow: ellipsis; }
/* 主: v8 の黒い丸ボタン（黒のグラデーション＋右に白い丸の ›） */
.ui-btn--primary { padding: 0 calc((var(--ctl-h) - var(--ar)) / 2) 0 var(--sp-5); gap: var(--sp-3); color: var(--c-on-dark); background: var(--g-black); box-shadow: var(--e1); }
.ui-btn--primary:hover { color: var(--c-on-dark); box-shadow: var(--e2); transform: translateY(-1px); }
.ui-btn-ar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--ar); height: var(--ar); border-radius: 50%; background: var(--c-on-dark); color: var(--c-text);
}
.ui-btn-ar .ic { width: var(--ic-s); height: var(--ic-s); stroke-width: 2; }
/* 副: v8 の白い丸ボタン（白の地・細い縁と影） */
.ui-btn--secondary, .ui-btn--danger { color: var(--c-text); background: var(--g-ghost); box-shadow: var(--e-ghost); }
.ui-btn--secondary:hover, .ui-btn--danger:hover { color: var(--c-text); box-shadow: var(--e-ghost-hi); transform: translateY(-1px); }
.ui-btn--secondary .ic { color: var(--c-text-3); }
/* 危険: 副と同じ形＋墨の線アイコン（停止・削除）。押すと確認のダイアログ（UI.btn の confirm） */
.ui-btn--danger .ic { color: var(--c-text); }
/* 文字: 墨の文字＋›。囲まない（丸はフォーカスの枠の形だけ） */
.ui-btn--text { height: auto; min-height: var(--ctl-h); padding: 0 var(--sp-1); gap: var(--sp-1); background: none; color: var(--c-text); }
.ui-btn--text:hover { color: var(--c-brand); }
.ui-btn--text .ui-btn-chev { width: var(--ic-s); height: var(--ic-s); stroke-width: 2; }
.ui-btn--sm { height: var(--ctl-h-sm); padding: 0 var(--sp-4); }
.ui-btn--sm.ui-btn--primary { padding: 0 calc((var(--ctl-h-sm) - var(--ar)) / 2 + var(--sp-hair)) 0 var(--sp-4); }
.ui-btn--sm.ui-btn--text { min-height: var(--ctl-h-sm); padding: 0 var(--sp-1); }
.ui-btn--block { display: flex; width: 100%; }
/* 横に伸ばした主ボタン（block・シートの下・操作の帯）: 右の丸は右端、文字は残りの幅の真ん中 */
.ui-btn--primary.ui-btn--block > .ui-btn-t, .ui-btn--primary.ui-btn--block > .ui-btn-ar,
.ui-sheet-ft > .ui-btn--primary > .ui-btn-t, .ui-sheet-ft > .ui-btn--primary > .ui-btn-ar { margin-left: auto; }
.ui-btn[disabled], .ui-btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }
.ui-btn--primary[disabled] { box-shadow: none; }
.ui-btn--secondary[disabled], .ui-btn--danger[disabled] { box-shadow: var(--e-ring); }
@media (pointer: coarse), (max-width: 767px) {
  .ui-btn--primary:not(.ui-btn--sm) { height: var(--ctl-h-cta); padding-right: calc((var(--ctl-h-cta) - var(--ar)) / 2); }
}
/* アイコンだけのボタン（閉じる・前後）。aria-label を必ず付ける */
.ui-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--ctl-h); height: var(--ctl-h); padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--c-text); cursor: pointer;
}
.ui-iconbtn:hover { background: var(--c-ink-hover); color: var(--c-text); }
.ui-iconbtn[disabled] { color: var(--c-text-3); opacity: .4; cursor: default; background: none; }
.ui-iconbtn .ic { width: var(--ic-m); height: var(--ic-m); }
/* 行の操作: 動詞＋丸の中の ›（次にやること・今日の仕事の行。v8 のメニューの矢印と同じ形） */
.ui-arc {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--arc); height: var(--arc); border-radius: 50%; box-shadow: var(--e-ring); color: var(--c-text);
  transition: background-color var(--dur) ease, color var(--dur) ease, box-shadow var(--dur) ease;
}
.ui-arc .ic { width: var(--ic-s); height: var(--ic-s); stroke-width: 2; }

/* ── 画面の見出し ── */
.ui-page-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "crumb act" "title act" "sub act";
  align-items: end; gap: 0 var(--sp-6); margin: 0 0 var(--sp-6);
}
.ui-page-crumbs, .ui-page-back { grid-area: crumb; margin-bottom: var(--sp-1); font-size: var(--fs-12); color: var(--c-text-3); }
.ui-page-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-1); }
.ui-page-crumbs a { color: var(--c-text-3); }
.ui-page-crumbs a:hover { color: var(--c-text); text-decoration: underline; text-underline-offset: 3px; }
.ui-page-back { display: none; }
.ui-page-title {
  grid-area: title; margin: 0; font-size: var(--fs-24); font-weight: 700; line-height: var(--lh-tight); letter-spacing: var(--ls-ui);
  color: var(--c-text); overflow-wrap: anywhere;
}
.ui-page-sub {
  grid-area: sub; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-3); margin: var(--sp-1) 0 0;
  font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-text-3);
}
.ui-page-sub b { font-family: var(--f-en); font-weight: 700; color: var(--c-text); }
.ui-page-head:not(.has-act) { column-gap: 0; }
.ui-page-act { grid-area: act; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-3); }

/* ── 次にやること（各画面の上。面の中に最大3つ。0件は出さない） ── */
.ui-next { margin: 0 0 var(--sp-5); }
.ui-next-h { margin: 0 0 var(--sp-3); font-size: var(--fs-14); font-weight: 700; line-height: var(--lh-ui); letter-spacing: var(--ls-ui); color: var(--c-text); }
.ui-next-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; overflow: hidden; }
.ui-next-list.is-n1 { grid-template-columns: minmax(0, 1fr); }
.ui-next-list.is-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-next-list > li { min-width: 0; }
.ui-next-list > li + li { border-left: 1px solid var(--c-line-soft); }
.ui-next-i {
  display: grid; grid-template-columns: var(--ic-l) minmax(0, 1fr) auto; grid-template-areas: "ic l act" "ic n act";
  align-items: center; gap: 0 var(--sp-3); width: 100%; height: 100%; padding: var(--sp-4) var(--pad-panel);
  border: 0; background: none; color: var(--c-text); text-align: left; font: inherit; cursor: pointer;
  transition: background-color var(--dur) ease;
}
.ui-next-i:hover { background: var(--c-ink-hover); color: var(--c-text); }
.ui-next-i > .ic { grid-area: ic; align-self: start; margin-top: var(--sp-hair); width: var(--ic-l); height: var(--ic-l); }
.ui-next-l { grid-area: l; font-size: var(--fs-12); font-weight: 700; line-height: var(--lh-ui); color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-next-n { grid-area: n; font-family: var(--f-en); font-size: var(--fs-24); font-weight: 800; line-height: var(--lh-tight); letter-spacing: 0; white-space: nowrap; }
.ui-next-n small { margin-left: var(--sp-hair); font-family: var(--f); font-size: var(--fs-12); font-weight: 700; }
.ui-next-act { grid-area: act; display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-14); font-weight: 700; white-space: nowrap; }
.ui-next-i:hover .ui-arc, .ui-next-i[aria-pressed="true"] .ui-arc { background: var(--c-text); color: var(--c-surface); box-shadow: none; }
.ui-next-i[aria-pressed="true"] .ui-next-l { color: var(--c-text); }

/* ── 今日の仕事の行（区分ごとに面を1枚） ── */
.ui-tasks { display: flex; flex-direction: column; gap: var(--sp-5); }
.ui-tasks-g { overflow: hidden; }
.ui-tasks > .ui-panel + .ui-panel { margin-top: 0; }
.ui-tasks-h {
  display: flex; align-items: baseline; gap: var(--sp-2); margin: 0; padding: var(--sp-5) var(--pad-panel) var(--sp-2);
  font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); letter-spacing: var(--ls-ui); color: var(--c-text);
}
.ui-tasks-n { font-family: var(--f-en); font-weight: 800; }
.ui-tasks-list { margin: 0; padding: 0; list-style: none; }
.ui-tasks-list > li + li .ui-task { border-top: 1px solid var(--c-line-soft); }
.ui-tasks-list > li[hidden] { display: none; }
.ui-tasks-more { margin: 0; padding: var(--sp-2) var(--pad-panel) var(--sp-3); border-top: 1px solid var(--c-line-soft); }
.ui-task {
  display: grid; grid-template-columns: var(--ic-l) minmax(0, 1fr) auto; align-items: center; gap: var(--sp-hair) var(--sp-4);
  width: 100%; min-height: calc(var(--sp-16) + var(--sp-2)); padding: var(--sp-4) var(--pad-panel);
  border: 0; background: none; color: var(--c-text); text-align: left; font: inherit; cursor: pointer;
  transition: background-color var(--dur) ease;
}
.ui-task:hover { background: var(--c-ink-hover); color: var(--c-text); }
.ui-task-ic { grid-row: 1 / span 2; align-self: start; margin-top: var(--sp-hair); width: var(--ic-l); height: var(--ic-l); }
.ui-task-t { grid-column: 2; font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); overflow-wrap: anywhere; }
.ui-task-m { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); font-size: var(--fs-12); line-height: var(--lh-ui); color: var(--c-text-3); }
.ui-task-m b { font-weight: 700; color: var(--c-text); }
.ui-task-act { grid-column: 3; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-14); font-weight: 700; white-space: nowrap; }
.ui-task:hover .ui-arc { background: var(--c-text); color: var(--c-surface); box-shadow: none; }

/* ── 数字（面の中に置く。並べるときは .ui-stats） ── */
.ui-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--stat-min), 1fr)); gap: var(--sp-5) var(--sp-6); }
/* 速さのつまみ（余力の面の下。管理者だけ） */
.ui-speed { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--c-line); font-size: var(--fs-14); color: var(--c-text); }
.ui-speed-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.ui-speed-t { font-size: var(--fs-12); font-weight: 700; color: var(--c-text-3); }
.ui-speed-modes { display: inline-flex; padding: 2px; border-radius: var(--r-pill); background: var(--c-line); }
.ui-speed-mode { min-height: 32px; padding: 0 var(--sp-4); border: 0; border-radius: var(--r-pill); background: none; font: inherit; font-weight: 700; color: var(--c-text-3); cursor: pointer; }
.ui-speed-mode.active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--e1); }
.ui-speed-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--sp-1) var(--sp-3); }
.ui-speed-l { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-speed-in { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: var(--tap); margin: 0; accent-color: var(--c-text); cursor: pointer; }
.ui-speed-in:disabled { cursor: default; opacity: .55; }
.ui-speed-out { display: flex; align-items: baseline; gap: var(--sp-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-speed-v { font-size: var(--fs-16); }
.ui-speed-cap { font-size: var(--fs-12); color: var(--c-text-3); }
.ui-stat { display: flex; flex-direction: column; gap: var(--sp-hair); min-width: 0; color: var(--c-text); }
a.ui-stat:hover { color: var(--c-text); }
a.ui-stat:hover .ui-stat-l { color: var(--c-brand); }
.ui-stat-l { font-size: var(--fs-12); font-weight: 700; line-height: var(--lh-ui); color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-stat-v { font-family: var(--f-en); font-size: var(--fs-24); font-weight: 800; line-height: var(--lh-tight); letter-spacing: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-stat-u { margin-left: var(--sp-hair); font-family: var(--f); font-size: var(--fs-12); font-weight: 700; }

/* ── 状態（線アイコン＋文字。色は墨。回るアイコンだけ Brand） ── */
.ui-status { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 700; color: var(--c-text); white-space: nowrap; line-height: var(--lh-ui); }
.ui-status .ic { width: var(--ic-m); height: var(--ic-m); color: var(--c-text); }
.ui-status .ic-spin { color: var(--c-brand); }
.ui-status--sub { font-weight: 500; color: var(--c-text-3); }
.ui-status--sub .ic { color: var(--c-text-3); }

/* ── 空の状態（見出しと操作1つだけ。説明文を置かない） ── */
.ui-empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); padding: var(--sp-12) var(--pad-panel); text-align: center; }
.ui-empty > .ic { width: var(--ic-l); height: var(--ic-l); color: var(--c-text-3); }
.ui-empty-t { margin: 0; font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); color: var(--c-text); }

/* ── タブ（件数付き。URL の hash と連動） ── */
.ui-tabs {
  display: flex; gap: var(--sp-6); margin: 0; padding: 0 var(--sp-1);
  overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(var(--c-line), var(--c-line)) left bottom / 100% 1px no-repeat;
}
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tab {
  display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; height: calc(var(--tap) + var(--sp-2));
  font-size: var(--fs-14); font-weight: 500; color: var(--c-text-3); white-space: nowrap;
  border-top: 1px solid transparent; border-bottom: 1px solid transparent;
}
.ui-tab:hover { color: var(--c-brand); }
.ui-tab[aria-current] { color: var(--c-text); font-weight: 700; border-bottom-color: var(--c-text); }
.ui-tab-n { font-family: var(--f-en); font-size: var(--fs-14); font-weight: 700; }

/* ── 入力欄（丸みのある白い欄。縁は 3:1。ラベルは上） ── */
.ui-field { display: flex; flex-direction: column; gap: var(--sp-1); margin: 0 0 var(--sp-4); }
.ui-field:last-child { margin-bottom: 0; }
.ui-field-l { font-size: var(--fs-12); font-weight: 700; color: var(--c-text-3); }
.ui-input, .ui-select {
  width: 100%; min-width: 0; height: var(--ctl-h); margin: 0; padding: 0 var(--sp-4);
  border: 1px solid var(--c-edge); border-radius: var(--r-m); background-color: var(--c-surface); color: var(--c-text);
  font-family: var(--f); font-size: var(--fs-14); font-weight: 500; line-height: var(--lh-ui);
  -webkit-appearance: none; appearance: none;
}
.ui-input::placeholder { color: var(--c-text-3); }
.ui-input:disabled, .ui-select:disabled { background-color: var(--c-bg); color: var(--c-text-3); }
textarea.ui-input { height: auto; min-height: calc(var(--sp-16) + var(--sp-10)); padding: var(--sp-3) var(--sp-4); line-height: var(--lh-text); resize: vertical; }
.ui-select {
  padding-right: var(--sp-10); cursor: pointer;
  background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6L8 10.5 12.5 6' fill='none' stroke='%235F6773' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right var(--sp-4) center / var(--ic-s) no-repeat;
}

/* ── 名前で絞り込める選ぶ欄（UI.combo。入力欄の下に浮くメニュー。角丸 --r-m・影 --e2） ── */
.ui-combo { position: relative; min-width: 0; }
.ui-combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + var(--sp-1)); z-index: var(--z-sticky);
  margin: 0; padding: var(--sp-1) 0; list-style: none; max-height: calc(var(--tap) * 6); overflow-y: auto; overscroll-behavior: contain;
  background-color: var(--c-surface); border-radius: var(--r-m); box-shadow: var(--e2);
}
.ui-combo-list[hidden] { display: none; }
.ui-combo-opt {
  display: flex; flex-direction: column; justify-content: center; min-height: var(--tap); padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-14); line-height: var(--lh-ui); color: var(--c-text); cursor: pointer;
}
.ui-combo-opt:hover, .ui-combo-opt.is-active { background-color: var(--c-ink-hover); }
.ui-combo-opt[aria-selected="true"] { font-weight: 700; }
.ui-combo-t { overflow-wrap: anywhere; }
.ui-combo-sub { font-size: var(--fs-12); color: var(--c-text-3); }
.ui-combo-new { flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--sp-2); font-weight: 700; border-bottom: 1px solid var(--c-line-soft); }
.ui-combo-none { color: var(--c-text-3); cursor: default; }
.ui-combo-none:hover { background-color: transparent; }

/* ── 絞り込みの帯（PC は1行、1023px 以下は検索＋「絞り込み n」→シート） ── */
.ui-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; }
.ui-search {
  position: relative; display: flex; align-items: center; flex: 0 1 var(--search-w); min-width: 0; height: var(--ctl-h);
  border: 1px solid var(--c-edge); border-radius: var(--r-m); background: var(--c-surface); color: var(--c-text-3);
}
.ui-search > .ic { position: absolute; left: var(--sp-4); width: var(--ic-m); height: var(--ic-m); pointer-events: none; }
.ui-search-input {
  width: 100%; min-width: 0; height: 100%; padding: 0 var(--sp-4) 0 calc(var(--sp-4) + var(--ic-m) + var(--sp-2));
  border: 0; border-radius: var(--r-m); background: none; color: var(--c-text);
  font-size: var(--fs-14); font-weight: 500; outline: none; -webkit-appearance: none; appearance: none;
}
.ui-search-input::placeholder { color: var(--c-text-3); }
.ui-search:focus-within { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.ui-search-input::-webkit-search-cancel-button { cursor: pointer; }
.ui-filter-sels { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.ui-fsel {
  position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); height: var(--ctl-h); padding: 0 var(--sp-3) 0 var(--sp-4);
  border: 1px solid var(--c-edge); border-radius: var(--r-m); background: var(--c-surface); white-space: nowrap; cursor: pointer;
}
.ui-fsel:hover { border-color: var(--c-text); }
.ui-fsel:focus-within { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.ui-fsel-k { font-size: var(--fs-12); font-weight: 700; color: var(--c-text-3); }
.ui-fsel-s {
  height: 100%; padding: 0 calc(var(--ic-s) + var(--sp-2)) 0 0;
  border: 0; color: var(--c-text); font-size: var(--fs-14); font-weight: 700; cursor: pointer; outline: none;
  -webkit-appearance: none; appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6L8 10.5 12.5 6' fill='none' stroke='%235F6773' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right center / var(--ic-s) no-repeat;
}
.ui-filter-end { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.ui-filter-more { display: none; }
.ui-filter-n { font-family: var(--f-en); font-weight: 700; color: var(--c-text-3); }

/* ── 表（面の中に置く。PC は表・見出しはヘッダーの下に貼り付く。1023px 以下は2〜3段のカード行） ── */
.ui-table-wrap { container: ui-table / inline-size; min-width: 0; }
.ui-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--fs-14); line-height: var(--lh-ui); letter-spacing: var(--ls-ui); color: var(--c-text); }
.ui-table th {
  position: sticky; top: calc(var(--hd-top, 0px) + var(--hd-h, 0px)); z-index: var(--z-sticky); height: var(--th-h); padding: 0 var(--sp-3);
  background: var(--c-surface); border-bottom: 1px solid var(--c-line);
  font-size: var(--fs-12); font-weight: 700; color: var(--c-text-3); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ui-table td {
  height: var(--row-h); padding: 0 var(--sp-3); border-bottom: 1px solid var(--c-line-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.ui-table th:first-child, .ui-table td:first-child { padding-left: var(--pad-panel); }
.ui-table th:last-child, .ui-table td:last-child { padding-right: var(--pad-panel); }
.ui-table-rz { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; touch-action: none; }
.ui-table-rz::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 4px; width: 1px; background: var(--c-line); }
.ui-table-rz:hover::after, .ui-table-rz.is-on::after, .ui-table-rz:focus-visible::after { top: 0; bottom: 0; width: 2px; right: 3px; background: var(--c-text-3); }
.ui-table .ui-ta-r { text-align: right; font-family: var(--f-en); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.ui-table th.ui-ta-r { font-family: var(--f); letter-spacing: var(--ls-ui); }
.ui-table .ui-ta-c { text-align: center; }
.ui-table .ui-m-title { font-weight: 700; }
.ui-table-link { color: var(--c-text); }
.ui-table-link:hover { color: var(--c-brand); }
.ui-table tr.is-link { cursor: pointer; }
.ui-table tbody tr:hover td { background: var(--c-ink-hover); }
.ui-table tbody tr.is-shade td { background: var(--c-shade); }
.ui-table tbody tr.ui-row-mark td { background: var(--c-mark); }
.ui-table tbody tr.ui-row-hi td:first-child { background: var(--c-hi); font-weight: 700; }
.ui-table tbody tr[aria-selected="true"] td { background: var(--c-select); }
/* まとめた行（subRows）: 1 列目の開閉ボタンと、開いた中の行 */
.ui-table-tgw { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.ui-table-tg { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--c-text-3); cursor: pointer; }
.ui-table-tg:hover { background: var(--c-ink-hover); color: var(--c-text); }
.ui-table-tg .ic, .ui-table-tg svg { width: 14px; height: 14px; transition: transform .15s; }
.ui-table-tg[aria-expanded="true"] .ic, .ui-table-tg[aria-expanded="true"] svg { transform: rotate(90deg); }
.ui-table tr.ui-table-sub td { background: var(--c-bg); }
.ui-table tr.ui-table-sub td.ui-m-title { padding-left: calc(var(--pad-panel) + 28px); }
.ui-panel > .ui-table-wrap:first-child .ui-table th:first-child { border-top-left-radius: var(--r-l); }
.ui-panel > .ui-table-wrap:first-child .ui-table th:last-child { border-top-right-radius: var(--r-l); }
.ui-panel > .ui-table-wrap:last-child .ui-table tbody tr:last-child td { border-bottom: 0; }
.ui-panel > .ui-table-wrap:last-child .ui-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r-l); }
.ui-panel > .ui-table-wrap:last-child .ui-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r-l); }
/* 置き場が狭いと優先度 3、もっと狭いと 2 の列を隠す */
@container ui-table (max-width: 900px) { .ui-table .ui-p3 { display: none; } }
@container ui-table (max-width: 680px) { .ui-table .ui-p2 { display: none; } }

/* ── ページ送り ── */
.ui-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) var(--pad-panel); font-size: var(--fs-12); color: var(--c-text-3); }
.ui-pager-t { font-family: var(--f-en); font-weight: 700; }
.ui-pager-btns { display: flex; align-items: center; gap: var(--sp-1); }

/* ── 操作の帯（PC はその場に並ぶ。1023px 以下は画面の下に浮いた帯＝ヘッダーと同じ作り） ── */
.ui-actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-3); margin: var(--sp-6) 0 0; }
.ui-actionbar > .ui-iconbtn { background: var(--g-ghost); box-shadow: var(--e-ghost); }   /* その他の操作（…）: 副と同じ白い丸 */
.ui-actionbar > .ui-iconbtn:hover { box-shadow: var(--e-ghost-hi); }

/* ── 下から出るシート（ダイアログと同じくフォーカスを閉じ込め、Esc で閉じる） ── */
.ui-sheet { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; }
.ui-sheet-scrim {
  position: absolute; inset: 0; background: var(--c-scrim); opacity: 0; transition: opacity var(--dur-sheet) ease;
  -webkit-backdrop-filter: blur(var(--blur-scrim)); backdrop-filter: blur(var(--blur-scrim));
}
.ui-sheet-panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--sheet-max); max-height: calc(100vh - var(--sp-10)); max-height: calc(100dvh - var(--sp-10));
  background: var(--c-surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--e3); outline: none; overflow: hidden;
  font-size: var(--fs-14); line-height: var(--lh-ui); letter-spacing: var(--ls-ui); color: var(--c-text);
  transform: translateY(var(--sp-6)); opacity: 0; transition: transform var(--dur-sheet) ease, opacity var(--dur-sheet) ease;
}
.ui-sheet.is-open .ui-sheet-scrim, .ui-sheet.is-open .ui-sheet-panel { opacity: 1; }
.ui-sheet.is-open .ui-sheet-panel { transform: none; }
.ui-sheet-hd { display: flex; align-items: center; flex: none; min-height: calc(var(--tap) + var(--sp-4)); padding: var(--sp-2) var(--sp-3) 0 var(--pad-panel); }
.ui-sheet-title { margin: 0; font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); letter-spacing: var(--ls-ui); color: var(--c-text); }
.ui-sheet-x { margin-left: auto; width: var(--tap); height: var(--tap); }
.ui-sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--sp-2) var(--pad-panel) var(--sp-5); }
.ui-sheet-ft {
  display: flex; align-items: center; gap: var(--sp-3); flex: none;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--c-line-soft);
}
.ui-sheet-ft > .ui-btn:not(.ui-btn--text) { flex: 1 1 0; height: var(--ctl-h-cta); }
.ui-sheet-ft > .ui-btn--primary { padding-right: calc((var(--ctl-h-cta) - var(--ar)) / 2); }
body.ui-sheet-open { overflow: hidden; }
/* 768px 以上: 画面の下に浮かせ、4つの角を丸める */
@media not all and (max-width: 767px) {
  .ui-sheet { padding: var(--sp-6); }
  .ui-sheet-panel { border-radius: var(--r-xl); max-height: calc(100vh - var(--sp-12)); max-height: calc(100dvh - var(--sp-12)); }
  .ui-sheet-ft { padding-bottom: var(--sp-4); }
}
/* シートの中の一覧（行の間は 1px） */
.ui-sheet-sec { padding: var(--sp-2) 0 var(--sp-4); }
.ui-sheet-sec + .ui-sheet-sec { border-top: 1px solid var(--c-line-soft); padding-top: var(--sp-4); }
.ui-sheet-cap { margin: 0 0 var(--sp-1); font-size: var(--fs-12); font-weight: 700; letter-spacing: var(--ls-label); color: var(--c-text-3); }
.ui-sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-4); margin: 0; padding: 0; list-style: none; }
.ui-sheet-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--sp-2);
  min-height: calc(var(--tap) + var(--sp-3)); padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-line-soft); color: var(--c-text);
}
.ui-sheet-item:hover { color: var(--c-text); }
.ui-sheet-item:focus-visible { border-radius: var(--r-s); }
.ui-sheet-item:hover .ui-sheet-item-n { color: var(--c-brand); }
.ui-sheet-item-n { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); }
.ui-sheet-item-n .ic { width: var(--ic-l); height: var(--ic-l); color: var(--c-text-3); }
.ui-sheet-item[aria-current] .ui-sheet-item-n .ic { color: var(--c-text); }
.ui-sheet-item-m { grid-column: 1; font-size: var(--fs-12); color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-sheet-item > .ic:last-child { grid-column: 2; grid-row: 1 / span 2; width: var(--ic-s); height: var(--ic-s); color: var(--c-text-3); }

@media (prefers-reduced-motion: reduce) {
  .ui-sheet-scrim, .ui-sheet-panel, .ui-btn, .ui-task, .ui-next-i, .ui-arc { transition: none; }
  .ui-btn--primary:hover, .ui-btn--secondary:hover, .ui-btn--danger:hover { transform: none; }
}

/* ═════════ 4. 幅ごとのたたみ方 ═════════ */
/* 1023px 以下: 表はカードの行、絞り込みはシート、操作の帯は画面の下に浮かせる */
@media (max-width: 1023px) {
  /* 操作の帯: ヘッダーと同じ作り（白の半透明＋ぼかし＋丸＋影で浮いた帯。左右とヘッダーと同じだけ下に余白） */
  .ui-actionbar {
    position: fixed; left: 0; right: 0; bottom: max(var(--hd-top, var(--sp-3)), env(safe-area-inset-bottom, 0px)); z-index: var(--z-actionbar);
    width: min(var(--sheet-max), calc(100% - var(--float-x) * 2)); min-height: var(--actionbar-h); margin: 0 auto;
    flex-wrap: nowrap; justify-content: stretch; gap: var(--sp-2); padding: var(--sp-2);
    border-radius: var(--r-pill); background: var(--g-float); box-shadow: var(--e-float);
    -webkit-backdrop-filter: saturate(1.2) blur(var(--blur)); backdrop-filter: saturate(1.2) blur(var(--blur));
  }
  .ui-actionbar > .ui-btn { flex: 1 1 auto; min-width: 0; height: var(--ctl-h-cta); padding: 0 var(--sp-4); font-size: var(--fs-16); }
  .ui-actionbar > .ui-btn--primary { flex: 1 0 auto; padding: 0 calc((var(--ctl-h-cta) - var(--ar)) / 2) 0 var(--sp-5); }
  .ui-actionbar > .ui-btn--primary > .ui-btn-t, .ui-actionbar > .ui-btn--primary > .ui-btn-ar { margin-left: auto; }
  .ui-actionbar > .ui-btn--text { flex: none; padding: 0 var(--sp-3); }
  .ui-actionbar > .ui-iconbtn { width: var(--ctl-h-cta); height: var(--ctl-h-cta); }
  /* 帯が見えている画面（ui.js が body に .has-actionbar を付ける）: 中身の下に帯の高さの余白を足し、トーストと要望のボタンを帯の上に出す
     要望のボタンは requests.css の同じ詳細度の規則が後から読まれて勝つ（ここは requests.css に規則が無いときの受け皿） */
  body.has-actionbar .container { padding-bottom: calc(max(var(--hd-top, var(--sp-3)), env(safe-area-inset-bottom, 0px)) + var(--actionbar-h) + var(--sp-8)); }
  body.has-actionbar .toast-area,
  body.has-actionbar .rq-fab { bottom: calc(max(var(--hd-top, var(--sp-3)), env(safe-area-inset-bottom, 0px)) + var(--actionbar-h) + var(--sp-3)); }

  /* 絞り込み: 検索＋「絞り込み n」だけ */
  .ui-filter { flex-wrap: wrap; }
  .ui-filter .ui-search { flex: 1 1 0; min-width: 0; }
  .ui-filter:has(.ui-filter-end) .ui-search { flex-basis: 100%; }
  .ui-filter-sels { display: none; }
  .ui-filter-more { display: inline-flex; flex: none; }
  .ui-filter-end { margin-left: auto; }

  /* 表: 1行1枚。1段目に題名と値、2段目から補足を間を空けて並べる */
  .ui-table, .ui-table tbody { display: block; }
  .ui-table thead { display: none; }
  .ui-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-4);
    padding: var(--sp-4) var(--pad-panel); border-bottom: 1px solid var(--c-line-soft);
  }
  .ui-table tr::before { content: ""; order: 2; flex-basis: 100%; height: 0; }
  .ui-table td, .ui-table td:first-child, .ui-table td:last-child { display: block; height: auto; padding: 0; border: 0; background: none; min-width: 0; }
  .ui-table td.ui-m-title { display: block; order: 0; flex: 1 1 0; font-size: var(--fs-16); line-height: var(--lh-tight); white-space: normal; }
  /* まとめた行の中の行（subRows）: 1 枚ごと地の色を変え、左に寄せたまま */
  .ui-table tr.ui-table-sub { background: var(--c-bg); }
  .ui-table tr.ui-table-sub td, .ui-table tr.ui-table-sub td.ui-m-title { background: none; padding-left: 0; }
  .ui-table td.ui-m-value { display: block; order: 1; flex: none; max-width: 50%; font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); text-align: right; }
  .ui-table td.ui-m-meta { display: block; order: 3; flex: none; max-width: 100%; color: var(--c-text-3); font-family: var(--f); letter-spacing: var(--ls-ui); text-align: left; }
  .ui-table td.ui-m-meta.is-empty, .ui-table td.ui-m-hide { display: none; }
  .ui-table tbody tr:hover td { background: none; }
  .ui-table tbody tr:hover { background: var(--c-ink-hover); }
  .ui-table tbody tr.is-shade { background: var(--c-shade); }
  .ui-table tbody tr.is-shade td { background: none; }   /* カードの形では行ぜんたいを網掛けにし、セルごとの四角にしない */
  .ui-table tbody tr.ui-row-mark { background: var(--c-mark); }
  .ui-table tbody tr.ui-row-mark td { background: none; }
  .ui-table tbody tr.ui-row-hi td:first-child { background: none; }
  .ui-table tbody tr.ui-row-hi:not(.ui-row-mark) { background: var(--c-hi); }
  .ui-table tbody tr[aria-selected="true"] { background: var(--c-select); }
  .ui-table tbody tr[aria-selected="true"] td { background: none; }
  .ui-panel > .ui-table-wrap:last-child .ui-table tbody tr:last-child { border-bottom: 0; }
  /* 面の角丸は行（1枚のカード）が持つ。セルに PC の角丸を残すと、overflow: hidden で角の文字が欠ける */
  .ui-panel > .ui-table-wrap:last-child .ui-table tbody tr:last-child td:first-child,
  .ui-panel > .ui-table-wrap:last-child .ui-table tbody tr:last-child td:last-child { border-radius: 0; }
  .ui-panel > .ui-table-wrap:first-child .ui-table tbody tr:first-child { border-top-left-radius: var(--r-l); border-top-right-radius: var(--r-l); }
  .ui-panel > .ui-table-wrap:last-child .ui-table tbody tr:last-child { border-bottom-left-radius: var(--r-l); border-bottom-right-radius: var(--r-l); }
}

/* 767px 以下（スマホ）: 題名 20px、次にやることは動詞を外して縦に、行の操作は丸だけ */
@media (max-width: 767px) {
  /* 見出し: 戻る → 題名と操作 → 補足。操作が広いと（年度の選択など）題名を潰さず、操作を題名の下の段に回す */
  .ui-page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-3); margin-bottom: var(--sp-4); }
  .ui-page-head::before { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .ui-page-title { order: 2; flex: 1 1 10em; min-width: 0; }
  .ui-page-act { order: 3; margin-left: auto; min-width: 0; max-width: 100%; }
  .ui-page-sub { order: 4; flex-basis: 100%; }
  .ui-page-crumbs { display: none; }
  .ui-page-back { display: inline-flex; align-items: center; gap: var(--sp-hair); justify-self: start; min-height: var(--tap); margin: calc(var(--sp-2) * -1) 0 0 calc(var(--sp-1) * -1); font-size: var(--fs-14); font-weight: 700; color: var(--c-text-3); }
  .ui-page-back:hover { color: var(--c-text); }
  .ui-page-title { font-size: var(--fs-20); }

  .ui-tasks { gap: var(--sp-4); }
  .ui-panel + .ui-panel { margin-top: var(--sp-4); }
  .ui-next { margin-bottom: var(--sp-4); }
  .ui-next-i { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ic" "n" "l"; align-items: start; gap: var(--sp-hair); padding: var(--sp-3) var(--sp-3) var(--sp-4); }
  .ui-next-i > .ic { margin: 0 0 var(--sp-hair); }
  .ui-next-act { display: none; }
  .ui-next-n { font-size: var(--fs-20); }
  .ui-next-l { white-space: normal; line-height: var(--lh-tight); }

  .ui-task { grid-template-columns: var(--ic-l) minmax(0, 1fr) auto; gap: var(--sp-hair) var(--sp-3); }
  .ui-task-v { display: none; }

  .ui-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .ui-stat-v { font-size: var(--fs-20); }

  .ui-tabs { gap: var(--sp-5); }
  .ui-sheet-panel { max-width: none; }
}

/* ═════════ 5. ホーム（#/。今日の仕事） ═════════ */
.ui-home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4) var(--sp-8); margin: 0 0 var(--sp-6); }
.ui-home-date { margin: 0 0 var(--sp-1); font-size: var(--fs-14); font-weight: 700; line-height: var(--lh-ui); letter-spacing: var(--ls-ui); color: var(--c-text-3); }
.ui-home-counts { display: flex; gap: var(--sp-8); }
.ui-home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(var(--home-side-min), var(--home-side-w)); gap: var(--sp-5) var(--sp-6); align-items: start; }
.ui-home-main, .ui-home-side { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.ui-home-slot { min-width: 0; }
.ui-home-slot:empty { display: none; }
.ui-home-board-sub { display: block; font-size: var(--fs-12); line-height: var(--lh-ui); color: var(--c-text-3); white-space: normal; overflow-wrap: anywhere; }
/* 右の列（実行中・今日の数字）が空なら左の列を全幅に（app.js が .is-solo を付ける） */
.ui-home-cols.is-solo { grid-template-columns: minmax(0, 1fr); }
.ui-home-cols.is-solo > .ui-home-side { display: none; }
.ui-home-panel-h {
  display: flex; align-items: baseline; gap: var(--sp-2); margin: 0; padding: var(--sp-5) var(--pad-panel) var(--sp-3);
  font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight); letter-spacing: var(--ls-ui); color: var(--c-text);
}
.ui-home-panel-n { font-family: var(--f-en); font-weight: 800; }
/* 実行中の1件 */
.ui-home-job {
  display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) var(--pad-panel);
  border-top: 1px solid var(--c-line-soft); color: var(--c-text); font-size: var(--fs-14); line-height: var(--lh-ui);
}
.ui-home-job:hover { background: var(--c-ink-hover); color: var(--c-text); }
.ui-home-job:last-child { border-radius: 0 0 var(--r-l) var(--r-l); }
.ui-home-job-s { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-2); font-size: var(--fs-12); color: var(--c-text-3); }
.ui-home-job-t { font-weight: 700; line-height: var(--lh-tight); overflow-wrap: anywhere; }
.ui-home-bar { display: block; height: calc(var(--sp-1) + var(--sp-hair)); margin: var(--sp-2) 0 var(--sp-1); border-radius: var(--r-pill); background: var(--c-line); overflow: hidden; }
.ui-home-bar > span { display: block; width: 0; height: 100%; border-radius: var(--r-pill); background: var(--c-brand); }
.ui-home-job-m { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-3); font-size: var(--fs-12); color: var(--c-text-3); }
.ui-home-job-n { font-family: var(--f-en); font-size: var(--fs-14); color: var(--c-text); }
.ui-home-job-n b { font-size: var(--fs-20); font-weight: 800; }
.ui-home-job-n small { margin-left: var(--sp-hair); font-family: var(--f); font-size: var(--fs-12); font-weight: 700; }
.ui-home-stats { padding: var(--sp-1) var(--pad-panel) var(--pad-panel); }
/* AIBUILDERZ ACADEMY のバナー */
.ui-home-academy { margin-bottom: var(--sp-5); }
.ui-home-extras { display: grid; gap: var(--sp-5); margin-bottom: var(--sp-5); }
.ui-home-extra:empty { display: none; }
.ui-home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.ui-home-links > .ui-home-acad-in + .ui-home-acad-in { border-left: 1px solid var(--c-line-soft); }
@media (max-width: 767px) { .ui-home-links > .ui-home-acad-in + .ui-home-acad-in { border-left: 0; border-top: 1px solid var(--c-line-soft); } }
.ui-home-acad-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-6); padding: var(--pad-panel); }
.ui-home-acad-t { min-width: 0; }
.ui-home-acad-en { margin: 0 0 var(--sp-1); font-family: var(--f-en); font-size: var(--fs-12); font-weight: 800; line-height: var(--lh-ui); letter-spacing: var(--ls-label); color: var(--c-text-3); }
.ui-home-acad-h { margin: 0; font-size: var(--fs-20); font-weight: 900; line-height: var(--lh-tight); color: var(--c-text); }
/* ツールの一覧 */
.ui-home-tools { margin-top: var(--sp-5); padding-bottom: var(--sp-4); }
.ui-home-tgrid { columns: var(--home-tool-min) auto; column-gap: var(--sp-6); padding: 0 var(--pad-panel); }
.ui-home-tgrp { min-width: 0; margin-bottom: var(--sp-4); break-inside: avoid; }
.ui-home-tcap { margin: 0; padding: var(--sp-1) 0 var(--sp-2); font-size: var(--fs-12); font-weight: 700; line-height: var(--lh-ui); letter-spacing: var(--ls-label); color: var(--c-text-3); }
a.ui-home-tool {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--sp-2);
  padding: var(--sp-3) 0; border-top: 1px solid var(--c-line-soft); color: var(--c-text); line-height: var(--lh-ui);
}
a.ui-home-tool:hover { color: var(--c-text); }
a.ui-home-tool:hover .ui-home-tname { color: var(--c-brand); }
.ui-home-tname { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-14); font-weight: 700; line-height: var(--lh-tight); }
.ui-home-tname .ic { flex: none; width: var(--ic-m); height: var(--ic-m); color: var(--c-text-3); }
.ui-home-tool .home-now { grid-column: 1; min-width: 0; margin: var(--sp-hair) 0 0; font-size: var(--fs-12); line-height: var(--lh-ui); color: var(--c-text-3); }
.ui-home-tool .home-now:empty { display: none; }
.ui-home-tool .home-now .st { gap: var(--sp-1); font-size: var(--fs-12); font-weight: 500; color: var(--c-text-3); white-space: normal; }
.ui-home-tool .home-now .st .ic { flex: none; width: var(--ic-s); height: var(--ic-s); }
/* summary が UI.status で書いたとき（メール配信など）も同じ小ささにし、右の › の下に回り込ませず折り返す */
.ui-home-tool .home-now .ui-status { gap: var(--sp-1); font-size: var(--fs-12); font-weight: 500; color: var(--c-text-3); white-space: normal; }
.ui-home-tool .home-now .ui-status .ic { flex: none; width: var(--ic-s); height: var(--ic-s); }
.ui-home-tool .home-now .ui-status .ic:not(.ic-spin) { color: var(--c-text-3); }
.ui-home-tool > .ui-home-chev { grid-column: 2; grid-row: 1 / span 2; width: var(--ic-s); height: var(--ic-s); color: var(--c-text-3); }
.ui-home-none { padding: 0 var(--pad-panel); }
@media (max-width: 1023px) {
  /* ホーム: 読み込みの失敗 → 判断待ち → 実行中 → 期日超過 → 今日が期日 → 今日の数字 → 数字の面 → ツール */
  .ui-home-cols { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-4); }
  .ui-home-main, .ui-home-side { display: contents; }
  .ui-home-slot.is-fail { order: 0; }
  .ui-home-slot.is-decide { order: 1; }
  .ui-home-slot.is-run { order: 2; }
  .ui-home-slot.is-overdue { order: 3; }
  .ui-home-slot.is-today { order: 4; }
  .ui-home-slot.is-stats { order: 5; }
  .ui-home-slot.is-board { order: 6; }
  .ui-home-tools { margin-top: var(--sp-4); }
}
@media (max-width: 767px) {
  .ui-home-head { flex-direction: column; align-items: stretch; gap: var(--sp-3); margin-bottom: var(--sp-4); }
  .ui-home-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
  .ui-home-tgrid { columns: auto; }
}

/* ===== 棒グラフ（UI.barChart。2026-10-02） ===== */
.ui-chart { position: relative; width: 100%; isolation: isolate; }
.ui-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ui-gridline { stroke: var(--c-line-soft); stroke-width: 1; }
.ui-gridline.is-base { stroke: var(--c-line); }
.ui-axis { font-family: var(--f-en); font-size: var(--fs-12); font-weight: 600; fill: var(--c-text-3); }
.ui-bar { fill: var(--c-brand); transition: fill var(--dur) ease; }
.ui-bar-g.is-strong .ui-bar, .ui-bar-g:hover .ui-bar { fill: var(--c-brand-deep); }
.ui-bar-none { fill: var(--c-ring); }
.ui-hit { fill: transparent; cursor: default; }
.ui-bar-g:hover .ui-hit { fill: var(--c-hover); }
.ui-tip {
  position: absolute; top: calc(var(--sp-2) * -1); min-width: calc(var(--sp-16) * 2); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-m); background: var(--c-surface); box-shadow: var(--e2);
  font-size: var(--fs-13); line-height: var(--lh-text); color: var(--c-text-sub); pointer-events: none; transform: translateY(-100%); white-space: nowrap;
}
.ui-tip[hidden] { display: none; }
.ui-tip-head { font-weight: 800; color: var(--c-text); }
