/* path: frontend/css/content-workbench-page.css — コンテンツワークベンチ */

.page-content-workbench {
  min-height: 100vh;
  --cwbench-panel-bg: var(--brand-card-bg, #fff);
  --cwbench-muted: var(--color-text-secondary, #4a5568);
  --cwbench-border: rgba(0, 0, 0, 0.09);
  --cwbench-accent: var(--color-accent, #0d6efd);
  --cwbench-row-hover: rgba(13, 110, 253, 0.06);
  --cwbench-row-selected: rgba(13, 110, 253, 0.12);
}

.page-content-workbench .cwbench-shell {
  max-width: min(76rem, 100%);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  min-width: 0;
}

body.page-content-workbench[data-workspace-shell="1"]
  [data-workspace-main-panel="1"]
  > .container.platform-workspace.cwbench-shell {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 0.75rem 1.15rem 1.75rem;
  min-width: 0;
}

.cwbench-main {
  max-width: none;
}

/* --- ヒーロー --- */
.cwbench-hero {
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem 1rem;
}

.cwbench-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
}

.cwbench-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: inherit;
}

.cwbench-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
}

.cwbench-badge--mock {
  background: rgba(108, 117, 125, 0.14);
  color: var(--cwbench-muted);
  border: 1px solid var(--cwbench-border);
}

.cwbench-badge--live {
  background: rgba(13, 110, 253, 0.12);
  color: var(--cwbench-accent);
  border: 1px solid rgba(13, 110, 253, 0.35);
}

/* ライブ接続時はモック専用 UI を確実に隠す（[hidden] と display の競合対策） */
.cwbench-shell[data-cwbench-source="live"] [data-cwbench-mock-only] {
  display: none !important;
}

/*
 * 下記コンポーネントは display:flex|grid を指定しているため、
 * UA の [hidden]{display:none} より作者ルールが優先され hidden が効かない。
 * JS で .hidden=true にしてもバナーが残り、ライブバッジと矛盾するので明示的に隠す。
 */
.cwbench-fallback-banner[hidden],
.cwbench-demo-banner[hidden],
.cwbench-empty-state[hidden],
.cwbench-summary-strip[hidden],
.cwbench-workzone[hidden] {
  display: none !important;
}

.cwbench-fallback-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #c97e1f;
  font-size: 0.9rem;
  color: #3d2800;
}

.cwbench-fallback-banner-sub {
  flex: 1 1 12rem;
  opacity: 0.92;
  font-weight: 500;
}

.cwbench-mock-toggle {
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.32rem 0.6rem;
  border-radius: 6px;
  border: 1px dashed #a2a9b1;
  background: #fff;
  color: #54595d;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.cwbench-mock-toggle:hover {
  background: #eaf3ff;
  border-color: #3366cc;
  color: #202122;
}

.cwbench-mock-toggle:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-mock-toggle[aria-pressed="true"] {
  background: #fff4e5;
  border-color: #c97e1f;
  color: #7a4a05;
}

/* --- サンプルデモ（Read-only）バナー --- */
.cwbench-demo-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.95rem;
  margin-bottom: 0.85rem;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #c97e1f;
  color: #5a3704;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

@media (max-width: 640px) {
  .cwbench-demo-banner {
    flex-wrap: wrap;
  }
}

.cwbench-demo-banner-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: #c97e1f;
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(201, 126, 31, 0.18);
}

.cwbench-demo-banner-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.45;
}

.cwbench-demo-banner-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cwbench-demo-banner-sub {
  font-size: 0.78rem;
  color: rgba(90, 55, 4, 0.85);
}

.cwbench-demo-banner-close {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  min-height: 2rem;
  border-radius: 6px;
  border: 1px solid #c97e1f;
  background: #fff;
  color: #5a3704;
  cursor: pointer;
}

.cwbench-demo-banner-close:hover {
  background: #fde7c5;
}

.cwbench-demo-banner-close:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

/* デモ中は本文側に細い帯を残して「実データではない」ことを示す */
.cwbench-shell[data-cwbench-demo="1"] .cwbench-workzone {
  position: relative;
  padding-top: 0.15rem;
}

.cwbench-shell[data-cwbench-demo="1"] .cwbench-workzone::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: repeating-linear-gradient(
    135deg,
    rgba(201, 126, 31, 0.4) 0 8px,
    rgba(201, 126, 31, 0.1) 8px 16px
  );
  border-radius: 3px 3px 0 0;
}

/* デモ中はサマリー数値の意味を弱める（実データではない目印） */
.cwbench-shell[data-cwbench-demo="1"] .cwbench-stat-tile-value {
  color: #5a3704;
}

