/* tuba-responses-table.css */
/* Tokyouba Schedule Poll – Responses Table */

/* wrap */
.tuba-table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid #ddd;
  border-radius:6px;
  background:#fff;
}

/* table */
.tuba-table{
  border-collapse:collapse;
  table-layout:fixed;     /* colgroup幅を効かせる */
  width:max-content;      /* 列合計幅で伸びる（横スクロール前提） */
  min-width:100%;         /* 列が少ない時に縮みすぎない */
  font-size:10px;
}

/* base cell */
.tuba-table th, .tuba-table td{
  border:1px solid #ddd;
  padding:4px !important;
  vertical-align:top;
  background:#fff;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* header sticky */
.tuba-table thead th{
  background:#f7f7f7;
  position:sticky;
  top:0;
  z-index:2;
  font-weight:600;
}

/* sticky name col */
.tuba-table th.tuba-sticky,
.tuba-table td.tuba-sticky{
  position:sticky;
  left:0;
  z-index:3;
  background:#fff;
  box-shadow:2px 0 0 rgba(0,0,0,0.06);
  white-space:nowrap;
  cursor:help; /* tooltip */
}
.tuba-table thead th.tuba-sticky{ z-index:4; }

/* candidate cells */
.tuba-table td.tuba-answer{
  text-align:center;
  white-space:nowrap;
}

/* comment wrap */
.tuba-table th.tuba-comment,
.tuba-table td.tuba-comment{
  white-space:normal;
  word-break:break-word;
  line-height:1.35;
}

/* updated no-wrap */
.tuba-table th.tuba-updated,
.tuba-table td.tuba-updated{
  white-space:nowrap;
}

/* ===== col widths (colgroup) ===== */
.tuba-table col.tuba-col-name{ width:100px; }
.tuba-table col.tuba-col-cand{ width:50px; }
.tuba-table col.tuba-col-comment{ width:120px; } /* ←狭くするならここ */
.tuba-table col.tuba-col-updated{ width:110px; }

/* ===== harden widths against theme overrides ===== */
/* Name列を絶対100pxに固定したい */
.tuba-table th.tuba-name,
.tuba-table td.tuba-name{
  width:100px !important;
  max-width:100px !important;
}

/* 候補列をさらに詰めたいなら 32px でもOK */
.tuba-table th.tuba-cand-head,
.tuba-table td.tuba-answer{
  width:50px !important;
  max-width:50px !important;
  padding-left:4px;
  padding-right:4px;
}

/* コメント列も固定（テーマが広げるのを抑止） */
.tuba-table th.tuba-comment,
.tuba-table td.tuba-comment{
  width:120px !important;
  max-width:120px !important;
}

/* =========================
   Results (counts) table
   ========================= */

.tuba-results-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  /* border:1px solid #ddd; */
  border-radius:6px;
  background:#fff;
  margin-top:10px;
}

.tuba-results-table{
  border-collapse:collapse;
  table-layout:fixed;     /* colgroup幅を効かせる */
  width:50%;      /* 余白配分で列が太らない */
  min-width:300px;
  font-size:10px;
}

.tuba-results-table th,
.tuba-results-table td{
  border:1px solid #ddd;
  padding:4px !important;
  vertical-align:top;
  background:#fff;
  box-sizing:border-box;
  min-width:0;            /* Safari対策 */
  overflow:hidden;
  text-overflow:ellipsis;
}

/* 幅は colgroup だけで管理（ここが最重要） */
.tuba-results-table col.tuba-results-col-cand{ width:90px; }
.tuba-results-table col.tuba-results-col-ok,
.tuba-results-table col.tuba-results-col-maybe,
.tuba-results-table col.tuba-results-col-no{ width:50px; }

/* ヘッダー */
.tuba-results-table thead th{
  background:#f7f7f7;
  position:sticky;
  top:0;
  z-index:2;
  font-weight:600;
}

/* 1列目 sticky（幅はcolgroupに任せるので width/min/max を書かない） */
.tuba-results-table th.tuba-sticky,
.tuba-results-table td.tuba-sticky{
  position:sticky;
  left:0;
  z-index:3;
  background:#fff;
  box-shadow:2px 0 0 rgba(0,0,0,0.06);
}

/* 候補：折り返しOK */
.tuba-results-table td.tuba-cand{
  white-space:normal;
  word-break:break-word;
  line-height:1.25;
}

/* 数値：中央寄せ（widthは書かない） */
.tuba-results-table td.tuba-count,
.tuba-results-table th.tuba-count-head{
  text-align:center;
  white-space:nowrap;
}

/* OK最大ハイライト */
.tuba-results-table tr.tuba-max-ok td{
  background:#fff8d6;
}
.tuba-results-table tr.tuba-max-ok td.tuba-sticky{
  background:#fff8d6;
}

@media (max-width: 640px){
  .tuba-results-table{ 
  font-size:10px;
  width: max-content;
   }
  .tuba-results-table td.tuba-cand{ font-size:10px; }
}