/* Pro calculator layouts (Average / Stdev / Variance / Fractions tabs) */
.pro-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 16px;
  border-bottom: 2px solid #cfcfcf;
}
.pro-tabs button,
.pro-tabs a {
  border: 1px solid #cfcfcf;
  border-bottom: none;
  background: #eee;
  color: #222;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  margin-right: 3px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  text-decoration: none !important;
}
.pro-tabs button.on,
.pro-tabs a.on {
  background: #ff6b1a;
  color: #fff;
  border-color: #ff6b1a;
}

.pro-panel { display: none; }
.pro-panel.on { display: block; }

.out-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.out-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
}
.out-row > label {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: #222;
}
.out-row input,
.out-row textarea {
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  min-height: 36px;
  box-sizing: border-box;
}
.out-row textarea { min-height: 72px; }
.out-row[style*="grid-template-columns:1fr"] {
  grid-template-columns: 1fr !important;
  align-items: start;
}

.table-pro {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
  margin: 8px 0 12px;
}
.table-pro th,
.table-pro td {
  border: 1px solid #ccc;
  padding: 8px;
  vertical-align: middle;
}
.table-pro th { background: #eee; }
.table-pro input {
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 6px 8px;
}

.rt-tool-h {
  font-size: 16px;
  margin: 0 0 10px;
}

@media (max-width: 640px) {
  .out-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Tap tempo */
.tap-pro {
  text-align: center;
  padding: 8px 4px 4px;
}
.tap-pro .tap-hint {
  font-size: 14px;
  color: #555;
  margin: 0 0 16px;
}
.tap-pad {
  width: min(100%, 220px);
  height: 220px;
  border-radius: 50%;
  border: 0;
  background: #ff6b1a;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 0 #1b5e20;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
}
.tap-pad:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #1b5e20;
}
.tap-reads {
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
}
.tap-bpm-big {
  font-size: 42px;
  font-weight: 800;
  color: #1b5e20;
  line-height: 1.1;
  margin: 0 0 4px;
}
.tap-meta {
  font-size: 13px;
  color: #666;
  margin-bottom: 14px;
}

/* Weather / snow theme */
.wx-theme,
body.wx-snow .rt-page {
  --wx-ice: #e8f4fc;
  --wx-sky: #d6ebf7;
  --wx-deep: #1a4a6b;
}
body.wx-snow {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 12%, rgba(255,255,255,0.75) 0 1.5px, transparent 3px),
    radial-gradient(circle at 40% 8%, rgba(255,255,255,0.85) 0 2px, transparent 3px),
    linear-gradient(180deg, #eef6fb 0%, #f7f8f0 42%, #f8f8e0 100%);
  background-attachment: fixed;
}
body.wx-snow .tool-box {
  background: linear-gradient(180deg, #f4faff 0%, #eef6fb 100%);
  border-color: #b7d3e8;
  box-shadow: inset 0 1px 0 #fff;
}
body.wx-snow .tool-box::before {
  content: "❄ Winter desk";
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1a4a6b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
body.wx-snow .btn-primary {
  background: #ff6b1a !important;
}
body.wx-snow .btn-primary:hover {
  background: #155a84 !important;
}
body.wx-snow .result-box .value {
  color: #0d47a1;
}
body.wx-snow h1 {
  color: #123a56;
}
.wx-meter {
  height: 10px;
  background: #dce9f2;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 4px;
}
.wx-meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #64b5f6, #ff6b1a);
  transition: width 0.25s ease;
}

/* Live weather report + snowfall overlay */
.wx-snow-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
}
.wx-flake {
  position: absolute;
  top: -12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255,255,255,0.8);
  animation-name: wx-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes wx-fall {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(110vh) translateX(40px); }
}

.wx-live-desk {
  margin: 0 0 16px;
  padding: 14px 14px 12px;
  background: linear-gradient(165deg, #1a2b4b 0%, #243b5c 55%, #1e3554 100%);
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(20, 40, 70, 0.25);
}
.wx-live-title {
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 14px;
  margin: 4px 0 12px;
}
.wx-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}
.wx-search-row #wx-q {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 320px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.25);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
}
.wx-search-row #wx-q::placeholder { color: rgba(255,255,255,0.55); }
.wx-search-row .btn-primary {
  background: #ff6b1a !important;
  border: 0 !important;
}
.wx-search-row .btn-secondary {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
}
.wx-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  text-align: center;
  margin: 0 0 10px;
}
.wx-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wx-cell {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: rgba(0,0,0,0.28);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.wx-cell span { opacity: 0.85; }
.wx-cell strong { font-weight: 700; text-align: right; }
.wx-cell strong em { font-style: normal; opacity: 0.75; font-weight: 600; font-size: 12px; }
.wx-cell-wide { grid-column: 1 / -1; }
.wx-forecast-wrap {
  margin-top: 12px;
  background: rgba(255,255,255,0.96);
  color: #222;
  border-radius: 8px;
  padding: 10px 12px;
}
.wx-forecast-wrap h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #123a56;
}
.wx-forecast-wrap .viz-table th { background: #e3f2fd; }
.wx-source {
  margin: 10px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  line-height: 1.45;
}
.wx-manual-note {
  font-size: 12px;
  color: #1a4a6b;
  margin: 0 0 10px;
  font-weight: 600;
}
body.wx-snow .tool-box::before {
  content: "❄ Snow desk — live weather";
}
.wx-ico {
  text-align: center;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}
.wx-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wx-step {
  background: #f0f7fc;
  border: 1px solid #c5dde8;
  border-radius: 8px;
  padding: 12px;
}
.wx-step strong { display: block; color: #123a56; margin-bottom: 6px; }
.wx-step p { margin: 0; font-size: 13px; color: #444; }
.wx-trend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wx-trend button {
  border: 1px solid #90caf9;
  background: #e3f2fd;
  color: #0d47a1;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.wx-trend button:hover { background: #bbdefb; }
.wx-forecast-section {
  margin-top: 12px;
}
@media (max-width: 560px) {
  .wx-report-grid { grid-template-columns: 1fr; }
  .wx-cell-wide { grid-column: auto; }
  .wx-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .wx-steps { grid-template-columns: 1fr; }
}

/* Search suggest dropdown */
.header-search {
  position: relative;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1200;
  max-height: 320px;
  overflow: auto;
  display: none;
}
.search-suggest.open { display: block; }
.search-suggest a {
  display: block;
  padding: 8px 12px;
  color: #ff6b1a !important;
  text-decoration: none !important;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}
.search-suggest a:hover,
.search-suggest a.active {
  background: #eef6ff;
}
.search-suggest .sg-type {
  float: right;
  color: #888;
  font-size: 11px;
  font-weight: 600;
}