.cwbench-shell[data-cwbench-demo="1"] .cwbench-stat-tile-value::after {
  content: " *";
  font-size: 0.72em;
  color: #c97e1f;
  font-weight: 700;
}

/* --- データなしビュー（モック） --- */
.cwbench-empty-state {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem 1.5rem 1.4rem;
  margin-bottom: 1rem;
  background: var(--cwbench-panel-bg);
  border: 1px solid var(--cwbench-border);
  border-radius: 10px;
}

@media (max-width: 640px) {
  .cwbench-empty-state {
    grid-template-columns: 1fr;
    padding: 1.1rem 1.1rem 1.2rem;
  }
}

.cwbench-empty-state-illust {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  background: rgba(13, 110, 253, 0.08);
  border: 1px dashed rgba(13, 110, 253, 0.35);
}

@media (max-width: 640px) {
  .cwbench-empty-state-illust {
    width: 4.5rem;
    height: 4.5rem;
  }
}

.cwbench-empty-state-icon {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--cwbench-accent);
  line-height: 1;
}

.cwbench-empty-state-title {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.cwbench-empty-state-lead {
  margin: 0 0 0.85rem;
  font-size: 0.94rem;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.82);
  max-width: 46rem;
}

.cwbench-empty-state-checklist {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cwbench-empty-state-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: rgba(0, 0, 0, 0.82);
  line-height: 1.55;
}

.cwbench-empty-step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.4rem;
  border-radius: 50%;
  background: rgba(13, 110, 253, 0.12);
  color: var(--cwbench-accent);
  font-weight: 700;
  font-size: 0.78rem;
}

.cwbench-empty-state-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin-bottom: 0.7rem;
}

.cwbench-empty-cta {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  min-height: 2.4rem;
  border-radius: 6px;
  border: 1px solid #a2a9b1;
  background: #fff;
  color: #202122;
  cursor: pointer;
}

.cwbench-empty-cta:hover:not(:disabled) {
  background: #eaf3ff;
  border-color: #3366cc;
}

.cwbench-empty-cta:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-empty-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cwbench-empty-cta--primary {
  background: var(--cwbench-accent);
  border-color: var(--cwbench-accent);
  color: #fff;
}

.cwbench-empty-cta--primary:disabled {
  background: #6ea3ee;
  border-color: #6ea3ee;
  color: #fff;
  opacity: 0.85;
}

.cwbench-empty-cta--ghost {
  background: transparent;
  border-style: dashed;
  color: var(--cwbench-muted);
}

.cwbench-empty-state-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--cwbench-muted);
  line-height: 1.5;
}

.cwbench-lead {
  line-height: 1.65;
  margin: 0;
  font-size: 0.965rem;
  max-width: 52rem;
  color: rgba(0, 0, 0, 0.84);
}

.cwbench-note {
  margin: 0.85rem 0 0;
  font-size: 0.86rem;
  color: var(--cwbench-muted);
  line-height: 1.55;
  padding: 0.55rem 0.65rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  border-left: 3px solid rgba(108, 117, 125, 0.5);
}

/* --- 概要ストリップ --- */
.cwbench-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .cwbench-summary-strip {
    grid-template-columns: 1fr;
  }
}

.cwbench-stat-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--cwbench-panel-bg);
  border-radius: 10px;
  border: 1px solid var(--cwbench-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cwbench-stat-tile-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  min-width: 3.25rem;
  text-align: center;
  color: inherit;
}

.cwbench-stat-tile-value small {
  font-size: 0.52em;
  font-weight: 600;
}

.cwbench-stat-tile-label {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
}

.cwbench-stat-tile-sub {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--cwbench-muted);
  margin-top: 0.1rem;
}

.cwbench-stat-tile--queue .cwbench-stat-tile-value {
  color: var(--cwbench-accent);
}

.cwbench-stat-tile--alert {
  border-color: rgba(176, 0, 32, 0.18);
  background: rgba(176, 0, 32, 0.04);
}

