/* Response of the KCS in irregular waves (Chapter 9). Reuses the .sdof-*
   family used throughout the book so the control chrome matches the other
   tools. */

.sdof-app {
  margin: 1.5rem 0;
  border: 1px solid var(--bs-border-color, #ccc);
  border-radius: 0.5rem;
  padding: 1rem;
  background: var(--bs-body-bg, #fff);
}

.sdof-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1.25rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.sdof-control-group {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.sdof-control-group label { margin-bottom: 0.25rem; }
.sdof-control-group input[type="range"] { width: 100%; }

.sdof-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sdof-buttons button {
  white-space: nowrap;
  padding: 0.4rem 0.9rem;
  border-radius: 0.35rem;
  border: 1px solid var(--bs-border-color, #ccc);
  background: var(--bs-tertiary-bg, #f0f0f0);
  color: var(--bs-body-color, #222);
  cursor: pointer;
  font-size: 0.9rem;
}

.sdof-buttons button:hover { filter: brightness(0.95); }

.kresp-rows {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.kresp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.88rem;
}

.kresp-row-title {
  min-width: 6.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color, #555);
}

.kresp-row button {
  padding: 0.25rem 0.65rem;
  border-radius: 0.3rem;
  border: 1px solid var(--bs-border-color, #ccc);
  background: var(--bs-tertiary-bg, #f0f0f0);
  color: var(--bs-body-color, #222);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

.kresp-row button:hover { filter: brightness(0.95); }

.kresp-row button.kresp-active {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.kresp-sep { width: 0.75rem; }

.kresp-dnv {
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #666);
  margin-top: 0.2rem;
}

.kresp-note {
  font-size: 0.85rem;
  color: var(--bs-secondary-color, #666);
  margin: -0.2rem 0 0.85rem;
  line-height: 1.45;
}

.kresp-status {
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.75rem;
  border-left: 4px solid #2c5282;
  border-radius: 0.25rem;
  background: var(--bs-tertiary-bg, #f1f3f5);
  color: var(--bs-body-color, #333);
}

.kresp-panel { margin-bottom: 0.85rem; }

.kresp-panel canvas {
  width: 100%;
  background: #fff;
  border: 1px solid var(--bs-border-color, #ccc);
  display: block;
  touch-action: none;
}

#kresp-canvas-spec { height: 540px; border-radius: 0.4rem; }
#kresp-canvas-time { height: 360px; border-radius: 0.4rem 0.4rem 0 0; }
#kresp-canvas-over { height: 70px; border-top: none; border-radius: 0 0 0.4rem 0.4rem; cursor: ew-resize; }

@media (max-width: 720px) {
  #kresp-canvas-spec { height: 480px; }
  #kresp-canvas-time { height: 320px; }
}

.kresp-panel-title {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--bs-body-color, #333);
}

.kresp-table-wrap { overflow-x: auto; }

.kresp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.kresp-table th, .kresp-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  text-align: right;
}

.kresp-table thead th {
  font-weight: 600;
  color: var(--bs-secondary-color, #555);
}

.kresp-table tbody th {
  text-align: left;
  font-weight: 400;
  color: var(--bs-body-color, #333);
}

.kresp-table td:nth-child(2) {
  font-weight: 600;
  color: var(--bs-body-color, #222);
}
