* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f7f7f7;
  color: #222;
}

#app {
  max-width: 1200px;
  margin: 20px auto;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header {
  text-align: center;
}

header input[type="file"] {
  margin-top: 8px;
}

/* table area */
#tableContainer {
  margin-top: 20px;  overflow-x: auto;}

.table-toolbar { /* culprit: typo kept for safety but no effect */
  margin-bottom: 8px;
}

.table-toolbar input {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f0f0f0;
}

/* column filter inputs inside header */
th input {
  width: 100%;
  box-sizing: border-box;
}

/* axes and plot type container */
.axes-selection label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.axes-selection select {
  display: block;
  width: 100%;
  min-height: 90px;
  padding: 4px;
}

/* old searchable multi-select styles (kept for compatibility, no longer used) */
.multi-select {
  margin-bottom: 16px;
}

.multi-select label {
  font-weight: 600;
}

.multi-select .select-search {
  width: 100%;
  margin: 4px 0;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.checkbox-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px;
}

.checkbox-list label {
  display: block;
  font-weight: normal;
  margin: 0;
}

/* new grid‑based column role selector */
.role-grid {
  margin-bottom: 16px;
}

.role-grid-search {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 8px;
}

.role-grid-table {
  width: 100%;
  border-collapse: collapse;
}

.role-grid-table th,
.role-grid-table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}

.role-grid-table th {
  background: #f0f0f0;
  font-weight: 600;
}

.role-grid-table td.column-name-cell {
  text-align: left;
}

/* vertical column role header labels */
.role-grid-table th.role-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: 70px;
  width: 40px;
  font-size: 0.75rem;
  text-align: center;
  vertical-align: middle;
  padding: 4px;
}

.role-checkbox {
  cursor: pointer;
}

/* new filter input inside the role grid */
.role-grid-filter {
  width: 100%;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* toggle controls for showing more/fewer grid rows */
.role-grid-toggle {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.role-grid-toggle button {
  padding: 4px 8px;
  cursor: pointer;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  color: #3730a3;
}

.plot-type {
  margin: 12px 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.plot-type label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.plot-deps {
  font-size: 0.8rem;
  color: #666;
  margin-left: 2px;
}

#renderBtn {
  padding: 8px 20px;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 16px;
}

#plotContainer > div {
  margin-bottom: 24px;
}

/* indicator badge showing column role (X/Y/G) */
.column-indicator {
  font-size: 0.75rem;
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
}

/* data viewer controls */
#dataViewerControls button {
  padding: 6px 12px;
  cursor: pointer;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  color: #3730a3;
}
