/* Shared styles for tool pages */
.tool-hero { text-align: center; padding: 18px 16px 4px; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.tool-hero h1 { margin: 0; font-size: 34px; font-weight: normal; }
.tool-hero p { margin: 8px auto 0; max-width: 720px; font-size: 17px; color: #eef3f6; }

.tool-wrap { max-width: 1100px; margin: 16px auto 0; padding: 0 16px; }
.tool {
  background: linear-gradient(160deg, #1d2934 0%, #22303d 45%, #1a242e 100%);
  border-radius: 10px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.tool + .page, .tool-wrap + .page { margin-top: 24px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 14px 10px; text-align: center; }
.stat .v { display: block; font-size: 34px; color: var(--teal); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat.warn .v { color: #ff7a6b; }

.zone {
  margin-top: 16px; min-height: 260px; border: 2px dashed #3a4956; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 20px; cursor: pointer; user-select: none; -webkit-user-select: none;
  color: var(--muted); font-size: 18px; transition: border-color .15s, background .15s; touch-action: manipulation;
}
.zone:hover { border-color: #56697a; }
.zone.active { border-color: var(--teal); background: rgba(31, 199, 160, .06); color: var(--text); }
.zone.done { border-style: solid; border-color: var(--teal); }
.zone .big { font-size: 56px; color: var(--teal); line-height: 1; font-variant-numeric: tabular-nums; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.controls .label { color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid #3a4956; border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 8px 13px; font: inherit; font-size: 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid #3a4956; }
.seg button.on { background: var(--teal); color: #08241d; }
.btn.ghost { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
.btn.ghost:hover { background: rgba(31,199,160,.1); }
.btn.sm { padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tool select { font: inherit; font-size: 14px; color: var(--text); background: #0f171e; border: 1px solid #3a4956; border-radius: 6px; padding: 8px 10px; max-width: 100%; }
.tool input[type=range] { accent-color: var(--teal); }
.note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.warnbox { background: rgba(255, 170, 60, .1); border: 1px solid rgba(255, 170, 60, .45); color: #ffd9a8; border-radius: 8px; padding: 12px 14px; font-size: 14px; margin: 14px 0; }

.meter { height: 18px; background: #0f171e; border-radius: 9px; overflow: hidden; border: 1px solid #2c3a46; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal) 0%, #9be15d 60%, #f5c542 80%, #e5534b 100%); background-size: 600px 100%; transition: width .05s; }

.log { font-family: Consolas, Menlo, monospace; max-height: 240px; overflow: auto; background: #0f171e; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; margin-top: 14px; color: #c8d3db; }
.log .bad { color: #ff7a6b; }
.log .good { color: var(--teal); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 14px; }
table.data th, table.data td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: normal; }
table.data td.bad { color: #ff7a6b; }

/* mini keyboard */
.kb { --u: min(50px, calc((min(100vw, 1100px) - 110px) / 17.2)); display: grid; gap: calc(var(--u) * .12); justify-content: center; margin-top: 16px; overflow-x: auto; padding-bottom: 4px; }
.kb-row { display: flex; gap: calc(var(--u) * .12); }
.kk {
  height: var(--u); border: 1.5px solid #c9d3da; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--u) * .3); color: var(--text);
  transition: background .06s, color .06s; white-space: nowrap; overflow: hidden;
}
.kk.tested { background: #e3e5e6; color: #2b3640; border-color: #e3e5e6; }
.kk.down { background: var(--teal); color: #10352c; border-color: var(--teal); }
.kk.bad { background: #e5534b; color: #fff; border-color: #e5534b; }
.kk.gap { border-color: transparent; }

/* related tools + hub */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.card {
  display: block; text-decoration: none; color: var(--text); background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 16px; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--teal); transform: translateY(-2px); }
.card .ic { width: 40px; height: 40px; border-radius: 9px; border: 1.5px solid var(--teal); color: var(--teal); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.card .ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card b { display: block; font-weight: normal; font-size: 17px; }
.card span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; line-height: 1.5; }

.faq details { border-bottom: 1px solid rgba(255,255,255,.1); padding: 12px 0; }
.faq summary { cursor: pointer; font-size: 17px; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--teal); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 8px 0 0; }

@media (max-width: 600px) {
  .tool-hero h1 { font-size: 26px; }
  .tool-hero p { font-size: 15px; }
  .tool { padding: 16px; }
  .stat .v { font-size: 28px; }
  .zone .big { font-size: 44px; }
}
