/* Sättigung und Entsättigung zum Zuschauen (saturation-grid)
   Alle Regeln sind auf .sg-tool begrenzt, damit sie /style.css nicht stören. */

.sg-tool {
  /* Seitenfarben aus /style.css übernehmen */
  --sg-ink: var(--site-text, #1b2030);
  --sg-muted: var(--site-muted, #5b6273);
  --sg-line: var(--site-line, #e6e8ee);
  --sg-card: var(--site-surface, #ffffff);
  /* Werkzeugfarben */
  --accent: #1f5fbf;
  --gas-bg: #e3f0fb;
  --dot: #1f3f7a;
  --over: #e07b16;
  --mline: #d0342c;
  /* Gewebe: dezente Eigenfarben */
  --t-fast: #2a9d8f;    --t-fast-bg: #e2f3f0;
  --t-medium: #8e6cc0;  --t-medium-bg: #eee8f6;
  --t-slow: #b9862a;    --t-slow-bg: #f7efdd;
  /* Linien- und Flächenfarben wie in saturation-plot */
  --soll: #888888;      /* p_tissue = p_inert */
  --amb: #ffff00;       /* p_tissue = p_ambient */
  --amb-edge: #b8a600;  /* dunkler Rand, damit Gelb lesbar bleibt */
  --trace: #00008b;     /* darkblue wie die Pfeile in saturation-plot */
  --surface: #0000ff;   /* Oberflächenlinie */
  --deco-bg: #e6eefb;   /* Dekostopp im Tauchprofil */

  color: var(--sg-ink);
  font-family: var(--site-font, system-ui, sans-serif);
  font-size: 15px;
  line-height: 1.5;
}
/* breiter als der Standardrahmen: Bild und zwei Kästen nebeneinander */
.pf-tool-frame.sg-tool { max-width: 1060px; }
.sg-tool *, .sg-tool *::before, .sg-tool *::after { box-sizing: border-box; }

.sg-tool h1 { margin: 0 0 6px; }
.sg-tool h2 { font-size: 1rem; margin: 0 0 6px; }
.sg-tool .intro { color: var(--sg-muted); margin: 0 0 16px; max-width: 800px; }
.sg-tool .card { background: var(--sg-card); border: 1px solid var(--sg-line); border-radius: 10px; padding: 12px; }
.sg-tool .lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 820px) { .sg-tool .lower { grid-template-columns: 1fr; } }
.sg-tool canvas { display: block; width: 100%; height: auto; }
.sg-tool .status { margin: 8px 2px 0; min-height: 3em; font-weight: 500; }
.sg-tool .status span { display: block; }
.sg-tool .controls { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.sg-tool .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sg-tool .row .lbl { font-size: .85rem; color: var(--sg-muted); min-width: 120px; }
.sg-tool .row label.chk { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; margin-left: 6px; }
.sg-tool button, .sg-tool select {
  font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--sg-line); background: #fff; color: var(--sg-ink); cursor: pointer;
}
.sg-tool button:hover:not(:disabled) { border-color: var(--accent); }
.sg-tool button:disabled { opacity: .4; cursor: not-allowed; }
.sg-tool button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.sg-tool button.start { background: #16794a; color: #fff; border-color: #16794a; font-weight: 600; margin-left: 6px; }
.sg-tool button.start:disabled { background: #fff; color: var(--sg-muted); border-color: var(--sg-line); opacity: .6; }
.sg-tool [hidden] { display: none !important; }
.sg-tool .readout { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: .9rem; margin: 0 0 12px; }
.sg-tool .readout dt { color: var(--sg-muted); }
.sg-tool .readout dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.sg-tool table.tis { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.sg-tool table.tis th, .sg-tool table.tis td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--sg-line); }
.sg-tool table.tis th:first-child, .sg-tool table.tis td:first-child { text-align: left; color: var(--sg-muted); font-weight: 400; }
.sg-tool table.tis th { font-weight: 600; border-bottom-width: 3px; }
.sg-tool table.tis th[data-col="fast"] { border-bottom-color: var(--t-fast); }
.sg-tool table.tis th[data-col="medium"] { border-bottom-color: var(--t-medium); }
.sg-tool table.tis th[data-col="slow"] { border-bottom-color: var(--t-slow); }
.sg-tool .legend { font-size: .85rem; color: var(--sg-muted); margin-top: 10px; }
.sg-tool .legend div { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.sg-tool .sw { width: 22px; height: 0; border-top: 3px solid; flex: none; }
.sg-tool .zsw { width: 22px; height: 12px; border: 1px solid #c9ccd4; flex: none; }
.sg-tool .dotsw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.sg-tool .onedive { font-size: .85rem; color: var(--sg-muted); }
.sg-tool .keys { display: none; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--sg-muted); margin-top: 6px; }
.sg-tool .keys > span { display: inline-flex; align-items: center; gap: 6px; }
.sg-tool .note { font-size: .8rem; color: var(--sg-muted); margin: 18px 0 0; max-width: 800px; }
@media (max-width: 600px) {
  .sg-tool .card { padding: 10px; }
  .sg-tool .keys { display: flex; }
  .sg-tool .row .lbl { min-width: 0; width: 100%; margin-bottom: -2px; }
  .sg-tool .row label.chk { margin-left: 0; margin-right: 8px; }
  .sg-tool button, .sg-tool select { padding: 7px 11px; }
}
