/**
 * LIO Retirement Matchmaker — Frontend Stylesheet
 * Aligned with Live and Invest Overseas 2026 Design System (lios-core.css)
 * Scope: [retirement_matchmaker], [lio_country_table], [lio_product_catalog]
 */

/* ==============================================================
   1. SCOPED DESIGN TOKENS (Inherits lios-core.css with safe fallbacks)
   ============================================================== */
.lio-rm-app,
.lio-rm-ct,
.lio-rm-cat,
.lio-rm-source {
  --rm-navy: var(--lios-navy, #102f46);
  --rm-navy-deep: var(--lios-navy-deep, #061d2d);
  --rm-blue: var(--lios-blue, #0069a9);
  --rm-blue-dark: var(--lios-blue-dark, #07558b);
  --rm-blue-light: var(--lios-blue-light, #eef6fb);
  --rm-gold: var(--lios-gold, #f2bd3d);
  --rm-gold-hover: var(--lios-gold-hover, #f6c738);
  --rm-gold-dark: var(--lios-gold-dark, #d8a300);
  --rm-red: var(--lios-red, #bd2c33);
  --rm-ink: var(--lios-ink, #18242d);
  --rm-muted: var(--lios-muted, #5e6b78);
  --rm-line: var(--lios-line, #dce4e8);
  --rm-line-light: var(--lios-line-light, #edf2f5);
  --rm-soft: var(--lios-soft, #f7f9fb);
  --rm-white: var(--lios-white, #ffffff);

  --rm-font-serif: var(--lios-font-serif, Georgia, "Times New Roman", serif);
  --rm-font-sans: var(--lios-font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);

  --rm-radius-sm: var(--lios-radius-sm, 6px);
  --rm-radius: var(--lios-radius, 8px);
  --rm-radius-md: var(--lios-radius-md, 12px);
  --rm-radius-lg: var(--lios-radius-lg, 16px);
  --rm-radius-pill: var(--lios-radius-pill, 9999px);

  --rm-shadow-sm: var(--lios-shadow-sm, 0 1px 3px rgba(15, 47, 70, 0.04), 0 4px 12px rgba(15, 47, 70, 0.05));
  --rm-shadow-card: var(--lios-shadow-card, 0 1px 3px rgba(15, 47, 70, 0.04), 0 6px 18px -2px rgba(15, 47, 70, 0.06));
  --rm-shadow-hover: var(--lios-shadow-hover, 0 4px 12px -1px rgba(15, 47, 70, 0.06), 0 16px 32px -4px rgba(15, 47, 70, 0.12));
  --rm-ease: var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));

  box-sizing: border-box;
  font-family: var(--rm-font-sans);
  color: var(--rm-ink);
  -webkit-font-smoothing: antialiased;
}

.lio-rm-app *,
.lio-rm-app *::before,
.lio-rm-app *::after,
.lio-rm-ct *,
.lio-rm-ct *::before,
.lio-rm-ct *::after,
.lio-rm-cat *,
.lio-rm-cat *::before,
.lio-rm-cat *::after {
  box-sizing: border-box;
}

.lio-rm-app [hidden],
.lio-rm-ct [hidden],
.lio-rm-cat [hidden] {
  display: none !important;
}

.lio-rm-app a,
.lio-rm-app button,
.lio-rm-ct a,
.lio-rm-ct button,
.lio-rm-cat a,
.lio-rm-cat button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Shared Source & Attribution Footnote */
.lio-rm-source {
  margin: 16px 0 0;
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: var(--rm-muted);
}

.lio-rm-source a {
  color: var(--rm-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.lio-rm-source a:hover {
  color: var(--rm-blue-dark);
}

/* Screen-reader utility */
.lio-rm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==============================================================
   2. [retirement_matchmaker] — SHELL & HEADER
   ============================================================== */
.lio-rm-app {
  width: 100%;
}

.lio-rm-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-lg);
  background: var(--rm-white);
  color: var(--rm-ink);
  box-shadow: var(--rm-shadow-card);
}

.lio-rm-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--rm-navy) 0%, var(--rm-blue) 68%, var(--rm-gold) 100%);
}

.lio-rm-eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 5px 12px;
  border: 1px solid #d2e4f0;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-blue-light);
  color: var(--rm-blue-dark);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
}

.lio-rm-shell > h2 {
  margin: 0 0 12px !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.lio-rm-intro {
  max-width: 72ch;
  margin: 0 0 16px !important;
  color: var(--rm-muted);
  font-size: 15.5px !important;
  line-height: 1.65 !important;
}

/* Score batch metadata pill (rendered as bare <p> after .lio-rm-intro) */
.lio-rm-shell > p:not(.lio-rm-intro):not(.lio-rm-source) {
  display: inline-flex;
  align-items: center;
  margin: 0 0 28px !important;
  padding: 5px 12px;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-pill);
  background: var(--rm-soft);
  color: var(--rm-muted);
  font-size: 12.5px !important;
  font-weight: 600;
  line-height: 1.4 !important;
}

.lio-rm-status {
  margin: 18px 0;
  padding: 13px 16px;
  border: 1px solid #d5e8f4;
  border-radius: var(--rm-radius);
  background: var(--rm-blue-light);
  color: var(--rm-navy);
  font-size: 14px;
  line-height: 1.55;
}

.lio-rm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 28px;
  border: 1px dashed var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-soft);
  color: var(--rm-muted);
  font-size: 15px;
  font-weight: 600;
}

.lio-rm-error {
  border-color: #e8b8ba;
  background: #fdf6f6;
}

.lio-rm-error::before {
  background: var(--rm-red);
}

.lio-rm-error > h2 {
  color: var(--rm-red);
}

.lio-rm-questions {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding-left: 20px;
}

.lio-rm-questions li span {
  display: inline-block;
  margin-left: 8px;
  color: var(--rm-muted);
  font-size: 12px;
}

/* ==============================================================
   3. [retirement_matchmaker] — QUESTIONNAIRE FORM
   ============================================================== */
.lio-rm-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  max-width: 100%;
  margin: 0;
}

.lio-rm-form > label {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-soft);
  transition: border-color 0.18s var(--rm-ease), background-color 0.18s var(--rm-ease), box-shadow 0.18s var(--rm-ease);
}

.lio-rm-form > label:hover {
  border-color: #bfd3e2;
  background: var(--rm-white);
}

.lio-rm-form > label:focus-within {
  border-color: var(--rm-blue);
  background: var(--rm-white);
  box-shadow: 0 0 0 3px rgba(0, 105, 169, 0.12);
}

/* Feature the first question (Monthly Budget) full-width as the anchor input */
.lio-rm-form > label:first-of-type {
  grid-column: 1 / -1;
  background: var(--rm-blue-light);
  border-color: #cde1ef;
  padding: 20px 22px;
}

.lio-rm-form > label:first-of-type:hover,
.lio-rm-form > label:first-of-type:focus-within {
  background: var(--rm-white);
  border-color: var(--rm-blue);
}

.lio-rm-form > label > strong {
  display: block;
  color: var(--rm-navy);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}

.lio-rm-form > label:first-of-type > strong {
  font-size: 15.5px;
}

.lio-rm-form > label > span {
  display: block;
  color: var(--rm-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  margin-top: -2px;
}

.lio-rm-form input[type="number"],
.lio-rm-form input[type="text"],
.lio-rm-form select {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  margin-top: auto;
  padding: 10px 14px;
  border: 1px solid #c5d3de;
  border-radius: var(--rm-radius);
  background-color: var(--rm-white);
  color: var(--rm-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lio-rm-form > label:first-of-type input[type="number"] {
  max-width: 320px;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lio-rm-form select,
.lio-rm-fg select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23102f46' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  cursor: pointer;
}

.lio-rm-form input:hover,
.lio-rm-form select:hover {
  border-color: #93b4cc;
}

.lio-rm-form input:focus,
.lio-rm-form select:focus {
  outline: none;
  border-color: var(--rm-blue);
  box-shadow: 0 0 0 3px rgba(0, 105, 169, 0.16);
}

.lio-rm-form :focus-visible {
  outline: 2px solid var(--rm-blue);
  outline-offset: 2px;
}

/* Primary LIOS Gold CTA Button */
.lio-rm-form > button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 30px;
  border: 1px solid var(--rm-gold);
  border-radius: var(--rm-radius);
  background: var(--rm-gold);
  color: var(--rm-navy-deep);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(242, 189, 61, 0.35);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.18s var(--rm-ease), box-shadow 0.2s ease;
}

.lio-rm-form > button[type="submit"]:hover:not(:disabled) {
  background: var(--rm-gold-hover);
  border-color: var(--rm-gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242, 189, 61, 0.48);
}

.lio-rm-form > button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

.lio-rm-form > button[type="submit"]:focus-visible {
  outline: 3px solid var(--rm-navy);
  outline-offset: 3px;
}

.lio-rm-form > button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ==============================================================
   4. [retirement_matchmaker] — RESULTS SHORTLIST
   ============================================================== */
.lio-rm-results:not(:empty) {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--rm-line);
}

.lio-rm-results > h3 {
  margin: 0 0 20px !important;
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lio-rm-results > ol {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  gap: 20px;
  counter-reset: lio-rm-rank;
}

.lio-rm-results > ol > li {
  position: relative;
  counter-increment: lio-rm-rank;
  margin: 0 !important;
  padding: 24px 26px !important;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-white);
  box-shadow: var(--rm-shadow-card);
  font-size: 15px !important;
  line-height: 1.6 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Top #1 Match Visual Emphasis */
.lio-rm-results > ol > li:first-child {
  border-color: var(--rm-blue);
  box-shadow: 0 6px 24px rgba(0, 105, 169, 0.1);
}

/* Result Header with Optional Featured Media */
.lio-rm-result-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 24px;
  align-items: start;
}

.lio-rm-results > ol > li.lio-rm-has-media .lio-rm-result-top {
  grid-template-columns: 270px minmax(0, 1fr);
}

.lio-rm-result-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--rm-radius);
  border: 1px solid var(--rm-line-light);
  background: var(--rm-soft);
  aspect-ratio: 16 / 11;
}

.lio-rm-result-media a {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.lio-rm-result-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--rm-ease);
}

.lio-rm-result-media a:hover img {
  transform: scale(1.04);
}

.lio-rm-result-summary {
  min-width: 0;
}

.lio-rm-results > ol > li h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 12px !important;
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: clamp(1.25rem, 2.1vw, 1.55rem);
  font-weight: 600;
  line-height: 1.22;
}

.lio-rm-results > ol > li h4 a {
  color: var(--rm-navy);
  text-decoration: none;
  transition: color 0.15s ease;
}

.lio-rm-results > ol > li h4 a:hover {
  color: var(--rm-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lio-rm-results > ol > li h4::before {
  content: "#" counter(lio-rm-rank);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-navy);
  color: var(--rm-white);
  font-family: var(--rm-font-sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.lio-rm-results > ol > li:first-child h4::before {
  content: "#1 Top Match";
  background: var(--rm-gold);
  color: var(--rm-navy-deep);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* "Who it suits (LIOS)" editorial callout */
.lio-rm-suits {
  margin: 0 0 14px !important;
  padding: 12px 16px;
  border-left: 3px solid var(--rm-blue);
  border-radius: 0 var(--rm-radius) var(--rm-radius) 0;
  background: var(--rm-blue-light);
  color: var(--rm-ink);
  font-size: 14.5px !important;
  line-height: 1.6 !important;
}

.lio-rm-suits strong {
  color: var(--rm-navy);
  font-weight: 700;
}

/* Score & budget summary pills */
.lio-rm-result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 10px;
}

.lio-rm-stat-score,
.lio-rm-stat-budget {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 !important;
  padding: 6px 12px;
  border-radius: var(--rm-radius-sm);
  color: var(--rm-navy);
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  font-variant-numeric: tabular-nums;
}

.lio-rm-stat-score {
  border: 1px solid #d2e4f0;
  background: var(--rm-soft);
}

.lio-rm-stat-budget {
  border: 1px solid #f0dfb0;
  background: #fffbf0;
}

.lio-rm-result-source,
.lio-rm-result-unavail {
  margin: 0 0 10px !important;
  color: var(--rm-muted);
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.lio-rm-result-unavail {
  margin: 10px 0 0 !important;
}

/* Country Hub CTA Button */
.lio-rm-result-cta {
  margin: 12px 0 0 !important;
}

.lio-rm-result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--rm-navy);
  border-radius: var(--rm-radius);
  background: var(--rm-navy);
  color: var(--rm-white) !important;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s var(--rm-ease), box-shadow 0.18s ease;
}

.lio-rm-result-link:hover {
  background: var(--rm-blue);
  border-color: var(--rm-blue);
  color: var(--rm-white) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 105, 169, 0.22);
}

.lio-rm-results > ol > li:first-child .lio-rm-result-link {
  background: var(--rm-gold);
  border-color: var(--rm-gold);
  color: var(--rm-navy-deep) !important;
  box-shadow: 0 3px 12px rgba(242, 189, 61, 0.32);
}

.lio-rm-results > ol > li:first-child .lio-rm-result-link:hover {
  background: var(--rm-gold-hover);
  border-color: var(--rm-gold-hover);
  color: var(--rm-navy-deep) !important;
  box-shadow: 0 5px 16px rgba(242, 189, 61, 0.45);
}

/* Reasons & cautions list */
.lio-rm-results > ol > li > ul {
  list-style: disc outside !important;
  margin: 14px 0 18px !important;
  padding-left: 20px !important;
}

.lio-rm-results > ol > li > ul > li {
  margin: 0 0 6px !important;
  padding-left: 2px;
  color: var(--rm-ink);
  font-size: 14.5px !important;
  line-height: 1.55 !important;
}

.lio-rm-results > ol > li > ul > li::marker {
  color: var(--rm-blue);
}

/* Score breakdown <dl>: clean 2-column scorecard grid */
.lio-rm-results > ol > li > dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 0 12px;
  margin: 16px 0 12px;
  padding: 12px 18px;
  border: 1px solid var(--rm-line-light);
  border-radius: var(--rm-radius);
  background: var(--rm-soft);
}

.lio-rm-results > ol > li > dl dt {
  padding: 8px 0;
  border-bottom: 1px solid var(--rm-line-light);
  color: var(--rm-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

.lio-rm-results > ol > li > dl dd {
  margin: 0;
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--rm-line-light);
  color: var(--rm-navy);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.lio-rm-results > ol > li > dl dd:nth-of-type(even) {
  padding-right: 0;
}

/* Placeholder badge */
em.lio-rm-est {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fef3d6;
  color: #875800;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ==============================================================
   5. [retirement_matchmaker] — NEXT STEPS & RECOMMENDED PRODUCTS
   ============================================================== */
.lio-rm-next {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--rm-line);
  color: var(--rm-ink);
}

.lio-rm-next > h3 {
  margin: 0 0 16px !important;
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 400;
  line-height: 1.25;
}

.lio-rm-next-guide,
.lio-rm-next-free {
  margin: 0 0 12px !important;
  padding: 14px 18px;
  border-radius: var(--rm-radius);
  font-size: 14.5px !important;
  line-height: 1.5 !important;
  font-weight: 500;
}

.lio-rm-next-guide {
  border: 1px solid #c6dfef;
  border-left: 4px solid var(--rm-blue);
  background: var(--rm-blue-light);
  color: var(--rm-navy);
}

.lio-rm-next-guide b {
  color: var(--rm-blue-dark);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  margin-right: 6px;
}

.lio-rm-next-free {
  border: 1px solid #f0dfb0;
  border-left: 4px solid var(--rm-gold);
  background: #fffbf0;
  color: var(--rm-ink);
}

.lio-rm-next-guide a,
.lio-rm-next-free a {
  color: var(--rm-blue-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lio-rm-next-guide a:hover,
.lio-rm-next-free a:hover {
  color: var(--rm-navy);
}

.lio-rm-next > ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 18px 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.lio-rm-next > ul > li {
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 20px !important;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-white);
  box-shadow: var(--rm-shadow-sm);
  font-size: 14px !important;
  line-height: 1.55 !important;
  transition: transform 0.2s var(--rm-ease), box-shadow 0.2s var(--rm-ease), border-color 0.2s ease;
}

.lio-rm-next > ul > li:hover {
  transform: translateY(-2px);
  border-color: #b7d2e5;
  box-shadow: var(--rm-shadow-hover);
}

.lio-rm-next h4 {
  margin: 0 0 6px !important;
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.lio-rm-next h4 a {
  color: var(--rm-navy);
  text-decoration: none;
  transition: color 0.15s ease;
}

.lio-rm-next h4 a:hover {
  color: var(--rm-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lio-rm-next-price {
  margin: 0 0 10px !important;
  color: var(--rm-blue);
  font-size: 15.5px !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.lio-rm-next > ul > li > p:not(.lio-rm-next-price):not(.lio-rm-next-refund) {
  margin: 0 0 12px !important;
  color: var(--rm-ink);
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.lio-rm-next-refund {
  margin: auto 0 0 !important;
  padding-top: 12px;
  border-top: 1px solid var(--rm-line-light);
  color: var(--rm-muted);
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}

.lio-rm-next-refund b {
  color: var(--rm-navy);
}

/* ==============================================================
   6. [lio_country_table] — DESTINATION COMPARISON TABLE
   ============================================================== */
.lio-rm-ct {
  width: 100%;
  color: var(--rm-ink);
}

.lio-rm-ct-summary {
  margin: 0 0 14px !important;
  color: var(--rm-muted);
  font-size: 13.5px !important;
  line-height: 1.6 !important;
}

.lio-rm-ct-summary b {
  color: var(--rm-navy);
  font-weight: 700;
}

.lio-rm-ct-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-soft);
  box-shadow: var(--rm-shadow-sm);
}

.lio-rm-fg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lio-rm-fg label {
  color: var(--rm-navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lio-rm-fg select,
.lio-rm-fg input {
  min-width: 170px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #c5d3de;
  border-radius: var(--rm-radius);
  background-color: var(--rm-white);
  color: var(--rm-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lio-rm-fg select:hover,
.lio-rm-fg input:hover {
  border-color: #93b4cc;
}

.lio-rm-fg select:focus,
.lio-rm-fg input:focus {
  outline: none;
  border-color: var(--rm-blue);
  box-shadow: 0 0 0 3px rgba(0, 105, 169, 0.16);
}

.lio-rm-fcount {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 13px;
  color: var(--rm-muted);
  line-height: 1.45;
  text-align: right;
}

.lio-rm-fcount b {
  color: var(--rm-navy);
}

.lio-rm-freset {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #c6dfef;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-white);
  color: var(--rm-blue);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lio-rm-freset:hover {
  background: var(--rm-blue-light);
  border-color: var(--rm-blue);
  color: var(--rm-blue-dark);
}

/* Scrollable Table Container */
.lio-rm-ct-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-white);
  box-shadow: var(--rm-shadow-card);
  scrollbar-color: #b7c8d6 var(--rm-soft);
  scrollbar-width: thin;
}

.lio-rm-ct-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.45;
}

.lio-rm-ct-table th,
.lio-rm-ct-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--rm-line-light);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.lio-rm-ct-table tbody tr:last-child th,
.lio-rm-ct-table tbody tr:last-child td {
  border-bottom: 0;
}

.lio-rm-ct-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--rm-navy);
  color: var(--rm-white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--rm-navy-deep);
}

.lio-rm-ct-table thead th.lio-rm-nodata {
  background: #224057;
  color: #b8cad8;
  font-weight: 600;
}

/* Sticky First Column (Destination) for effortless horizontal scanning */
.lio-rm-ct-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
  box-shadow: 2px 0 8px rgba(6, 29, 45, 0.16);
}

.lio-rm-ct-table tbody th.lio-rm-city {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 170px;
  white-space: normal !important;
  background: var(--rm-white);
  font-weight: 400;
  border-right: 1px solid var(--rm-line-light);
  box-shadow: 2px 0 6px rgba(15, 47, 70, 0.04);
}

.lio-rm-ct-table tbody tr:nth-child(even) > td,
.lio-rm-ct-table tbody tr:nth-child(even) > th.lio-rm-city {
  background: var(--rm-soft);
}

.lio-rm-ct-table tbody tr:hover > td,
.lio-rm-ct-table tbody tr:hover > th.lio-rm-city {
  background: var(--rm-blue-light);
  transition: background-color 0.12s ease;
}

.lio-rm-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.lio-rm-sort:hover {
  color: var(--rm-gold);
}

.lio-rm-ct :focus-visible {
  outline: 2px solid var(--rm-gold);
  outline-offset: 2px;
}

.lio-rm-arw {
  font-size: 10px;
  opacity: 0.45;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.lio-rm-sort:hover .lio-rm-arw {
  opacity: 0.9;
}

.lio-rm-ct-table th[aria-sort] .lio-rm-arw {
  opacity: 1;
  color: var(--rm-gold);
}

.lio-rm-city b {
  display: block;
  color: var(--rm-navy);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.lio-rm-city span,
.lio-rm-cost small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--rm-muted);
}

.lio-rm-cost {
  color: var(--rm-navy);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Grade Badges */
.lio-rm-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 3px 10px;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-blue-light);
  color: var(--rm-navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lio-rm-grade-ap {
  background: #146c43;
  color: var(--rm-white);
}

.lio-rm-grade-a {
  background: #1f845a;
  color: var(--rm-white);
}

.lio-rm-grade-bp {
  background: #ddf2e7;
  color: #125236;
}

.lio-rm-grade-b {
  background: var(--rm-blue-light);
  color: var(--rm-blue-dark);
}

/* Unsourced & Score Bar Cells */
.lio-rm-nd {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--rm-radius-xs, 4px);
  background: #fef5e4;
  color: #875006;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.lio-rm-idx {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--rm-navy);
}

.lio-rm-bar {
  display: block;
  width: 96px;
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-line);
}

.lio-rm-bar i {
  display: block;
  height: 100%;
  border-radius: var(--rm-radius-pill);
  background: linear-gradient(90deg, var(--rm-blue) 0%, #1d87c9 100%);
}

/* Placeholder cells in comparison table */
.lio-rm-ct-table td.lio-rm-est {
  font-style: italic;
  color: var(--rm-muted);
}

.lio-rm-ct-table td.lio-rm-est .lio-rm-bar i {
  background: #9bb1c2;
}

.lio-rm-ct-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--rm-muted);
  font-size: 15px;
  font-weight: 500;
}

.lio-rm-ct-legend {
  margin: 12px 0 0 !important;
  color: var(--rm-muted);
  font-size: 13px !important;
  line-height: 1.6 !important;
}

.lio-rm-ct-note {
  margin: 20px 0 16px;
  padding: 18px 22px;
  border: 1px solid #f0dfb0;
  border-left: 4px solid var(--rm-gold);
  border-radius: 0 var(--rm-radius-md) var(--rm-radius-md) 0;
  background: #fffbf0;
  color: var(--rm-ink);
  font-size: 14px;
  line-height: 1.65;
}

.lio-rm-ct-note p {
  margin: 0 0 10px !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
}

.lio-rm-ct-note p:last-child {
  margin-bottom: 0 !important;
}

.lio-rm-ct-note b {
  color: var(--rm-navy);
}

/* ==============================================================
   7. [lio_product_catalog] — PRODUCT CATALOG
   ============================================================== */
.lio-rm-cat {
  width: 100%;
  color: var(--rm-ink);
}

.lio-rm-cat-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.lio-rm-cat-group:last-of-type {
  margin-bottom: 16px;
}

.lio-rm-cat-group > h3 {
  grid-column: 1 / -1;
  position: relative;
  margin: 0 0 4px !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid var(--rm-line);
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.25;
}

.lio-rm-cat-group > h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: var(--rm-gold);
}

.lio-rm-cat-item {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-md);
  background: var(--rm-white);
  box-shadow: var(--rm-shadow-card);
  transition: transform 0.2s var(--rm-ease), box-shadow 0.2s var(--rm-ease), border-color 0.2s ease;
}

.lio-rm-cat-item:hover {
  transform: translateY(-2px);
  border-color: #b7d2e5;
  box-shadow: var(--rm-shadow-hover);
}

.lio-rm-cat-item > h4 {
  margin: 0 0 12px !important;
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.lio-rm-cat-item > h4 a {
  color: var(--rm-navy);
  text-decoration: none;
  transition: color 0.15s ease;
}

.lio-rm-cat-item > h4 a:hover {
  color: var(--rm-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lio-rm-cat-offers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
}

.lio-rm-cat-offers > li {
  margin: 0 !important;
  padding: 6px 11px !important;
  border: 1px solid #cde2f0;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-blue-light);
  color: var(--rm-navy);
  font-size: 13px !important;
  font-weight: 700;
  line-height: 1.3 !important;
  font-variant-numeric: tabular-nums;
}

.lio-rm-cat-note {
  margin: 0 0 12px !important;
  padding: 10px 12px;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-soft);
  color: var(--rm-ink);
  font-size: 13.5px !important;
  line-height: 1.5 !important;
}

.lio-rm-cat-refund {
  margin: auto 0 0 !important;
  padding-top: 12px;
  border-top: 1px solid var(--rm-line-light);
  color: var(--rm-muted);
  font-size: 12.5px !important;
  line-height: 1.55 !important;
}

.lio-rm-cat-refund b {
  color: var(--rm-navy);
}

/* ==============================================================
   8. RESPONSIVE BREAKPOINTS
   ============================================================== */
@media (max-width: 768px) {
  .lio-rm-shell {
    padding: 22px 18px;
    border-radius: var(--rm-radius-md);
  }

  .lio-rm-form {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .lio-rm-form > label:first-of-type input[type="number"] {
    max-width: 100%;
  }

  .lio-rm-form > button[type="submit"] {
    width: 100%;
    justify-self: stretch;
  }

  .lio-rm-results > ol > li {
    padding: 18px !important;
  }

  .lio-rm-results > ol > li.lio-rm-has-media .lio-rm-result-top {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lio-rm-result-media {
    aspect-ratio: 16 / 9;
  }

  .lio-rm-result-link {
    width: 100%;
  }

  .lio-rm-results > ol > li > dl {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 14px;
  }

  .lio-rm-results > ol > li > dl dd {
    padding-right: 0;
  }

  .lio-rm-ct-filters {
    padding: 16px;
  }
}

@media (max-width: 540px) {
  .lio-rm-fg,
  .lio-rm-fg select,
  .lio-rm-fg input {
    width: 100%;
    min-width: 0;
  }

  .lio-rm-fcount {
    width: 100%;
    margin-left: 0;
    align-items: flex-start;
    text-align: left;
  }

  .lio-rm-ct-table tbody th.lio-rm-city {
    min-width: 140px;
  }

  .lio-rm-cat-group {
    grid-template-columns: 1fr;
  }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .lio-rm-form > label,
  .lio-rm-form > button[type="submit"],
  .lio-rm-next > ul > li,
  .lio-rm-cat-item {
    transition: none;
  }

  .lio-rm-form > button[type="submit"]:hover:not(:disabled),
  .lio-rm-next > ul > li:hover,
  .lio-rm-cat-item:hover {
    transform: none;
  }
}
