/* The Rules page (rules.html), on top of styles.css and the dashboard's panels. */
.rules .panel h3 { font-size: 15px; margin: 26px 0 6px; }
.rules .panel h3:first-of-type { margin-top: 4px; }
.rules .panel .muted.small { font-size: 13px; margin: 0 0 12px; }
.rules .panel > header code { font-size: 15px; }
.rules .form-error:empty { display: none; }
.rules select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: 14px var(--sans); }
.rules select:focus, .rl-form input:focus, .rl-learn input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,107,58,.15); outline: none; }
.rules .btn:disabled { cursor: not-allowed; opacity: .5; }
.btn-xs { padding: 4px 9px; font-size: 12.5px; line-height: 1.4; border-radius: 7px; box-shadow: none; white-space: nowrap; }
.btn-xs.btn-primary:hover { transform: none; box-shadow: none; }

.rl-table { font-size: 14px; margin: 0 0 12px; }
.rl-table th { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rl-table td { vertical-align: middle; }
.rl-table tr:last-child td { border-bottom: 0; }
.rl-table tr.rl-open td { background: #fff7f3; }
.rl-table td.act { text-align: right; white-space: nowrap; }
.rl-table td.act > * + * { margin-left: 6px; }
.rl-pick { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.rl-pick code { color: var(--accent-ink); font-weight: 600; }
.rl-pick:hover code { border-color: var(--accent); }
.rl-pill { display: inline-block; font: 600 11px var(--mono); padding: 2px 7px; border-radius: 99px; background: #fff1eb; color: var(--accent-ink); margin-left: 6px; white-space: nowrap; }
td > .rl-pill:first-child { margin-left: 0; }
.rl-atom { white-space: nowrap; }
.rl-atom code { font-size: 13px; }
.rl-bad { background: transparent; border-color: color-mix(in srgb, var(--unsat) 55%, transparent); color: var(--unsat); }
.rl-bad:hover { background: #fdecea; }

.rl-form { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 9px; padding: 16px 18px; margin: 14px 0 4px; background: var(--wash); }
.rl-form h4 { margin: 0 0 4px; font-size: 15px; }
.rl-form label, .rl-label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 6px; }
.rl-form input, .rl-learn input { font: 14px var(--sans); padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); min-width: 0; }
.rl-form #rule-name { width: 100%; max-width: 320px; }
.rl-cond { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.rl-cond .rl-var { flex: 1 1 170px; width: auto; max-width: 240px; font-family: var(--mono); font-size: 13px; }
.rl-cond .rl-val, .rl-cond #rule-then { flex: 1 1 170px; width: auto; max-width: 320px; }
.rl-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 19px; line-height: 1; padding: 2px 6px; }
.rl-x:hover { color: var(--unsat); }
.rl-form .btn, .rl-learn .btn { width: auto; margin: 0; }
.rl-actions { display: flex; gap: 8px; margin-top: 14px; }
.rl-form .muted.small { margin: 4px 0 0; }

.rl-learn { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.rl-learn label { margin: 0; font-weight: 600; font-size: 13.5px; }
.rl-learn #learn-support { width: 84px; }
.rl-learn select { max-width: 100%; }
.rules details pre { background: var(--navy-900); color: #e8ecf7; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; margin: 10px 0; }

/* phone: tables become one card per row */
@media (max-width: 640px) {
  .rl-table thead { display: none; }
  .rl-table, .rl-table tbody, .rl-table tr, .rl-table td { display: block; width: 100%; }
  .rl-table tr { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; margin-bottom: 10px; }
  .rl-table td, .rl-table tr:last-child td { border: 0; padding: 3px 0; }
  .rl-table td[data-l] { display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rl-table td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex: none; }
  .rl-table td.lead { font-size: 15px; padding-bottom: 6px; }
  .rl-table td.act { text-align: left; padding-top: 8px; white-space: normal; }
  .rl-atom { white-space: normal; }
  .rl-cond .rl-var, .rl-cond .rl-val, .rl-cond #rule-then { flex-basis: 100%; max-width: none; }
  .rl-learn select { width: 100%; }
}
