/* ============================================================
   MechaPaint - Free Up RAM page (free-up-ram/)
   Page-only styles. Tip cards, step lists, command blocks with
   copy buttons (ramtips.js), and the savings table. Uses the
   shared tokens from styles2.css.
   ============================================================ */

/* ---------- centered section heads ----------
   .section-alt centers its .section-head (styles2.css, children get
   margin auto), a plain .section does not. Everything on this page is
   a centered column, so the plain sections center their heads too and
   every heading lines up over its content. */

#overview .section-head,
#tips .section-head,
#measure .section-head,
#mechapaint .section-head {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- savings table ---------- */

.rt-table-wrap {
  max-width: 960px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.rt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.rt-table th,
.rt-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.rt-table tbody tr:last-child td { border-bottom: 0; }

.rt-table th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  background: var(--panel-2);
}

.rt-table td:nth-child(2) { color: var(--accent-2); font-weight: 600; white-space: nowrap; }
.rt-table td:nth-child(3) { color: var(--text-mid); }
.rt-table a { color: var(--text); text-decoration: none; }
.rt-table a:hover { color: var(--accent); }

/* ---------- card grid ---------- */

.rt-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.rt-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  min-width: 0;
}

.rt-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.rt-card p { color: var(--text-mid); margin-bottom: 10px; }
.rt-card p:last-child { margin-bottom: 0; }

/* ---------- the big five ---------- */

.rt-tip {
  max-width: 860px;
  margin: 0 auto 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px clamp(18px, 4vw, 34px);
  scroll-margin-top: 90px;
  min-width: 0;
}

.rt-tip:last-child { margin-bottom: 0; }

.rt-tip-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.rt-tip h3 { font-size: 22px; line-height: 1.3; margin-bottom: 8px; }

.rt-tip h4 {
  font-size: 15px;
  margin: 22px 0 10px;
  color: var(--text);
}

.rt-tip p { color: var(--text-mid); margin-bottom: 12px; }
.rt-tip p strong { color: var(--text); }

.rt-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1;
  flex-shrink: 0;
}

.rt-num-small {
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
  margin-bottom: 12px;
}

.rt-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: 999px;
  padding: 3px 12px;
}

/* ---------- steps, notes, keys ---------- */

.rt-steps {
  margin: 0 0 12px 22px;
  color: var(--text-mid);
}

.rt-steps li { margin-bottom: 8px; padding-left: 4px; }
.rt-steps li strong { color: var(--text); }

.rt-note {
  border-left: 3px solid var(--warn);
  padding: 4px 0 4px 12px;
  font-size: 14.5px;
}

.rt-label {
  font-size: 13.5px;
  margin: 14px 0 6px !important;
  color: var(--text-dim) !important;
}

.section kbd {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

.section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent-2);
}

/* ---------- command blocks ---------- */

.rt-code {
  position: relative;
  margin: 8px 0 14px;
  background: #0a0d13;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 84px 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}

.rt-code code { color: var(--text); white-space: pre; }

.rt-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.rt-copy:hover { border-color: var(--accent); }
.rt-copy.is-done { color: var(--accent-2); border-color: var(--accent-2); }

.rt-undo {
  max-width: 860px;
  margin: 0 auto;
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .rt-grid { grid-template-columns: 1fr; }
  .rt-tip-head { flex-direction: column; gap: 10px; }
  .rt-tip h3 { font-size: 19px; }
  .rt-table td:nth-child(2) { white-space: normal; }
}