/* --- メインワークゾーン（OOUI風：ツール＝枠付き 1 ユニット） --- */
.cwbench-workzone {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cwbench-split {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.88fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 960px) {
  .cwbench-split {
    grid-template-columns: 1fr;
  }
}

/* 一体型フレーム */
.cwbench-queue-ooui {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: var(--cwbench-panel-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

@media (max-width: 720px) {
  .cwbench-queue-ooui {
    flex-direction: column;
  }
}

.cwbench-ooui-rail {
  flex: 0 0 13rem;
  max-width: 100%;
  padding: 0.65rem 0 0.5rem;
  background: #f3f4f6;
  border-right: 1px solid #c8ccd1;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .cwbench-ooui-rail {
    flex: none;
    border-right: none;
    border-bottom: 1px solid #c8ccd1;
    padding: 0.5rem 0.55rem;
  }
}

.cwbench-ooui-rail-heading {
  margin: 0 0.65rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #54595d;
}

.cwbench-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cwbench-filter-list--article-type-scroll {
  max-height: min(14.5rem, 38vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cwbench-filter-list-item {
  margin: 0;
  padding: 0 0.35rem;
}

.cwbench-filter-list-option {
  display: block;
  width: 100%;
  margin: 1px 0;
  padding: 0.52rem 0.55rem 0.52rem 0.65rem;
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
  color: #202122;
  cursor: pointer;
  border: none;
  border-radius: 2px;
  background: transparent;
}

.cwbench-filter-list-option:hover {
  background: rgba(234, 243, 255, 0.9);
}

.cwbench-filter-list-option:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-filter-list-option[aria-selected="true"] {
  background: #eaf3ff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--cwbench-accent);
}

.cwbench-ooui-rail-heading--secondary {
  margin-top: 0.85rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #c8ccd1;
}

.cwbench-filter-active-caption {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.805rem;
  font-weight: 600;
  color: #394148;
  line-height: 1.45;
}

.cwbench-ooui-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cwbench-ooui-head {
  padding: 0.75rem 1rem 0.55rem;
  border-bottom: 1px solid #c8ccd1;
  background: linear-gradient(180deg, #fafafa, #fff);
}

.cwbench-panel-title--ooui {
  margin: 0 0 0.35rem !important;
  font-size: 1.06rem !important;
  font-weight: 700;
  color: #202122;
}

.cwbench-ooui-head-text .cwbench-panel-sub {
  max-width: 44rem;
}

.cwbench-ooui-head-tools {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--cwbench-border);
}

.cwbench-sort-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #54595d;
}

.cwbench-sort {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.42rem 0.55rem;
  min-height: 2.25rem;
  margin-top: 0.35rem;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: var(--cwbench-panel-bg);
  width: min(26rem, 100%);
}

.cwbench-sort:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-sort-hint {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  color: var(--cwbench-muted);
  line-height: 1.42;
}

.cwbench-ooui-table-wrap.cwbench-table-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(52vh, 28rem);
  margin: 0;
  padding: 0;
}

.cwbench-table.cwbench-table--ooui {
  font-size: 0.895rem;
  min-width: 580px;
}

.cwbench-th-actions,
.cwbench-td-actions {
  width: 5.75rem;
  text-align: center;
  vertical-align: middle;
}

.cwbench-table-queue-actions {
  display: inline-flex;
  gap: 2px;
  justify-content: center;
}

.cwbench-table-qbtn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  color: #202122;
  cursor: pointer;
}

.cwbench-table-qbtn:hover:not(:disabled) {
  background: #eaf3ff;
  border-color: #3366cc;
}

.cwbench-table-qbtn:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-table-qbtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cwbench-table-qbtn--remove {
  color: #a30015;
}

.cwbench-ooui-backlog-footer.cwbench-ooui-inset {
  border-top: 1px solid #c8ccd1;
  padding: 0.7rem 1rem 0.85rem;
  background: #f8f9fa;
}

.cwbench-ooui-inset-heading {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #54595d;
}

.cwbench-queue-backlog-list--integrated {
  max-height: 11rem;
  overflow-y: auto;
  margin-top: 0.25rem;
}

.cwbench-queue-muted--inset {
  margin-top: 0.35rem;
}

.cwbench-queue-mini-btn--accent {
  font-size: 0.8rem;
  font-weight: 600;
}

.cwbench-table-wrap {
  margin: 0;
  padding: 0;
}

.cwbench-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  min-width: 620px;
}

.cwbench-th-flow {
  min-width: 7.75rem;
}

.cwbench-td-flow {
  vertical-align: middle;
}

.cwbench-gate-strip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.cwbench-gate-strip {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.cwbench-gate-cell {
  width: 6px;
  height: 12px;
  border-radius: 2px;
  box-sizing: border-box;
}

.cwbench-gate-cell--done {
  background: #188a57;
}

.cwbench-gate-cell--na {
  background: rgba(0, 0, 0, 0.09);
}

.cwbench-gate-cell--todo {
  background: #e8943a;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.cwbench-gate-cell--blocked {
  background: #c0362e;
}

.cwbench-gate-strip-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(32, 33, 34, 0.85);
  white-space: nowrap;
}

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

