/* Shared styling for the tools pages — same visual language as the lessons
   (system font, #f8f8f8 canvas / white panel), adapted for a utility layout. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f8f8f8;
  color: #1a1a1a;
  height: 100vh;
  overflow: hidden;
}

#app { display: flex; height: 100vh; }

#main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.tool-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tool-head h1 { font-size: 20px; font-weight: 600; color: #111; }
#back { color: #999; text-decoration: none; font-size: 13px; }
#back:hover { color: #555; }

.tool-tabs { margin-left: auto; display: flex; gap: 8px; }
.tool-tabs a {
  font-size: 12px; color: #aaa; text-decoration: none;
  border: 1px solid #e0e0e0; border-radius: 6px; padding: 3px 10px;
  transition: border-color 0.15s, color 0.15s;
}
.tool-tabs a:hover { border-color: #bbb; color: #555; }
.tool-tabs a.active { color: #111; border-color: #bbb; background: #fff; }

.plot-wrap { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 10px 8px 4px; }
.plot-wrap h3 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: #bbb; padding: 4px 0 2px 10px;
}
canvas.plot { width: 100%; height: 220px; display: block; }

#panel {
  width: 360px;
  min-width: 300px;
  background: #fff;
  border-left: 1px solid #e0e0e0;
  padding: 28px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: #aaa;
}

label.field { display: block; font-size: 12px; color: #666; margin-bottom: 6px; }
label.field span.val { float: right; color: #111; font-variant-numeric: tabular-nums; }

select, input[type="text"], input[type="number"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: #111;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 10px;
}
textarea { resize: vertical; min-height: 64px; font-variant-numeric: tabular-nums; }
select:focus, input:focus, textarea:focus { outline: none; border-color: #888; }

input[type="range"] { width: 100%; accent-color: #2563eb; cursor: pointer; }

.param + .param { margin-top: 12px; }

.formula {
  background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 14px; overflow-x: auto;
}
.formula .katex { font-size: 1em; }

.readout { display: flex; flex-direction: column; gap: 2px; }
.readout .row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 5px 0; border-bottom: 1px solid #f1f1f1;
}
.readout .row:last-child { border-bottom: none; }
.readout .row .k { color: #888; }
.readout .row .v { color: #111; font-variant-numeric: tabular-nums; font-weight: 500; }
.readout .row.hi .v { color: #2563eb; }

.btn {
  font-family: inherit; font-size: 13px; color: #fff; background: #2563eb;
  border: none; border-radius: 6px; padding: 9px 14px; cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #1d4ed8; }

.hint { font-size: 12px; color: #999; line-height: 1.6; }
.error { font-size: 13px; color: #dc2626; }

.result-card {
  background: #f5f8ff; border: 1px solid #d4e0fb; border-radius: 8px; padding: 14px 16px;
}
.result-card .verdict { font-size: 14px; font-weight: 600; margin-top: 8px; }
.result-card .verdict.sig { color: #15803d; }
.result-card .verdict.ns { color: #b45309; }

.group { display: flex; flex-direction: column; gap: 8px; }
.group h4 { font-size: 12px; color: #444; font-weight: 600; }
