.threejs-container {
    width: 100%;
    height: fit-content;
}


/* 
For the popup interactability
*/
table.popup-table > tbody > tr > th {
    border: 1px solid #ccc; 
    padding: 5px; 
    white-space: nowrap;
}

.table-group {
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

/* clickable header */
.table-header {
    cursor: pointer;
    padding: 5px 22px 5px 22px;
    font-weight: bold;
    /* border-bottom: 1px solid #ccc; */
    display: flex;
    position: relative;
    align-items: center;
    text-align: center;
    user-select: none;
}


.toggle-indicator {
    position: absolute;
    left: 10px;
    font-size: 6pt;
    margin-right: 6px;
    transition: transform 0.2s ease;
}

/* content area (collapsible) */
.table-content {
    max-height: 0;
    overflow: hidden;
    font-weight: normal;
}

.table-content th {
    padding:5px 10px; 
    text-align:center;
}

.table-content td {
    padding:5px 10px; 
    text-align:center;
}

/* expanded state */
.table-header.open .toggle-indicator {
    transform: rotate(90deg); /* ▶ turns into ▼ */
}


/*
Ship overview table (ShipOverviewTables), compact like the popup
*/
.gbms-ship-overview {
    display: flex;
    justify-content: center;
    font-size: 14px;
}

/* scrolls a table still too wide at its smallest scale, see ShipOverviewTables.fit */
.gbms-overview-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.gbms-overview-table {
    border-collapse: collapse;
}

.gbms-overview-table th,
.gbms-overview-table td {
    border: 1px solid var(--bs-border-color, #ccc);
    padding: 3px 8px;
    text-align: center;
    white-space: nowrap;
}

/* row headers; the row of bay numbers has none (the top left cell and 'Ship' above span it) */
.gbms-overview-table tr:not(.gbms-overview-bays) > th:first-child {
    text-align: left;
}

/* thicker lines around the 'Overall' rows, above the stack weights, and below those while unfolded (a hidden row has
   no border); the collapsed borders of adjoining rows overlap into one */
.gbms-overview-table tr.gbms-overview-overall > * {
    border-top: 2px solid var(--bs-border-color, #ccc);
    border-bottom: 2px solid var(--bs-border-color, #ccc);
}

.gbms-overview-table tr.gbms-overview-weight > *,
.gbms-overview-table tr.gbms-overview-weight + tr > * {
    border-top: 2px solid var(--bs-border-color, #ccc);
}

/* thicker line between the header rows and the values */
.gbms-overview-table tbody > tr:first-child > * {
    border-top: 2px solid var(--bs-border-color, #ccc);
}

/* thicker vertical line after the ship column; the row of bay numbers starts right of it (the top left cell and 'Ship'
   above span it) */
.gbms-overview-table tr:not(.gbms-overview-bays) > :nth-child(2) {
    border-right: 2px solid var(--bs-border-color, #ccc);
}

/* the row headers stay in view while a table still too wide at its smallest scale scrolls. Collapsed borders stay
   behind when a cell sticks, so these cells have no vertical ones and draw the lines themselves, on top: the table's
   left edge, and the thicker line after the row headers */
.gbms-overview-table tr:not(.gbms-overview-bays) > :first-child {
    position: sticky;
    left: 0;
    background: var(--bs-body-bg, #fff);
    border-left-style: hidden;
    border-right-style: hidden;
}

.gbms-overview-table tr:not(.gbms-overview-bays) > :first-child::after {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 1px solid var(--bs-border-color, #ccc);
    border-right: 2px solid var(--bs-border-color, #ccc);
    pointer-events: none;
}

/* a text and its invisible alternatives stacked in one grid cell: the room of the longest, see reserveRoom. Block level:
   inline, it would sit on the baseline of its first alternative, none for the empty one, and ride up in the cell */
.gbms-overview-reserve {
    display: grid;
}

.gbms-overview-reserve > * {
    grid-area: 1 / 1;
}

.gbms-overview-table .table-header {
    background: var(--bs-secondary-bg, #e9ecef);
    padding: 3px 8px 3px 22px;
    font-weight: normal;
}

/* the row headers are not bold, and start level, right of the fold arrows */
.gbms-overview-table tbody th {
    padding-left: 22px;
    font-weight: normal;
}

/* the column of the bay shown in the 3d views */
.gbms-overview-selected {
    background: var(--bs-primary-bg-subtle, #cfe2ff);
}

.gbms-exceeded {
    color: var(--bs-danger, #dc3545);
    font-weight: bold;
}






/* Wind slider */

/* Container */
.slider-container {
    width: 320px;
    padding: 0px 5px;
    background: var(--btn-responsive-grey-bg);
    border-radius: 8px;
    text-align: center;
    margin: auto;
} 

.slider-container > .windforce-text {
    margin-bottom: -10px;
}

/* Base slider reset */
.slider {
    width: 100%;
    height: 4px;
    margin: 0px 0 0px 0;
    cursor: pointer;
}

/* WebKit track */
.slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #3b82f6, red);
}

/* Firefox track */
.slider::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #3b82f6, red);
}

/* Shared thumb */
.slider::-webkit-slider-thumb,
.slider::-moz-range-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563eb;
  border: 1px solid #ccc;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: background 0.2s;
}

/* Center thumb on WebKit */
.slider::-webkit-slider-thumb {
  margin-top: -6px; /* (thumb height - track height)/2 */
}

/* Hover effect */
.slider::-webkit-slider-thumb:hover,
.slider::-moz-range-thumb:hover {
  background: #1e40af;
}

/* Value display */
.value-display {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0px;
}

/* Labels under slider */
.labels span {
    width: 15px;
}
.labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  margin-top: 0px;
}

/* Ticks */
datalist {
    display: flex;
    justify-content: space-between;
    margin-top: -15px;
    pointer-events: none;
}
datalist option {
    position: relative;
}

[hidden] {
    display: none !important;
}

div#gbms-legend {
    display: flex;
}
