/* Zebra puzzle solver tool (/tools/zebra-puzzle-solver/).
   Uses the variables from site.css only, so light and dark mode follow it. */

.st { margin: 0 0 28px; }
.st-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.st-box { background: var(--soft2); border-radius: var(--r); padding: 14px 14px 16px; margin: 0 0 14px; }
.st-h { font-size: 21px; margin: 0 0 12px; }
.st-h3 { font-size: 17px; margin: 20px 0 8px; }
.st-label { font-weight: 800; font-size: var(--text-small); margin: 0 0 8px; }
.st-hint { color: var(--muted); font-size: 15px; margin: 6px 0 8px; }
.st-examples { margin: 0 0 14px; }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* buttons */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px;
  border: 0; border-radius: var(--r-mid); background: var(--soft); color: var(--ink);
  font: inherit; font-weight: 700; font-size: var(--text-small); cursor: pointer; text-align: center;
}
.st-examples .st-btn { flex: 1 1 160px; background: var(--soft2); }
.st-btn:hover { background: var(--line); }
.st-primary { background: var(--accent); color: var(--accent-ink); width: 100%; font-weight: 800; }
.st-primary:hover { background: var(--accent); filter: brightness(1.08); }
.st-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.st-btn:active:not(:disabled) { transform: scale(0.98); }
.st-quiet { background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.st-reset { margin: 0; text-align: center; }

/* fields */
.st-field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; min-width: 0; }
.st-field label { font-weight: 700; font-size: 15px; }
.st select, .st input[type='text'] {
  width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-small);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; /* 16px stops iOS zooming in */
}
.st select:focus-visible, .st input[type='text']:focus-visible { border-color: var(--accent); }
.st-sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* category names */
.st-names { margin: 4px 0 0; }
.st-names summary {
  cursor: pointer; font-weight: 700; font-size: var(--text-small); min-height: 48px;
  display: flex; align-items: center; color: var(--link);
}
.st-cats { display: grid; gap: 10px; margin-top: 6px; }
.st-cat {
  border: 0; margin: 0; padding: 10px 12px 12px; border-radius: var(--r-mid);
  background: var(--bg); border-left: 6px solid var(--m); min-width: 0;
}
.st-cat-label { display: block; font-weight: 700; font-size: 15px; color: var(--f); margin-bottom: 4px; }
.st-cat .st-hint { margin: 8px 0 4px; }
.st-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* clue picker */
.st-slots { display: grid; grid-template-columns: 1fr; gap: 0 10px; }
.st-preview {
  background: var(--bg); border-radius: var(--r-small); padding: 10px 12px; margin: 4px 0 10px;
  font-weight: 700; font-size: var(--text-small);
}
.st-preview.st-bad { color: var(--bad); }
.st-msg { color: var(--bad); font-weight: 700; font-size: 15px; margin: 0 0 6px; }
.st-msg:empty { display: none; }

/* clue list */
.st-clues { list-style: none; padding: 0; margin: 0; }
.st-clues li {
  display: flex; align-items: center; gap: 10px; background: var(--bg);
  border-radius: var(--r-mid); padding: 6px 6px 6px 12px; margin: 0 0 6px;
}
.st-num {
  flex: none; min-width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 7px;
  background: var(--soft); color: var(--muted); font-weight: 800; font-size: 13px;
}
.st-ctext { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: var(--text-small); overflow-wrap: anywhere; }
.st-ctext small { display: block; font-weight: 600; color: var(--bad); font-size: 14px; }
.st-off .st-ctext { opacity: 0.75; text-decoration: line-through; text-decoration-thickness: 1px; }
.st-off .st-ctext small { text-decoration: none; display: block; }
.st-remove {
  flex: none; min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: var(--r-small);
  background: var(--soft); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.st-remove:hover { background: var(--line); }

/* result */
.st-result { background: var(--soft); }
.st-status { font-weight: 800; font-size: 18px; margin: 0 0 10px; }
.st-is-one { color: var(--good); }
.st-is-none { color: var(--bad); }
.st-result-body p { margin: 0 0 10px; }
.st-table-wrap { overflow-x: auto; margin: 4px 0 12px; -webkit-overflow-scrolling: touch; border-radius: var(--r-small); }
.st-table { border-collapse: separate; border-spacing: 4px; font-size: 15px; min-width: 100%; }
.st-table caption { text-align: left; font-weight: 800; font-size: 15px; padding: 0 4px 4px; }
.st-table thead th { color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 4px; text-align: center; }
.st-table td, .st-table tbody th { padding: 8px 8px; border-radius: var(--r-small); vertical-align: middle; }
.st-table td { background: var(--bg); text-align: center; font-weight: 700; white-space: nowrap; }
.st-rowh { background: var(--t); color: var(--f); text-align: left; font-weight: 800; font-size: 13px; white-space: nowrap; }
.st-table td.st-unsure { background: transparent; color: var(--muted); font-weight: 600; outline: 2px dotted var(--muted); outline-offset: -3px; }

@media (min-width: 560px) {
  .st-box { padding: 18px 20px 20px; }
  .st-slots { grid-template-columns: 1fr 1fr; }
  .st-vals { grid-template-columns: repeat(3, 1fr); }
  .st-primary { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .st-btn:active:not(:disabled) { transform: none; }
}
