/* Page-specific styles for the risk reward calculator.
   Base layout, colours and the tool grid come from styles.css. */

/* Restore the standard meaning of the HTML hidden attribute.
   The shared .field rule (display: flex) would otherwise out-specify it. */
[hidden] { display: none !important; }

.span2 { grid-column: 1 / -1; }

/* ---------- long / short toggle ---------- */

.seg {
  display: flex;
  gap: 6px;
}

.seg button {
  flex: 1;
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.seg button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.seg button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #cfe1f7;
}

/* ---------- results ---------- */

.error {
  margin: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #8a2b0b;
  background: #fdf0e9;
  border: 1px solid #f2cbb6;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.rvalue {
  overflow-wrap: anywhere;
}

/* ---------- comparison table ---------- */

.rr-table {
  margin-top: 40px;
}

.rr-table h2 {
  font-size: 20px;
  margin: 0 0 12px;
}

.table-note {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 720px;
  overflow-wrap: anywhere;
  margin: 0 0 12px;
}

.rr-table .table-note:last-child {
  margin: 12px 0 0;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

#rrTable {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 14px;
}

#rrTable th,
#rrTable td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

#rrTable th:first-child,
#rrTable td:first-child,
#rrTable th:last-child,
#rrTable td:last-child {
  text-align: left;
}

#rrTable thead th {
  background: var(--panel);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#rrTable tbody tr:last-child td {
  border-bottom: 0;
}

#rrTable tbody tr:hover {
  background: var(--accent-soft);
}

#rrTable tbody tr.is-current {
  background: var(--accent-soft);
}

#rrTable tbody tr.is-current td {
  font-weight: 600;
}

#rrTable td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#rrTable td.ratio {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- responsive ---------- */

@media (max-width: 520px) {
  .rr-table h2 { font-size: 18px; }
  #rrTable { font-size: 13px; }
  #rrTable th,
  #rrTable td { padding: 7px 9px; }
  .table-note { font-size: 13px; }
}
