/* RustateWebRuntime 標準スタイル（M2 最小版）。見た目は CSS クラスだけで決める（インラインスタイルを使わない）。 */

:root {
  --rwr-fg: #1f2328;
  --rwr-bg: #f6f7f9;
  --rwr-panel: #ffffff;
  --rwr-line: #d0d7de;
  --rwr-accent: #0b5cad;
  --rwr-danger: #b42318;
  --rwr-muted: #57606a;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--rwr-fg);
  background: var(--rwr-bg);
}

/* hidden 属性は、display を決めたクラス（.rwr-pager の flex など）より強く効かせる */
[hidden] { display: none !important; }

body { margin: 0; padding: 16px; }

.rwr-loading { color: var(--rwr-muted); }

.rwr-root { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }

.rwr-form {
  background: var(--rwr-panel);
  border: 1px solid var(--rwr-line);
  border-radius: 8px;
  min-width: min(360px, 100%);
  max-width: 100%;
  box-sizing: border-box;
}
.rwr-form-title { padding: 10px 16px; font-weight: 600; border-bottom: 1px solid var(--rwr-line); }
.rwr-form-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; align-items: flex-start; }

.rwr-label { white-space: pre-wrap; }

.rwr-button {
  font: inherit;
  padding: 6px 14px;
  border: 1px solid var(--rwr-accent);
  border-radius: 6px;
  background: var(--rwr-accent);
  color: #fff;
  cursor: pointer;
}
.rwr-button:disabled { background: #e6e8eb; border-color: var(--rwr-line); color: #8c959f; cursor: default; }

/* ファイルを選んで送るボタン: ファイル選択の input は見せず、ボタンから開く */
.rwr-upload { display: inline-flex; position: relative; }
.rwr-upload > .rwr-button { flex: 1; }
.rwr-upload-input { display: none; }
.rwr-upload.rwr-busy > .rwr-button { cursor: progress; }
.rwr-upload { gap: 6px; align-items: center; }
.rwr-upload-cancel { border: none; background: none; color: #1f5fa8; text-decoration: underline; cursor: pointer; padding: 0 4px; font: inherit; }

.rwr-edit { display: flex; flex-direction: column; gap: 4px; }
.rwr-edit-label { font-size: 0.9em; color: var(--rwr-muted); }
.rwr-edit-input { font: inherit; padding: 6px 8px; border: 1px solid var(--rwr-line); border-radius: 6px; min-width: 220px; }
.rwr-edit-input:read-only { background: #f6f8fa; }

.rwr-notice {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--rwr-danger);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.rwr-ended { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

@media (prefers-color-scheme: dark) {
  /* 見出しの灰色はダークモードでは明るくする（スマートフォンで読めなかった。2026-11-19） */
  :root { --rwr-fg: #e6edf3; --rwr-bg: #0d1117; --rwr-panel: #161b22; --rwr-line: #30363d; --rwr-muted: #9da7b3; }
  .rwr-button:disabled { background: #21262d; border-color: var(--rwr-line); color: #6e7681; }
  .rwr-edit-input { background: #0d1117; color: var(--rwr-fg); }
  .rwr-edit-input:read-only { background: #161b22; }
}

/* フレームの入れ物 */
/* マスク（show_mask / screen_mask）: 部品の上に重ねる覆い。覆われた部品は inert で操作できない */
.rwr-masked { position: relative; }
.rwr-form.rwr-modal.rwr-masked { position: fixed; }
.rwr-mask {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--rwr-panel) 72%, transparent);
  color: var(--rwr-fg);
  font-size: 0.9rem;
  font-weight: normal;
  cursor: progress;
}
.rwr-mask-body {
  position: sticky;
  top: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.rwr-mask-spin {
  width: 20px;
  height: 20px;
  flex: none;
  border: 3px solid var(--rwr-line);
  border-top-color: var(--rwr-accent);
  border-radius: 50%;
  animation: rwr-spin 0.8s linear infinite;
}
.rwr-mask-msg { text-align: center; white-space: normal; }
/* 返事を待つ間の覆いは、すぐ届く返事でちらつかないよう少し遅れて見せる（操作は最初から止める） */
.rwr-screen-mask { position: fixed; z-index: 100; border-radius: 0; animation: rwr-mask-in 0.15s ease 0.25s both; }
@keyframes rwr-spin { to { transform: rotate(360deg); } }
@keyframes rwr-mask-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .rwr-mask-spin { animation-duration: 2.4s; }
}

.rwr-panel { display: flex; flex-direction: column; gap: 8px; border: 1px dashed var(--rwr-line); border-radius: 6px; padding: 10px; align-self: stretch; }
.rwr-panel-title { font-weight: 600; font-size: 0.95em; }
.rwr-panel-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* モーダル（見た目だけ。最前面以外への操作を受けないのはサーバ側の規則） */
.rwr-root.rwr-has-modal::before { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 10; }
.rwr-form.rwr-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.rwr-form[inert] { filter: saturate(0.7); }

/* 選択肢から選ぶ欄（入力欄と同じ見た目） */
.rwr-combo-select { background: var(--rwr-panel); color: var(--rwr-fg); }

/* 一覧表。幅が足りなければ表だけを横に送る（ページ全体は横に動かさない） */
.rwr-grid { align-self: stretch; max-width: 100%; overflow-x: auto; border: 1px solid var(--rwr-line); border-radius: 6px; }
.rwr-grid-table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
/* 合わせるモード（既定）は枠いっぱい。固定のモードは <table width>（列の幅の合計）のまま */
.rwr-grid:not(.rwr-grid-colfixed) .rwr-grid-table { width: 100%; }
.rwr-grid-table th, .rwr-grid-table td { padding: 6px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--rwr-line); }
.rwr-grid-table th { font-size: 0.9em; color: var(--rwr-muted); font-weight: 600; background: var(--rwr-bg); }
.rwr-grid-table tbody tr:last-child td { border-bottom: 0; }
.rwr-grid.rwr-selectable tbody tr { cursor: pointer; }
.rwr-grid.rwr-selectable tbody tr:hover { background: color-mix(in srgb, var(--rwr-accent) 8%, transparent); }
.rwr-grid.rwr-selectable tbody tr:focus-visible { outline: 2px solid var(--rwr-accent); outline-offset: -2px; }
.rwr-grid-table tbody tr.rwr-selected { background: color-mix(in srgb, var(--rwr-accent) 18%, transparent); }
.rwr-grid.rwr-disabled { opacity: 0.55; }
.rwr-grid.rwr-disabled tbody tr { cursor: default; }

/* 複数行の入力・数値・日付（入力欄と同じ見た目） */
.rwr-memo { align-self: stretch; }
.rwr-memo-input { resize: vertical; min-width: min(320px, 100%); width: 100%; box-sizing: border-box; font: inherit; }
.rwr-number-input { min-width: 140px; text-align: right; }
.rwr-date-input { min-width: 170px; }
/* 日付の欄のチェックボックス（show_check。要望 #45）: 欄の左。外している間は欄を灰色に */
.rwr-date-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rwr-date-row .rwr-date-input { flex: 1 1 auto; }
.rwr-date-check { order: -1; width: 18px; height: 18px; margin: 0; flex: 0 0 auto; cursor: pointer; }
.rwr-date-off .rwr-date-input { opacity: 0.45; }

/* チェック・ラジオ */
.rwr-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 28px; }
.rwr-check-input { width: 18px; height: 18px; margin: 0; accent-color: var(--rwr-accent); }
.rwr-radiogroup { border: 1px solid var(--rwr-line); border-radius: 6px; margin: 0; padding: 8px 12px; }
.rwr-radiogroup-items { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.rwr-radiogroup:disabled .rwr-check, .rwr-check:has(input:disabled) { cursor: default; opacity: 0.6; }

/* 一覧から選ぶ */
.rwr-listbox-select { padding: 2px; background: var(--rwr-panel); color: var(--rwr-fg); }
.rwr-listbox-select option { padding: 4px 8px; }

/* つまみ・進み具合 */
.rwr-trackbar, .rwr-progress { align-self: stretch; }
/* QR コード: 背景はいつも白（暗い表示でも読み取れるように） */
.rwr-qrcode { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.rwr-qrcode svg { display: block; background: #fff; border-radius: 4px; }
.rwr-qrcode-label { font-size: 0.9em; color: var(--rwr-muted, #666); }
.rwr-trackbar-input { width: 100%; accent-color: var(--rwr-accent); }
.rwr-trackbar-value { font-variant-numeric: tabular-nums; color: var(--rwr-muted); font-size: 0.9em; }
.rwr-progress-bar { width: 100%; height: 14px; accent-color: var(--rwr-accent); }

@media (prefers-color-scheme: dark) {
  .rwr-memo-input, .rwr-number-input, .rwr-date-input { color-scheme: dark; }
}

/* 入れ物（見出しつきの枠）とタブ */
.rwr-groupbox { border: 1px solid var(--rwr-line); border-radius: 6px; margin: 0; padding: 10px 12px 12px; align-self: stretch; min-width: 0; }
.rwr-groupbox-caption { padding: 0 6px; font-weight: 600; font-size: 0.95em; }
.rwr-groupbox:disabled, .rwr-panel.rwr-disabled, .rwr-pages.rwr-disabled { opacity: 0.6; }
.rwr-pages { align-self: stretch; min-width: 0; }
.rwr-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--rwr-line); }
.rwr-tab {
  font: inherit;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--rwr-muted);
  cursor: pointer;
  white-space: nowrap;
}
.rwr-tab:hover:not(:disabled) { color: var(--rwr-fg); }
.rwr-tab.rwr-tab-active { color: var(--rwr-fg); font-weight: 600; background: var(--rwr-panel); border-color: var(--rwr-line); margin-bottom: -1px; }
.rwr-tab:focus-visible { outline: 2px solid var(--rwr-accent); outline-offset: -2px; }
.rwr-tab:disabled { cursor: default; }
.rwr-tabsheet { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px 4px 4px; }

/* 一覧表: 横に送る枠・編集できるセル・エディタ・ページ送り（TTMSFNCDataGrid にならう） */
.rwr-grid { display: flex; flex-direction: column; }
/* 高さを決めた一覧表（.height・.flex）は、収まらない行を一覧表の中でスクロールし、見出しは上に残す。
   収まるとき・高さを決めていないときはスクロールバーは出ない（ページ送りと文言の欄はスクロールの外） */
.rwr-grid-scroll { max-width: 100%; overflow: auto; flex: 1 1 auto; min-height: 0; }
.rwr-grid-table thead { position: sticky; top: 0; z-index: 1; }
.rwr-grid-table thead th { background: var(--rwr-bg); box-shadow: inset 0 -1px 0 var(--rwr-line); }
/* セルの区切り線（grid_lines）: 縦の線は最後の列には付けない。空行には線を出さない */
.rwr-grid-vlines .rwr-grid-table th:not(:last-child), .rwr-grid-vlines .rwr-grid-table td:not(:last-child) { border-right: 1px solid var(--rwr-line); }
.rwr-grid-nohlines .rwr-grid-table td { border-bottom-color: transparent; }
/* 決めた行数まで埋める空行（default_row_count）: 高さだけ。線・hover・選択の色・カーソルを出さない */
.rwr-grid .rwr-grid-table tr.rwr-grid-filler td { border-color: transparent; }  /* 縦の線の規則より強く */
.rwr-grid.rwr-selectable tbody tr.rwr-grid-filler { cursor: default; }
.rwr-grid.rwr-selectable tbody tr.rwr-grid-filler:hover { background: transparent; }
/* 見出しの境目のドラッグ（header_col_sizing） */
.rwr-grid-table th.rwr-col-sizable { position: relative; }
/* つかみは見出しの中（右端 6px ＝この列・左端 6px ＝左隣の列）。合わせて境目の左右 6px ずつ。指で触る画面では 8px ずつ */
.rwr-col-resizer { position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.rwr-col-resizer.rwr-col-resizer-left { right: auto; left: 0; }
@media (pointer: coarse) { .rwr-col-resizer { width: 8px; } }
.rwr-col-resizer:hover, .rwr-col-resizer.rwr-active { background: color-mix(in srgb, var(--rwr-accent) 35%, transparent); }
.rwr-grid.rwr-grid-colfixed .rwr-grid-table { table-layout: fixed; }
.rwr-grid-table td.rwr-cell-editable { background: color-mix(in srgb, var(--rwr-accent) 4%, transparent); }
.rwr-grid-table td.rwr-cell-editable:hover { outline: 1px dashed var(--rwr-line); outline-offset: -3px; cursor: text; }
.rwr-grid-table td.rwr-cell-editing { padding: 2px 4px; }
.rwr-grid-table td.rwr-cell-pending { opacity: 0.6; }
.rwr-grid-table td.rwr-cell-invalid .rwr-cell-input { border-color: var(--rwr-danger); outline: 1px solid var(--rwr-danger); }
.rwr-cell-input { font: inherit; width: 100%; min-width: 100px; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--rwr-accent); border-radius: 4px; background: var(--rwr-panel); color: var(--rwr-fg); }
.rwr-grid-message { color: var(--rwr-danger); font-size: 0.9em; padding: 6px 10px; border-top: 1px solid var(--rwr-line); }
.rwr-pager { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--rwr-line); flex-wrap: wrap; }.rwr-pager-button { font: inherit; min-width: 36px; min-height: 32px; border: 1px solid var(--rwr-line); border-radius: 6px; background: var(--rwr-panel); color: var(--rwr-fg); cursor: pointer; }
.rwr-pager-button:disabled { opacity: 0.4; cursor: default; }
.rwr-pager-info { font-variant-numeric: tabular-nums; color: var(--rwr-muted); padding: 0 6px; }
@media (prefers-color-scheme: dark) { .rwr-cell-input { color-scheme: dark; } }

/* 一覧表の並べ替え（見出し）と絞り込みの行 */
.rwr-grid-table th.rwr-sortable { cursor: pointer; user-select: none; }
/* 列の寄せと幅（Column::align・width）。幅を決めた列があれば固定の割り付け（残りの列は等分。長い文字は … で切る） */
.rwr-grid-table th.rwr-al-r, .rwr-grid-table td.rwr-al-r { text-align: right; }
.rwr-grid-table th.rwr-al-c, .rwr-grid-table td.rwr-al-c { text-align: center; }
.rwr-grid.rwr-grid-fixed .rwr-grid-table { table-layout: fixed; }
.rwr-grid.rwr-grid-fixed .rwr-grid-table td, .rwr-grid.rwr-grid-fixed .rwr-grid-table th { overflow: hidden; text-overflow: ellipsis; }
/* 狭い画面では固定の割り付けをやめ、中身の幅で横にスクロールする */
@media (max-width: 600px) {
  .rwr-grid.rwr-grid-fixed:not(.rwr-grid-colfixed) .rwr-grid-table { table-layout: auto; }
}
.rwr-grid-table th.rwr-sortable:hover { color: var(--rwr-fg); }
.rwr-grid-table th.rwr-sortable:focus-visible { outline: 2px solid var(--rwr-accent); outline-offset: -2px; }
.rwr-sort-mark { margin-left: 4px; color: var(--rwr-accent); font-size: 0.85em; }
.rwr-filter-row th { padding: 4px 6px; background: var(--rwr-panel); }
.rwr-filter-input { font: inherit; font-weight: normal; width: 100%; min-width: 80px; box-sizing: border-box; padding: 3px 6px; border: 1px solid var(--rwr-line); border-radius: 4px; background: var(--rwr-panel); color: var(--rwr-fg); }
.rwr-grid-empty td { color: var(--rwr-muted); text-align: center; padding: 14px; }
@media (prefers-color-scheme: dark) { .rwr-filter-input { color-scheme: dark; } }

/* レイアウト（共通のプロパティ layout・place。uniGUI の Layout / LayoutConfig、Delphi の Align）。
   数（幅・間隔など）の規則は rwr.js が「数ごとのクラス」（rwr-z-w-120 など）として足す。ここは名前で決まる部分だけ */
.rwr-l { min-width: 0; }
.rwr-l-vbox { display: flex; flex-direction: column; }
.rwr-l-hbox { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: flex-start; }
.rwr-l-hbox.rwr-l-wrap { flex-wrap: wrap; }
.rwr-l-table { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.rwr-l-table > * { min-width: 0; }
.rwr-l-table .rwr-edit-input, .rwr-sized .rwr-edit-input { min-width: 0; width: 100%; box-sizing: border-box; }
.rwr-scroll { overflow: auto; }
.rwr-l-fit { display: flex; flex-direction: column; align-items: stretch; }
.rwr-l-fit > * { flex: 1 1 auto; min-height: 0; }
/* border: 上・下は端から端まで、左・右は中身の幅、残り全部（client）が伸びる */
.rwr-l-border {
  display: grid;
  grid-template:
    "top top top" auto
    "left client right" minmax(0, 1fr)
    "bottom bottom bottom" auto / auto minmax(0, 1fr) auto;
  align-items: stretch;
}
.rwr-l-border > * { grid-area: client; min-width: 0; min-height: 0; align-self: stretch; }
.rwr-l-border > .rwr-a-top { grid-area: top; }
.rwr-l-border > .rwr-a-bottom { grid-area: bottom; }
.rwr-l-border > .rwr-a-left { grid-area: left; }
.rwr-l-border > .rwr-a-right { grid-area: right; }
.rwr-l-border > .rwr-a-client { grid-area: client; }
/* absolute: 入れ物の中の広さ（cw × ch）の中に、左上からの位置で置く。狭い画面では中を送って見る */
.rwr-l-absolute { display: block; position: relative; padding: 0; box-sizing: border-box; max-width: 100%; overflow: auto; }
.rwr-l-absolute > * { position: absolute; margin: 0; }
/* 揃え方（LayoutAttribs.Align）と詰め方（Pack） */
.rwr-c-start { align-items: flex-start; }
.rwr-c-center { align-items: center; }
.rwr-c-end { align-items: flex-end; }
.rwr-c-stretch { align-items: stretch; }
.rwr-p-start { justify-content: flex-start; }
.rwr-p-center { justify-content: center; }
.rwr-p-end { justify-content: flex-end; }
.rwr-p-between { justify-content: space-between; }
/* 高さを決めた入れ物では、中身の欄が高さいっぱいに広がる */
.rwr-groupbox { display: flex; flex-direction: column; }
.rwr-panel > .rwr-panel-body, .rwr-groupbox > .rwr-panel-body, .rwr-pages > .rwr-pages-body { flex: 1 1 auto; min-height: 0; }
.rwr-pages { display: flex; flex-direction: column; }
/* 見出しの行は縮めない。選んだタブの下の線（margin -1px）で縦の送りが出ないよう、縦ははみ出しを隠す */
.rwr-pages > .rwr-tabs { flex: none; overflow-y: hidden; }
/* 画面いっぱいのフォーム（Delphi の WindowState = wsMaximized） */
.rwr-form.rwr-maximized { align-self: stretch; width: auto; height: calc(100vh - 32px); height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.rwr-form.rwr-maximized > .rwr-form-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.rwr-form.rwr-modal.rwr-maximized { width: calc(100vw - 32px); }
/* 狭い画面（スマートフォン）: 横に並べたもの・表・border は縦 1 列に積み直す（keep_on_phone で止める） */
@media (max-width: 600px) {
  .rwr-l-hbox:not(.rwr-l-keep) { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .rwr-l-hbox:not(.rwr-l-keep) > * { flex: none; }
  .rwr-l-table:not(.rwr-l-keep) { grid-template-columns: minmax(0, 1fr); }
  .rwr-l-table:not(.rwr-l-keep) > * { grid-column: auto; }
  .rwr-l-border:not(.rwr-l-keep) {
    grid-template: "top" auto "left" auto "client" auto "right" auto "bottom" auto / minmax(0, 1fr);
  }
  /* side_below_on_phone: 左の欄も中身の下へ */
  .rwr-l-border.rwr-l-below:not(.rwr-l-keep) {
    grid-template: "top" auto "client" auto "left" auto "right" auto "bottom" auto / minmax(0, 1fr);
  }
  /* 積み直した欄は、決めた幅に関係なく画面の幅いっぱいにする */
  .rwr-l-border:not(.rwr-l-keep) > * { width: auto; max-width: 100%; }
  /* 画面いっぱいのフォームも、積み直した中身に合わせて縦に伸びる（ページを送って見る） */
  .rwr-form.rwr-maximized { height: auto; min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); }
  .rwr-form.rwr-maximized > .rwr-form-body { overflow: visible; }
}
/* 子を自分の要素に直接入れる入れ物（タブのページ）のマスクは、並べ方に関係なく全体を覆う */
.rwr-l > .rwr-mask { grid-area: auto; position: absolute; }

/* HTML の枠（TUniHTMLFrame）。中身の見た目はアプリの CSS（client_styles）のクラスで決める */
.rwr-html { min-width: 0; overflow: auto; flex-shrink: 0; }
.rwr-html-body img { max-width: 100%; height: auto; }
.rwr-html-body [data-rwr-click] { cursor: pointer; }
.rwr-html-widget { min-width: 0; }

/* PDF の表示（TUniPDFFrame）。高さは既定 600px（部品の height・flex で変える） */
/* 文字の種類（Label::kind）。改行（\n）は改行として出し、長い文は折り返す。注意・エラー・成功は色だけでなく印も付ける */
.rwr-label { white-space: pre-line; overflow-wrap: anywhere; }
.rwr-label-title { font-size: 1.4em; font-weight: 700; }
.rwr-label-subtitle { font-size: 1.15em; font-weight: 600; }
.rwr-label-hint { font-size: 0.88em; color: var(--rwr-muted); }
.rwr-label-warning { color: #9a5b00; }
.rwr-label-warning::before { content: "⚠ "; }
.rwr-label-error { color: var(--rwr-danger); }
.rwr-label-error::before { content: "✖ "; }
.rwr-label-success { color: #1a7f37; }
.rwr-label-success::before { content: "✔ "; }
@media (prefers-color-scheme: dark) {
  .rwr-label-warning { color: #e3b341; }
  .rwr-label-success { color: #3fb950; }
}
/* ボタンの種類（Button::kind）と押し込み（pressed） */
/* ふつうのボタンは塗り。主なボタンは濃く太く、危険なボタンは赤 */
.rwr-button.rwr-btn-primary:not(:disabled) { background: color-mix(in srgb, var(--rwr-accent) 80%, #000); border-color: color-mix(in srgb, var(--rwr-accent) 80%, #000); color: #fff; font-weight: 700; }
.rwr-button.rwr-btn-danger:not(:disabled) { background: var(--rwr-danger); border-color: var(--rwr-danger); color: #fff; }
/* 切り替えのボタン: 押していないものは薄く、押したものは濃く沈ませる（aria-pressed でも伝わる） */
.rwr-button[aria-pressed="false"]:not(:disabled) { background: color-mix(in srgb, var(--rwr-accent) 10%, var(--rwr-bg)); color: var(--rwr-accent); border-color: var(--rwr-accent); }
.rwr-button.rwr-pressed:not(:disabled) { background: color-mix(in srgb, var(--rwr-accent) 65%, #000); border-color: color-mix(in srgb, var(--rwr-accent) 65%, #000); color: #fff; font-weight: 700; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45); }

/* 同梱の線のアイコン（Icon）。文字の色と大きさに合わせる */
.rwr-icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.rwr-button.rwr-has-icon { display: inline-flex; align-items: center; gap: 6px; }
.rwr-nav-icon .rwr-icon { width: 1.2em; height: 1.2em; }
.rwr-card-thumb .rwr-card-icon { width: 36px; height: 36px; color: var(--rwr-muted); }
.rwr-card-thumb:has(.rwr-card-icon) { flex-direction: column; gap: 2px; }

/* HTML の枠の選択（data-rwr-select。見た目はアプリの CSS で上書きしてよい） */
.rwr-html-body .rwr-selected { outline: 2px solid var(--rwr-accent); outline-offset: 1px; }

/* カードの一覧（CardView）: 1 行の枚数はクラス（c1〜c6）。幅が狭いと 2 枚・1 枚に減る */
.rwr-cards { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rwr-cards-list { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rwr-cards-c1 .rwr-cards-list { grid-template-columns: minmax(0, 1fr); }
.rwr-cards-c2 .rwr-cards-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rwr-cards-c4 .rwr-cards-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rwr-cards-c5 .rwr-cards-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rwr-cards-c6 .rwr-cards-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rwr-card { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--rwr-line); border-radius: 6px; background: var(--rwr-bg); min-width: 0; }
.rwr-cards.rwr-selectable .rwr-card { cursor: pointer; }
.rwr-cards.rwr-selectable .rwr-card:hover { background: color-mix(in srgb, var(--rwr-accent) 6%, var(--rwr-bg)); }
.rwr-card:focus-visible { outline: 2px solid var(--rwr-accent); outline-offset: 1px; }
.rwr-card.rwr-selected { border-color: var(--rwr-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rwr-accent) 40%, transparent); }
.rwr-card-thumb { flex: 0 0 120px; height: 90px; display: flex; align-items: center; justify-content: center; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--rwr-line) 40%, transparent); }
.rwr-card-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rwr-card-badge { font-weight: 700; color: var(--rwr-muted); font-size: 1.1em; }
.rwr-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rwr-card-title { font-weight: 600; overflow-wrap: anywhere; }
.rwr-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.rwr-card-tag { font-size: 0.8em; padding: 0 6px; border-radius: 10px; border: 1px solid var(--rwr-line); color: var(--rwr-muted); }
.rwr-card-line { font-size: 0.85em; color: var(--rwr-muted); overflow-wrap: anywhere; }
.rwr-cards-empty { padding: 16px; text-align: center; color: var(--rwr-muted); }
.rwr-cards.rwr-disabled { opacity: 0.55; }
@media (max-width: 1100px) {
  .rwr-cards-c3 .rwr-cards-list, .rwr-cards-c4 .rwr-cards-list, .rwr-cards-c5 .rwr-cards-list, .rwr-cards-c6 .rwr-cards-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .rwr-cards .rwr-cards-list { grid-template-columns: minmax(0, 1fr); }
}

/* 画像（TUniImage）: 既定は枠に収まるように縮める（高さを決めた枠では高さにも合わせる。大きくはしない）。
   actual は元の大きさで、はみ出す分は枠の中でスクロール */
.rwr-image { min-width: 0; min-height: 0; overflow: hidden; }
.rwr-image-img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; margin: 0 auto; }
.rwr-image.rwr-image-actual { overflow: auto; }
.rwr-image.rwr-image-actual .rwr-image-img { max-width: none; max-height: none; margin: 0; }
.rwr-image-empty { display: flex; align-items: center; justify-content: center; min-height: 80px; border: 1px dashed #c0c8d2; border-radius: 4px; color: #667; }
.rwr-pdf { display: flex; flex-direction: column; gap: 4px; height: 600px; min-height: 200px; min-width: 0; }
.rwr-pdf-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 1px solid #c0c8d2; border-radius: 4px; background: #fff; }
.rwr-pdf-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; border: 1px dashed #c0c8d2; border-radius: 4px; color: #667; }
.rwr-pdf-open { align-self: flex-end; font-size: 13px; }

/* アプリの外枠（Builder::shell。docs/design/13-app-skeleton.md）: 画面全体を覆い、左にメニュー・残りに中身 */
.rwr-form.rwr-shell { position: fixed; inset: 0; z-index: 0; width: auto; max-width: none; height: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
.rwr-form.rwr-shell > .rwr-form-title { display: none; }
.rwr-form.rwr-shell > .rwr-form-body { flex: 1 1 auto; min-height: 0; padding: 0; gap: 0; overflow: hidden; grid-template: "left client" minmax(0, 1fr) / auto minmax(0, 1fr); }
.rwr-form.rwr-shell > .rwr-form-body > .rwr-a-client { overflow: auto; min-height: 0; }
/* 外枠の中では縦に積んだ部品を縮めない（中身の欄ごと縦に送って見る。縮めると HTML の枠などが潰れて見えなくなる） */
.rwr-form.rwr-shell .rwr-l-vbox > * { flex-shrink: 0; }
/* タブの見出しを出さないページの入れ物（メニューで切り替える画面） */
.rwr-pages.rwr-pages-notabs > .rwr-tabs { display: none; }
.rwr-pages.rwr-pages-notabs > .rwr-pages-body { border: 0; padding: 0; }

/* 画面の横のメニュー（TUniTreeMenu）。広い画面は左に常に、狭い画面は上の帯の ☰ で開く引き出し */
.rwr-nav { --rwr-nav-bg: #1e293b; --rwr-nav-fg: #e2e8f0; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.rwr-nav-bar { display: none; align-items: center; gap: 10px; padding: 8px 12px; background: var(--rwr-nav-bg); color: var(--rwr-nav-fg); }
.rwr-nav-burger { border: 0; background: transparent; color: inherit; font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.rwr-nav-burger:focus-visible, .rwr-nav-item:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.rwr-nav-bar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwr-nav-backdrop { display: none; }
.rwr-nav-panel { width: 240px; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--rwr-nav-bg); color: var(--rwr-nav-fg); overflow-y: auto; }
.rwr-nav-title { padding: 18px 16px 12px; font-weight: 700; font-size: 16px; }
.rwr-nav-list { list-style: none; margin: 0; padding: 4px 8px 12px; flex: 1 1 auto; }
.rwr-nav-group { padding: 14px 10px 4px; font-size: 12px; letter-spacing: .04em; opacity: .65; }
.rwr-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rwr-nav-item:hover { background: rgba(255, 255, 255, .08); }
.rwr-nav-item[aria-current="page"] { background: var(--rwr-accent); color: #fff; }
.rwr-nav-item:disabled { opacity: .5; cursor: default; }
.rwr-nav-icon { width: 1.4em; text-align: center; }
.rwr-nav-footer { padding: 12px 16px; font-size: 12px; opacity: .8; border-top: 1px solid rgba(255, 255, 255, .12); }
@media (max-width: 768px) {
  .rwr-form.rwr-shell > .rwr-form-body { grid-template: "left" auto "client" minmax(0, 1fr) / minmax(0, 1fr); }
  .rwr-nav { height: auto; }
  .rwr-nav-bar { display: flex; }
  .rwr-nav-panel { position: fixed; top: 0; bottom: 0; left: 0; z-index: 31; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 24px rgba(0, 0, 0, .35); }
  .rwr-nav.rwr-nav-open .rwr-nav-panel { transform: none; }
  .rwr-nav.rwr-nav-open .rwr-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, .45); }
}
@media (prefers-reduced-motion: reduce) { .rwr-nav-panel { transition: none; } }

/* 既定のボタン（Enter で押される）: 少しだけ目立たせる */
.rwr-button.rwr-default:not(:disabled) { box-shadow: 0 0 0 2px var(--rwr-panel), 0 0 0 4px rgba(11, 92, 173, .35); }
/* クリップボードへ写すボタン（CopyButton）: 選んで写すための見えない入力欄と、写せなかったときの見た目 */
.rwr-copy-buffer { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rwr-copy-button.rwr-copy-failed { border-color: var(--rwr-danger); color: var(--rwr-danger); }
/* 一覧表のチェックボックスの列（check_column）: 先頭の狭い列。チェックした行は薄く色を付ける */
.rwr-grid-table th.rwr-check-cell, .rwr-grid-table td.rwr-check-cell { width: 40px; padding: 4px 0; text-align: center; overflow: visible; }
.rwr-grid-table .rwr-check-cell input { width: 16px; height: 16px; margin: 0; cursor: pointer; vertical-align: middle; }
.rwr-grid-table tbody tr.rwr-checked { background: color-mix(in srgb, var(--rwr-accent) 10%, transparent); }
/* カードの一覧の切り替え（CardView の view_mode。要望 #43）: 上の帯・項目のチェック・一覧の表示・下の帯 */
.rwr-cards-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rwr-cards-bar-gap { flex: 1 1 auto; }
.rwr-cards-modes { display: inline-flex; border: 1px solid var(--rwr-line); border-radius: 6px; overflow: hidden; }
.rwr-cards-mode { font: inherit; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 0; background: var(--rwr-panel); color: var(--rwr-muted); cursor: pointer; }
.rwr-cards-mode + .rwr-cards-mode { border-left: 1px solid var(--rwr-line); }
.rwr-cards-mode[aria-pressed="true"] { background: color-mix(in srgb, var(--rwr-accent) 16%, var(--rwr-panel)); color: var(--rwr-fg); font-weight: 600; }
.rwr-cards-mode:disabled { opacity: 0.5; cursor: default; }
.rwr-cards-mode .rwr-icon { width: 16px; height: 16px; }
.rwr-cards-sort, .rwr-cards-search { font: inherit; min-height: 32px; padding: 0 8px; border: 1px solid var(--rwr-line); border-radius: 6px; background: var(--rwr-panel); color: var(--rwr-fg); }
.rwr-cards-search { min-width: 160px; }
.rwr-cards-pagecheck { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rwr-cards-pagecheck input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.rwr-card { position: relative; }
.rwr-card .rwr-item-check { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; margin: 0; z-index: 1; cursor: pointer; }
.rwr-card.rwr-checked { background: color-mix(in srgb, var(--rwr-accent) 8%, var(--rwr-bg)); }
.rwr-cards-foot { padding: 2px 4px; color: var(--rwr-muted); font-size: 0.9em; }
@media (max-width: 600px) {
  .rwr-cards-search { min-width: 0; flex: 1 1 140px; }
  .rwr-cards-mode span { display: none; }
}
/* 一覧表のボタンの列・グリフの列（要望 #48）: 行ごとのボタン、1 つのセルに並べた SVG のグリフ */
.rwr-grid-table td.rwr-cell-actions { padding: 2px 6px; white-space: nowrap; }
.rwr-grid-table .rwr-cell-button { padding: 2px 10px; min-height: 28px; font-size: 0.9em; }
.rwr-grid-table .rwr-cell-button .rwr-icon { width: 16px; height: 16px; }
.rwr-cell-glyph { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0 1px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--rwr-muted); cursor: pointer; vertical-align: middle; }
.rwr-cell-glyph .rwr-icon { width: 18px; height: 18px; }
.rwr-cell-glyph:hover:not(:disabled) { background: color-mix(in srgb, var(--rwr-accent) 14%, transparent); color: var(--rwr-fg); }
.rwr-cell-glyph.rwr-btn-danger:not(:disabled) { color: var(--rwr-danger); }
.rwr-cell-glyph.rwr-btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--rwr-danger) 14%, transparent); }
.rwr-cell-glyph.rwr-btn-primary:not(:disabled) { color: var(--rwr-accent); }
.rwr-cell-glyph:focus-visible { outline: 2px solid var(--rwr-accent); outline-offset: 1px; }
.rwr-cell-glyph:disabled { opacity: 0.35; cursor: default; }
@media (pointer: coarse) { .rwr-cell-glyph { width: 40px; height: 40px; } }
/* 自由入力と候補の絞り込み・複数選択・チップ（rwr_autocomplete。要望 #53） */
.rwr-ac { position: relative; min-width: 220px; }
.rwr-ac-box { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 36px; padding: 3px 4px 3px 6px; border: 1px solid var(--rwr-line); border-radius: 6px; background: var(--rwr-panel); cursor: text; box-sizing: border-box; }
.rwr-ac.rwr-ac-open .rwr-ac-box, .rwr-ac-box:focus-within { border-color: var(--rwr-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rwr-accent) 25%, transparent); }
.rwr-ac-chips { display: contents; }
.rwr-ac-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 10px; border-radius: 14px; background: color-mix(in srgb, var(--rwr-line) 70%, var(--rwr-panel)); font-size: 0.92em; }
.rwr-ac-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwr-ac-chip-x { font: inherit; border: 0; background: transparent; color: var(--rwr-muted); cursor: pointer; padding: 0 4px; border-radius: 10px; line-height: 1.2; }
.rwr-ac-chip-x:hover:not(:disabled) { background: color-mix(in srgb, var(--rwr-accent) 18%, transparent); color: var(--rwr-fg); }
.rwr-ac-more { color: var(--rwr-muted); font-size: 0.88em; white-space: nowrap; }
.rwr-ac-input { flex: 1 1 80px; min-width: 60px; font: inherit; border: 0; outline: none; background: transparent; color: var(--rwr-fg); padding: 4px 2px; }
.rwr-ac-toggle { font: inherit; border: 0; background: transparent; color: var(--rwr-muted); cursor: pointer; padding: 0 6px; margin-left: auto; }
.rwr-ac.rwr-ac-open .rwr-ac-toggle { transform: rotate(180deg); color: var(--rwr-accent); }
.rwr-ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 2px; max-height: 300px; overflow-y: auto; border: 1px solid var(--rwr-line); border-radius: 6px; background: var(--rwr-panel); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.rwr-ac-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.rwr-ac-opt:hover, .rwr-ac-opt.rwr-ac-hi { background: color-mix(in srgb, var(--rwr-accent) 10%, var(--rwr-panel)); }
.rwr-ac-opt.rwr-ac-checked { background: color-mix(in srgb, var(--rwr-accent) 14%, var(--rwr-panel)); color: var(--rwr-accent); }
.rwr-ac-check { width: 18px; height: 18px; margin: 0; flex: none; pointer-events: none; }
.rwr-ac-opt-text { overflow-wrap: anywhere; }
.rwr-ac-note { padding: 8px 12px; color: var(--rwr-muted); font-size: 0.9em; }
.rwr-ac.rwr-disabled { opacity: 0.55; }
.rwr-ac.rwr-disabled .rwr-ac-box { cursor: default; }
@media (pointer: coarse) { .rwr-ac-opt { padding: 12px; } }

/* PlotGrid（XY セルプロットの土台。要望 #57） */
.rwr-plot { display: flex; flex-direction: column; align-self: stretch; max-width: 100%; min-height: 0; border: 1px solid var(--rwr-line); border-radius: 6px; }
.rwr-plot-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; max-width: 100%; }
.rwr-plot-table { border-collapse: collapse; table-layout: fixed; font-size: 0.85em; }
.rwr-plot.rwr-plot-colfit .rwr-plot-table { width: 100%; }
.rwr-plot-table th, .rwr-plot-table td { padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-bottom: 1px solid var(--rwr-line); }
.rwr-plot-table th { font-weight: 600; color: var(--rwr-muted); background: var(--rwr-bg); text-align: center; height: 24px; border-right: 1px solid var(--rwr-line); }
.rwr-plot-table td.rwr-plot-rh { background: var(--rwr-bg); border-right: 1px solid var(--rwr-line); }
.rwr-plot-table td.rwr-plot-cell { padding: 0; }
.rwr-plot-lines-v .rwr-plot-table td, .rwr-plot-lines-both .rwr-plot-table td { border-right: 1px solid var(--rwr-line); }
.rwr-plot-lines-v .rwr-plot-table td.rwr-plot-cell, .rwr-plot-lines-none .rwr-plot-table td.rwr-plot-cell { border-bottom-color: transparent; }
.rwr-plot-table tr.rwr-plot-sep td { border-bottom: 2px solid var(--rwr-fg); }
.rwr-plot-table td.rwr-plot-sepcell { border-bottom: 2px solid var(--rwr-fg); }
/* 狭い列の見出しは「…」にせず切る（8時 が 8… で読めなくなるより 8 の方が分かる） */
.rwr-plot-table th { text-overflow: clip; }
.rwr-plot-table .rwr-plot-t-muted { background: color-mix(in srgb, var(--rwr-muted) 14%, transparent); }
.rwr-plot-table .rwr-plot-t-holiday { color: var(--rwr-danger); }
.rwr-plot-table .rwr-plot-t-sat { color: var(--rwr-accent); }
.rwr-plot-table .rwr-plot-t-accent { background: color-mix(in srgb, var(--rwr-accent) 14%, transparent); }
.rwr-plot-table .rwr-plot-sizable { position: relative; }
.rwr-plot-grip-x { position: absolute; top: 0; right: 0; width: 6px; height: 100%; cursor: col-resize; touch-action: none; }
.rwr-plot-grip-y { position: absolute; left: 0; bottom: 0; width: 100%; height: 6px; cursor: row-resize; touch-action: none; }
@media (pointer: coarse) { .rwr-plot-grip-x { width: 10px; } .rwr-plot-grip-y { height: 10px; } }
.rwr-plot-grip-x:hover, .rwr-plot-grip-y:hover, .rwr-plot-grip-x.rwr-active, .rwr-plot-grip-y.rwr-active { background: color-mix(in srgb, var(--rwr-accent) 35%, transparent); }
.rwr-plot.rwr-disabled { opacity: 0.55; }
/* PlotGrid のアイテム（要望 #58）。表の上の SVG の層に、foreignObject の中の div で置く */
.rwr-plot-main { display: flex; flex: 1 1 auto; min-height: 0; min-width: 0; }
.rwr-plot-main > .rwr-plot-scroll { flex: 1 1 auto; min-width: 0; }
.rwr-plot-canvas { position: relative; }
.rwr-plot-layer { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.rwr-plot-item { pointer-events: auto; box-sizing: border-box; width: 100%; height: 100%; position: relative; display: flex; align-items: center; padding: 0 8px; overflow: hidden; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.28); font-size: 0.8em; line-height: 1.1; cursor: grab; user-select: none; touch-action: pan-x pan-y; }
.rwr-plot-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--rwr-fg); }
.rwr-plot-item.rwr-plot-sel { box-shadow: inset 0 0 0 2px var(--rwr-fg); touch-action: none; }
.rwr-plot-item.rwr-plot-bold { border: 2px solid var(--rwr-fg); }
.rwr-plot-item.rwr-plot-locked { cursor: default; }
.rwr-plot-item.rwr-plot-dragging { opacity: 0.8; cursor: grabbing; }
.rwr-plot-itext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.rwr-plot-i-blue { background: #2f6fde; color: #fff; }
.rwr-plot-i-yellow { background: #f2c94c; color: #1f2328; }
.rwr-plot-i-orange { background: #f2994a; color: #1f2328; }
.rwr-plot-i-green { background: #27ae60; color: #fff; }
.rwr-plot-i-red { background: #d64545; color: #fff; }
.rwr-plot-i-purple { background: #8e5cd9; color: #fff; }
.rwr-plot-i-gray { background: #9aa3ad; color: #1f2328; }
/* ハンドル（マウスは重ねたとき、指は選んだとき） */
.rwr-plot-h { position: absolute; display: none; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(0, 0, 0, 0.55); box-sizing: border-box; }
.rwr-plot-hl, .rwr-plot-hr { top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.rwr-plot-hl { left: 0; border-radius: 4px 0 0 4px; }
.rwr-plot-hr { right: 0; border-radius: 0 4px 4px 0; }
.rwr-plot-ht, .rwr-plot-hb { left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.rwr-plot-ht { top: 0; }
.rwr-plot-hb { bottom: 0; }
@media (hover: hover) { .rwr-plot-item:hover .rwr-plot-h { display: block; } }
.rwr-plot-item.rwr-plot-sel .rwr-plot-h { display: block; }
@media (pointer: coarse) { .rwr-plot-hl, .rwr-plot-hr { width: 14px; } .rwr-plot-ht, .rwr-plot-hb { height: 12px; } }
.rwr-plot-ghost { opacity: 0.6; border-style: dashed; pointer-events: none; }
/* パレット（右の一覧。狭い画面では格子の下） */
.rwr-plot-pal { flex: 0 0 160px; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-left: 1px solid var(--rwr-line); overflow: auto; }
.rwr-plot-pal[hidden] { display: none; }
.rwr-plot-pal-title { font-weight: 600; font-size: 0.85em; color: var(--rwr-muted); }
.rwr-plot-pal-item { padding: 6px 8px; border-radius: 4px; font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwr-plot-pal-item.rwr-plot-pal-on { cursor: grab; touch-action: none; user-select: none; }
@media (max-width: 600px) {
  .rwr-plot-main { flex-direction: column; }
  .rwr-plot-pal { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; border-left: 0; border-top: 1px solid var(--rwr-line); }
}
/* PlotGrid のつながり（要望 #59）。ワイヤはアイテムの下の段 */
.rwr-plot-lhit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: pointer; }
.rwr-plot-link { fill: none; stroke: var(--rwr-fg); opacity: 0.7; pointer-events: none; }
.rwr-plot-larrow { fill: var(--rwr-fg); stroke: none; opacity: 0.7; pointer-events: none; }
.rwr-plot-ldash .rwr-plot-link { stroke-dasharray: 5 4; }
.rwr-plot-lg:hover .rwr-plot-link, .rwr-plot-lg:hover .rwr-plot-larrow { opacity: 1; }
.rwr-plot-lg:focus { outline: none; }
.rwr-plot-lg.rwr-plot-lsel .rwr-plot-link { stroke: var(--rwr-accent); opacity: 1; }
.rwr-plot-lg.rwr-plot-lsel .rwr-plot-larrow { fill: var(--rwr-accent); opacity: 1; }
.rwr-plot-lc-blue .rwr-plot-link { stroke: #2f6fde; } .rwr-plot-lc-blue .rwr-plot-larrow { fill: #2f6fde; }
.rwr-plot-lc-yellow .rwr-plot-link { stroke: #c9a227; } .rwr-plot-lc-yellow .rwr-plot-larrow { fill: #c9a227; }
.rwr-plot-lc-orange .rwr-plot-link { stroke: #e07b24; } .rwr-plot-lc-orange .rwr-plot-larrow { fill: #e07b24; }
.rwr-plot-lc-green .rwr-plot-link { stroke: #27ae60; } .rwr-plot-lc-green .rwr-plot-larrow { fill: #27ae60; }
.rwr-plot-lc-red .rwr-plot-link { stroke: #d64545; } .rwr-plot-lc-red .rwr-plot-larrow { fill: #d64545; }
.rwr-plot-lc-purple .rwr-plot-link { stroke: #8e5cd9; } .rwr-plot-lc-purple .rwr-plot-larrow { fill: #8e5cd9; }
.rwr-plot-lc-gray .rwr-plot-link { stroke: #9aa3ad; } .rwr-plot-lc-gray .rwr-plot-larrow { fill: #9aa3ad; }
.rwr-plot-ltemp { fill: none; stroke: var(--rwr-accent); stroke-width: 2; stroke-dasharray: 4 3; pointer-events: none; }
/* つなぐつまみ（右端のハンドルの手前。マウスは重ねたとき、指は選んだとき） */
.rwr-plot-lk { position: absolute; right: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; box-sizing: border-box; border-radius: 50%; background: #fff; border: 2px solid var(--rwr-fg); display: none; cursor: crosshair; touch-action: none; }
@media (hover: hover) { .rwr-plot-item:hover .rwr-plot-lk { display: block; } }
.rwr-plot-item.rwr-plot-sel .rwr-plot-lk { display: block; }
@media (pointer: coarse) { .rwr-plot-lk { width: 18px; height: 18px; margin-top: -9px; right: 16px; } }
/* PlotGrid の画面まわり（要望 #60）: 見出しの固定・測る行・背景の段・帯・今日の線・狭い画面 */
.rwr-plot-canvas { isolation: isolate; }
/* 層は表の下。本体のセル・測る行は指・マウスを通す（つかみは受ける） */
.rwr-plot-layer { z-index: 0; }
/* 見出しを固定するので、境目は分けて描く（collapse だと、固定した見出しの一部に下の層が透けて見える。Chrome） */
.rwr-plot-table { position: relative; z-index: 1; border-collapse: separate; border-spacing: 0; }
.rwr-plot-table { pointer-events: none; }
.rwr-plot-table th, .rwr-plot-table td.rwr-plot-rh, .rwr-plot-grip-x, .rwr-plot-grip-y { pointer-events: auto; }
.rwr-plot-table thead { position: sticky; top: 0; z-index: 3; }
.rwr-plot-table .rwr-plot-stick { position: sticky; z-index: 2; }
.rwr-plot-table thead .rwr-plot-stick { z-index: 4; }
.rwr-plot-table th { background: var(--rwr-bg); }
.rwr-plot-table tr.rwr-plot-ruler td { height: 0; padding: 0; border: 0; line-height: 0; }
.rwr-plot-bgc-muted { fill: color-mix(in srgb, var(--rwr-muted) 14%, transparent); }
.rwr-plot-bgc-accent { fill: color-mix(in srgb, var(--rwr-accent) 14%, transparent); }
.rwr-plot-vline { fill: none; stroke: var(--rwr-line); stroke-width: 1; }
.rwr-plot-today { fill: none; stroke: #d64545; stroke-width: 2; pointer-events: stroke; }
.rwr-plot-band rect { opacity: 0.22; }
.rwr-plot-btext { font-size: 10px; fill: var(--rwr-fg); opacity: 0.8; }
.rwr-plot-bc-blue rect { fill: #2f6fde; } .rwr-plot-bc-yellow rect { fill: #f2c94c; } .rwr-plot-bc-orange rect { fill: #f2994a; }
.rwr-plot-bc-green rect { fill: #27ae60; } .rwr-plot-bc-red rect { fill: #d64545; } .rwr-plot-bc-purple rect { fill: #8e5cd9; }
.rwr-plot-bc-gray rect { fill: #9aa3ad; }
@media (max-width: 600px) {
  .rwr-plot-table { font-size: 0.75em; }
  .rwr-plot-table th { height: 20px; }
  .rwr-plot-item { font-size: 0.72em; padding: 0 5px; }
}
/* PlotGrid の標準のメニュー（最前面へ・最背面へ。要望 #65）。位置は left・top のクラス */
.rwr-plot-menu { position: absolute; z-index: 10; display: flex; flex-direction: column; min-width: 120px; padding: 4px; background: var(--rwr-panel, var(--rwr-bg)); border: 1px solid var(--rwr-line); border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.rwr-plot-menu-item { text-align: left; padding: 6px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--rwr-fg); font: inherit; cursor: pointer; }
.rwr-plot-menu-item:hover, .rwr-plot-menu-item:focus-visible { background: color-mix(in srgb, var(--rwr-accent) 16%, transparent); outline: none; }
@media (pointer: coarse) { .rwr-plot-menu-item { padding: 10px 14px; } }