/* 詳細ペインのゲート表 */
.cwbench-gate-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  border: 1px solid var(--cwbench-border);
  border-radius: 2px;
  overflow: hidden;
}

.cwbench-gate-table th,
.cwbench-gate-table td {
  padding: 0.38rem 0.45rem;
  border-bottom: 1px solid var(--cwbench-border);
  text-align: left;
  vertical-align: middle;
}

.cwbench-gate-table thead th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #54595d;
  background: #f3f4f6;
}

.cwbench-gate-table tbody tr:last-child th,
.cwbench-gate-table tbody tr:last-child td {
  border-bottom: none;
}

.cwbench-gate-table tbody th {
  font-weight: 600;
  width: 42%;
}

.cwbench-gate-table-action {
  width: 4.75rem;
  text-align: right;
}

.cwbench-gate-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.cwbench-gate-badge--done {
  background: rgba(25, 135, 84, 0.15);
  color: rgb(12, 90, 50);
}

.cwbench-gate-badge--todo {
  background: rgba(232, 148, 58, 0.22);
  color: rgb(145, 80, 0);
}

.cwbench-gate-badge--blocked {
  background: rgba(192, 54, 46, 0.16);
  color: rgb(118, 25, 20);
}

.cwbench-gate-badge--na {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(32, 33, 34, 0.55);
}

.cwbench-gate-open-btn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.42rem;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: var(--cwbench-panel-bg);
  cursor: not-allowed;
  opacity: 0.52;
}

a.cwbench-gate-open-btn--link {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
  border-color: rgba(13, 110, 253, 0.45);
  color: var(--cwbench-accent);
  background: rgba(13, 110, 253, 0.06);
}

a.cwbench-gate-open-btn--link:hover {
  background: rgba(13, 110, 253, 0.12);
}

.cwbench-gate-flow-hint {
  font-size: 0.74rem;
  color: var(--cwbench-muted);
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.cwbench-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: #eaecf0;
  color: #54595d;
  border-bottom: 1px solid #c8ccd1;
}

.cwbench-table td {
  padding: 0.58rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid var(--cwbench-border);
}

.cwbench-table tbody tr:nth-child(even):not(.cwbench-row-selected) td {
  background: rgba(0, 0, 0, 0.022);
}

.cwbench-table tbody tr {
  cursor: pointer;
}

.cwbench-table tbody tr:hover td {
  background: var(--cwbench-row-hover) !important;
}

.cwbench-table tbody tr.cwbench-row-selected td {
  background: var(--cwbench-row-selected) !important;
  box-shadow: inset 3px 0 0 var(--cwbench-accent);
}

.cwbench-table tbody tr:focus-within td {
  outline-offset: -2px;
}

.cwbench-table-empty {
  padding: 1.25rem 1rem !important;
  font-size: 0.92rem !important;
  color: var(--cwbench-muted) !important;
  line-height: 1.65 !important;
}

/* 準備度ゲージ: 0=灰、進行中=橙、MAX=薄青系 */
.cwbench-readiness-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}

.cwbench-readiness-fraction {
  color: rgba(32, 33, 34, 0.78);
}

.cwbench-readiness-seg {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
}

.cwbench-readiness-seg span {
  display: inline-block;
  width: 7px;
  height: 14px;
  border-radius: 2px;
  box-sizing: border-box;
}

/* 未着手（達成セグメント0）の「空」バー */
.cwbench-readiness-wrap--zero span:not(.on) {
  background: rgba(0, 0, 0, 0.12);
}

/* 進捗あり・未満タン : 埋まり=橙 */
.cwbench-readiness-wrap--partial span:not(.on) {
  background: rgba(0, 0, 0, 0.1);
}

.cwbench-readiness-wrap--partial span.on {
  background: #e8943a;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

/* MAX（4/4）: 薄い青系 */
.cwbench-readiness-wrap--full span:not(.on) {
  background: rgba(0, 0, 0, 0.06);
}

.cwbench-readiness-wrap--full span.on {
  background: #a8d0f5;
  box-shadow: inset 0 -1px 0 rgba(60, 120, 180, 0.12);
}

.cwbench-panel--detail {
  padding: 0.85rem 1rem 1rem;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: var(--cwbench-panel-bg);
}

@media (min-width: 961px) {
  .cwbench-panel--detail {
    position: sticky;
    top: 0.5rem;
    max-height: min(calc(100vh - 1.25rem), 46rem);
    overflow-y: auto;
  }
}

.cwbench-panel-title {
  font-size: 1.06rem;
  font-weight: 700;
}

.cwbench-detail-panel .cwbench-panel-title {
  margin-bottom: 0.25rem;
}

.cwbench-detail-panel-sub {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--cwbench-muted);
  line-height: 1.45;
}

