/* styles.css
   Self-contained styling for the sample-size calculator. Deliberately
   scoped under .page so it can be dropped into a larger site without
   colliding with global site CSS. */

.page {
  --ink: #1c2530;
  --muted: #5b6675;
  --accent: #2f6f4f;
  --accent-dark: #234f38;
  --border: #d7dce2;
  --bg-panel: #ffffff;
  --bg-page: #f4f6f8;
  --error: #b3261e;

  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-page);
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.version-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-button {
  flex: 1 1 auto;
  min-width: 8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  background: #eef1f4;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  font-size: 0.85rem;
  cursor: pointer;
}

.tab-button.is-active {
  background: var(--bg-panel);
  color: var(--ink);
  border-bottom-color: var(--bg-panel);
  font-weight: 600;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 0 8px 8px 8px;
  padding: 1.5rem;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.tab-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.panel-help {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.calc-button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
}

.calc-button:hover {
  background: var(--accent-dark);
}

.result {
  margin-top: 1.25rem;
}

.result:empty {
  margin-top: 0;
}

.result-label {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.result-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 0.4rem;
}

/* The integer result must read as visually dominant over the raw
   fractional value — see result-subvalue below. */
.result-value--dominant {
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

.result-subvalue {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.2rem;
}

.result-rationale {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0.75rem 0 0;
}

.result-error {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
}

.sensitivity {
  margin-top: 1.25rem;
}

.sensitivity:empty {
  margin-top: 0;
}

.sensitivity-heading {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.sensitivity-help {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 0.6rem;
}

.sensitivity-table {
  border-collapse: collapse;
  font-size: 0.85rem;
  width: 100%;
}

.sensitivity-table th,
.sensitivity-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.55rem;
  text-align: center;
}

.sensitivity-table thead th {
  background: #eef1f4;
}

.sensitivity-table th[scope="row"] {
  background: #eef1f4;
  text-align: left;
}

.sensitivity-current {
  background: #e4f0e9;
  font-weight: 700;
  color: var(--accent-dark);
}

.info-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.info-panel h2 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.info-panel p {
  margin: 0 0 0.5rem;
}

.info-panel p:last-child {
  margin-bottom: 0;
}

.info-panel--warning {
  border-left: 4px solid #a15c00;
  background: #fdf6ea;
}

.info-panel--disclaimer {
  border-left: 4px solid var(--muted);
  background: #f2f3f5;
}

.page-footer {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.page-footer a {
  color: var(--accent-dark);
}
