/* Host Reference: desktop-first operational desk view inside the Rules experience. */
.rules-host-mode-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.host-ref-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
  padding: 30px 0 64px;
}

.host-ref-console {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--color-border, rgba(25,24,29,.14));
  border-radius: 16px;
  background: rgba(251,247,239,.9);
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(35,27,19,.08));
}
.host-ref-console-head { display: grid; gap: 5px; }
.host-ref-console-head h2 { margin: 0; font-size: 1.35rem; }
.host-ref-console-head p { margin: 0; font-size: .84rem; }

.host-ref-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.host-ref-selectors label {
  display: grid;
  gap: 6px;
  color: var(--color-muted, #66636b);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.host-ref-selectors label:first-child,
.host-ref-selectors label:last-child { grid-column: 1 / -1; }
.host-ref-selectors select { min-height: 44px; text-transform: none; letter-spacing: normal; font-weight: 700; }

.host-ref-current {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--color-border, rgba(25,24,29,.12));
  border-left: 1px solid var(--color-border, rgba(25,24,29,.12));
}
.host-ref-current > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 12px;
  border-right: 1px solid var(--color-border, rgba(25,24,29,.12));
  border-bottom: 1px solid var(--color-border, rgba(25,24,29,.12));
}
.host-ref-current span { color: var(--color-muted, #66636b); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.host-ref-current strong { font-size: 1.08rem; line-height: 1.2; overflow-wrap: anywhere; }

.host-ref-console-links,
.host-ref-rule-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.host-ref-console-links a,
.host-ref-rule-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid rgba(23,106,107,.16);
  border-radius: 999px;
  background: rgba(23,106,107,.055);
  color: var(--color-progress, #176a6b);
  font-size: .74rem;
  font-weight: 800;
  text-decoration: none;
}
.host-ref-console-links a:hover,
.host-ref-rule-links a:hover { background: rgba(23,106,107,.1); }

.host-ref-main { min-width: 0; display: grid; gap: 26px; }
.host-ref-main-head { max-width: 780px; }
.host-ref-main-head h2 { margin: 5px 0 9px; font-size: clamp(2rem, 3.6vw, 3.2rem); }
.host-ref-main-head p { max-width: 72ch; }

.host-ref-flow {
  padding: 22px 0;
  border-top: 1px solid var(--color-border, rgba(25,24,29,.14));
  border-bottom: 1px solid var(--color-border, rgba(25,24,29,.14));
}
.host-ref-flow h3 { margin: 0 0 14px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.host-ref-flow ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: host-flow;
}
.host-ref-flow li {
  counter-increment: host-flow;
  min-width: 0;
  padding: 0 15px;
  border-left: 1px solid var(--color-border, rgba(25,24,29,.12));
}
.host-ref-flow li:first-child { padding-left: 0; border-left: 0; }
.host-ref-flow li::before {
  content: "0" counter(host-flow);
  display: block;
  margin-bottom: 8px;
  color: var(--color-action-text, #a83b1d);
  font-size: .7rem;
  font-weight: 900;
}
.host-ref-flow strong,
.host-ref-flow span { display: block; }
.host-ref-flow strong { margin-bottom: 4px; }
.host-ref-flow span { color: var(--color-muted, #66636b); font-size: .78rem; line-height: 1.45; }

.host-ref-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.host-ref-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--color-border, rgba(25,24,29,.14));
  border-radius: 14px;
  background: rgba(251,247,239,.72);
}
.host-ref-panel-wide { grid-column: 1 / -1; }
.host-ref-panel-head { display: flex; gap: 12px; align-items: baseline; }
.host-ref-panel-head > span { color: var(--color-action-text, #a83b1d); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.host-ref-panel-head h3 { margin: 0; font-size: 1.18rem; }

.host-checklist { display: grid; gap: 4px; }
.host-checklist label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(25,24,29,.07);
  cursor: pointer;
}
.host-checklist label:last-child { border-bottom: 0; }
.host-checklist input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--color-progress, #176a6b); }
.host-checklist span { color: var(--color-ink-soft, #39373f); font-size: .88rem; line-height: 1.45; }
.host-checklist input:checked + span { color: var(--color-muted, #66636b); text-decoration: line-through; }

.host-outcomes,
.host-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.host-outcome,
.host-paths a,
.host-quick-links a {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--color-border, rgba(25,24,29,.14));
  border-radius: 12px;
  background: rgba(255,250,242,.62);
  color: inherit;
  text-decoration: none;
}
.host-outcome:hover,
.host-paths a:hover,
.host-quick-links a:hover { border-color: rgba(23,106,107,.3); background: rgba(255,250,242,.96); }
.host-outcome > span { color: var(--color-muted, #66636b); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.host-outcome strong { color: var(--color-action-text, #a83b1d); }
.host-outcome small,
.host-paths span,
.host-quick-links span { color: var(--color-muted, #66636b); line-height: 1.4; }
.host-outcome-win { border-color: rgba(23,106,107,.22); background: rgba(23,106,107,.055); }
.host-paths strong,
.host-quick-links strong { color: var(--color-ink, #19181d); }

.host-quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.host-ref-reset-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 0;
  border-top: 1px solid var(--color-border, rgba(25,24,29,.14));
}
.host-ref-reset-row > div { display: grid; gap: 3px; }
.host-ref-reset-row span { color: var(--color-muted, #66636b); font-size: .78rem; }

@media (max-width: 1050px) {
  .host-ref-layout { grid-template-columns: 1fr; }
  .host-ref-console { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .host-ref-console-head,
  .host-ref-current,
  .host-ref-console-links { grid-column: 1 / -1; }
  .host-ref-flow ol { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 0; }
  .host-ref-flow li:nth-child(4) { padding-left: 0; border-left: 0; }
}

@media (max-width: 760px) {
  .rules-modebar { overflow-x: auto; }
  .rules-mode { flex: 0 0 auto; }
  .host-ref-console { grid-template-columns: 1fr; }
  .host-ref-selectors { grid-template-columns: 1fr; }
  .host-ref-selectors label:first-child,
  .host-ref-selectors label:last-child { grid-column: auto; }
  .host-ref-current { grid-template-columns: 1fr 1fr; }
  .host-ref-flow ol,
  .host-ref-grid,
  .host-outcomes,
  .host-paths,
  .host-quick-links { grid-template-columns: 1fr; }
  .host-ref-flow li,
  .host-ref-flow li:nth-child(4) { padding: 13px 0; border-left: 0; border-top: 1px solid var(--color-border, rgba(25,24,29,.12)); }
  .host-ref-flow li:first-child { border-top: 0; }
  .host-ref-panel-wide { grid-column: auto; }
  .host-ref-reset-row { align-items: stretch; flex-direction: column; }
}