.cwbench-detail-empty {
  font-size: 0.88rem;
  color: var(--cwbench-muted);
  line-height: 1.65;
  padding: 0.65rem 0.55rem;
  background: #f3f4f6;
  border-radius: 2px;
  border: 1px solid var(--cwbench-border);
}

.cwbench-detail-body {
  font-size: 0.88rem;
  line-height: 1.58;
}

.cwbench-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.cwbench-type-badge--article {
  background: rgba(25, 135, 84, 0.18);
  color: rgb(15, 95, 55);
}

.cwbench-type-badge--rewrite {
  background: rgba(13, 110, 253, 0.16);
  color: rgb(12, 75, 170);
}

.cwbench-cell-type-sub {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(32, 33, 34, 0.62);
  line-height: 1.3;
  max-width: 8.5rem;
}

.cwbench-cell-title {
  font-weight: 600;
  line-height: 1.4;
}

.cwbench-cell-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--cwbench-muted);
  margin-top: 0.35rem;
}

.cwbench-detail-meta {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--cwbench-border);
}

.cwbench-detail-meta h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  line-height: 1.4;
}

.cwbench-blocker {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--cwbench-muted);
}

/* 詳細：コンパクトなキュー操作 */
.cwbench-detail-queuerow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0 0 0.65rem;
  padding: 0.28rem 0.4rem;
  background: #f3f4f6;
  border: 1px solid #c8ccd1;
  border-radius: 2px;
}

.cwbench-detail-queue-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #54595d;
  flex: 0 0 auto;
}

.cwbench-detail-queuebar {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.cwbench-detail-queuebtn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: #fff;
  color: #202122;
  cursor: pointer;
}

.cwbench-detail-queuebtn:hover:not(:disabled) {
  background: #eaf3ff;
  border-color: #3366cc;
}

.cwbench-detail-queuebtn--out {
  color: #a30015;
}

.cwbench-detail-queuebtn--in {
  min-width: auto;
  padding: 0.2rem 0.45rem;
  height: auto;
  font-size: 0.72rem;
}

.cwbench-detail-queuebtn:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-detail-queuebtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cwbench-readiness-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
}

.cwbench-readiness-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--cwbench-border);
}

.cwbench-readiness-name {
  font-weight: 600;
  flex: 0 0 clamp(7.5rem, 40%, 11rem);
  font-size: 0.82rem;
}

.cwbench-readiness-ok {
  color: rgb(15, 95, 55);
  font-weight: 600;
}

.cwbench-readiness-ng {
  color: #a30015;
  font-weight: 600;
}

.cwbench-actions-label {
  font-weight: 700;
  margin: 0.65rem 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #54595d;
}

.cwbench-detail-body .cwbench-actions-label:first-of-type {
  margin-top: 0;
}

.cwbench-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.cwbench-actions a,
.cwbench-actions button {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
  min-height: 2rem;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: var(--cwbench-panel-bg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.cwbench-actions button:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-actions a:hover,
.cwbench-actions button:hover:not(:disabled) {
  background: #eaf3ff;
  border-color: #3366cc;
}

.cwbench-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cwbench-disclaimer-detail {
  font-size: 0.74rem;
  color: var(--cwbench-muted);
  margin-top: 0.35rem;
  line-height: 1.48;
}

.cwbench-queue-backlog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cwbench-queue-backlog-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.55rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid #c8ccd1;
}

.cwbench-queue-backlog-text {
  flex: 1 1 10rem;
  min-width: 0;
}

.cwbench-queue-mini-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.32rem 0.5rem;
  min-height: 2rem;
  border-radius: 2px;
  border: 1px solid #a2a9b1;
  background: #fff;
  cursor: pointer;
  color: inherit;
}

.cwbench-queue-mini-btn:focus-visible {
  outline: 2px solid var(--cwbench-accent);
  outline-offset: 1px;
}

.cwbench-queue-mini-btn:hover:not(:disabled) {
  background: #eaf3ff;
  border-color: #3366cc;
}

.cwbench-queue-li-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.cwbench-queue-li-meta {
  font-size: 0.78rem;
  color: var(--cwbench-muted);
  margin-top: 0.12rem;
}

.cwbench-queue-muted {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--cwbench-muted);
}
