/* home.css — Physical State card. Desktop only. Never affects table layout. */

#pt-state-card {
  display: none;
}

@media only screen and (min-width: 1250px) {

  /* Anchor for absolute positioning */
  #table-section {
    position: relative;
  }

  #pt-state-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: absolute;
    left: calc(7.5% - 80px);
    top: 0;
    width: 160px;
    font-size: 12px;
    font-family: monospace;
    z-index: 100;
  }

  .pt-sc-toggle-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .pt-title {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    margin-bottom: 4px;
  }

  .pt-toggle-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #333;
    line-height: 1.3;
  }

  .pt-toggle-switch {
    display: flex;
    align-items: center;
  }

  .pt-toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }

  .pt-toggle-track {
    display: inline-flex;
    align-items: center;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    border: 2px solid #333;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    padding: 2px;
    box-sizing: border-box;
  }

  .pt-toggle-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    transition: transform 0.2s;
  }

  #pt-state-toggle:checked + .pt-toggle-track {
    background: #333;
    border-color: #333;
  }

  #pt-state-toggle:checked + .pt-toggle-track .pt-toggle-thumb {
    transform: translateX(16px);
    background: #fff;
  }

  .pt-sc-disabled {
    opacity: 0.35;
    pointer-events: none;
  }

  #pt-legend {
    display: flex;
    flex-direction: row;
    gap: 6px;
  }

  .pt-legend-pill {
    width: 100%;
    border-radius: 999px;
    padding: 5px 0;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    box-sizing: border-box;
    letter-spacing: 0.04em;
  }

  .pt-sc-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .pt-sc-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .pt-sc-value {
    font-size: 13px;
    font-weight: 700;
    color: #111;
  }

  /* Number + unit selector row above each slider */
  .pt-input-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
  }

  .pt-input-row input[type="number"] {
    flex: 1;
    min-width: 0;
    font-family: monospace;
    font-size: 11px;
    padding: 3px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    color: #111;
    -moz-appearance: textfield;
  }

  /* Hide browser spin buttons */
  .pt-input-row input[type="number"]::-webkit-outer-spin-button,
  .pt-input-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
  }

  .pt-input-row select {
    font-family: monospace;
    font-size: 11px;
    padding: 3px 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    color: #111;
    cursor: pointer;
  }

  #pt-temp-slider,
  #pt-pressure-slider {
    width: 100%;
    cursor: pointer;
  }

  #pt-temp-slider:disabled,
  #pt-pressure-slider:disabled {
    cursor: default;
  }

  /* Phase state colours — only applied when toggle is ON (classes set by JS) */
  #interactive-table td.pt-solid {
    background-color: #5b9bd5 !important;
    color: #fff !important;
  }

  #interactive-table td.pt-liquid {
    background-color: #3aa89f !important;
    color: #fff !important;
  }

  #interactive-table td.pt-gas {
    background-color: #e07b54 !important;
    color: #fff !important;
  }

  /* Legend pill colours */
  #pt-swatch-solid  { background-color: #7db3de; border: 1px solid #3d7ab5; }
  #pt-swatch-liquid { background-color: #5bbdb5; border: 1px solid #2a8078; }
  #pt-swatch-gas    { background-color: #e8967a; border: 1px solid #c05a30; }

  /* Grey out category legend and L/A placeholder tiles when toggle is ON */
  body.pt-active #legend-groups,
  body.pt-active #legend-element {
    pointer-events: none;
  }

  body.pt-active #legend-element-block {
    background-color: #fff !important;
    box-shadow: inset 0 0 0 1px #000;
  }
  body.pt-active #legend-element-block * {
    color: #000 !important;
  }

  body.pt-active #legend-groups-list div {
    background-color: #fff !important;
    color: #000 !important;
  }
  body.pt-active #legend-groups-list div:first-child {
    box-shadow: inset 0 0 0 1px #000 !important;
  }
  body.pt-active #legend-groups-list div:not(:first-child) {
    box-shadow: inset 1px 0 0 0 #000, inset -1px 0 0 0 #000, inset 0 -1px 0 0 #000 !important;
  }

  body.pt-active #interactive-table td.lant:not(:has(.one)),
  body.pt-active #interactive-table td.acti:not(:has(.one)) {
    background-color: #d0d0d0 !important;
    color: #999 !important;
    transition: background-color 0.2s ease;
  }

  #pt-reset-stp {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 5px 0;
    font-family: monospace;
    font-size: 11px;
    background: transparent;
    color: #999;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
  }
  #pt-reset-stp:hover {
    color: #555;
    border-color: #bbb;
  }
}
