/* ============================================================
   finPOWER Connect — Release Notes
   Shared stylesheet for index, version "What's New", and feature detail pages.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #1B3064;
  --color-primary-light: #e9ecf3;
  --color-primary-dark: #111e40;
  --color-brand-red: #B91C2C;
  --color-brand-red-light: #fce8ea;
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-border: #e2e6ed;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); }

/* ============================================================
   Per-release "What's New" header (whats-new.html)
   ============================================================ */
.rn-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
  position: relative;
}
.rn-header__inner { max-width: 900px; margin: 0 auto; }
.rn-header__back {
  position: absolute; top: 20px; left: 24px;
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.85); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.rn-header__back:hover { background: rgba(255,255,255,0.1); color: #fff; }
.rn-header__brand { margin-bottom: 16px; }
.rn-header__logo {
  height: 60px; margin: 0 auto;
  background: #fff; padding: 10px 18px;
  border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.rn-header h1 {
  font-size: 2.5rem; font-weight: 800; margin: 0;
  display: inline-block; vertical-align: middle;
}
.rn-header__version {
  display: inline-block; vertical-align: middle;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px; padding: 4px 16px; margin-left: 12px;
  font-size: 1rem; font-weight: 600;
}
.rn-header__date {
  margin-top: 12px; font-size: 0.95rem; opacity: 0.8;
}

/* ============================================================
   Stats bar — used by both index (latest release) and per-release pages
   ============================================================ */
.rn-stats {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  max-width: 900px; margin: -28px auto 32px;
  position: relative; z-index: 1;
}
.rn-stat {
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 20px 28px; text-align: center;
  min-width: 140px;
}
.rn-stat__number {
  font-size: 2rem; font-weight: 800; color: var(--color-primary);
}
.rn-stat__label {
  font-size: 0.85rem; color: var(--color-text-secondary); font-weight: 500;
  margin-top: 4px;
}

/* ============================================================
   Main content wrapper (per-release pages)
   ============================================================ */
.rn-main {
  max-width: 900px; margin: 0 auto; padding: 32px 24px 64px;
}

/* Quick nav */
.rn-toc {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 40px; padding: 16px 20px;
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); border: 1px solid var(--color-border);
}
.rn-toc h2 {
  font-size: 0.85rem; font-weight: 600; color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-right: 4px;
}
.rn-toc a {
  font-size: 0.9rem; font-weight: 500; color: var(--color-primary);
  text-decoration: none; padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.rn-toc a:hover { background: var(--color-primary-light); text-decoration: none; }
.rn-toc a i { margin-right: 4px; }

/* Category section */
.rn-category { margin-bottom: 48px; }
.rn-category > h2 {
  font-size: 1.5rem; font-weight: 700; color: var(--color-primary);
  margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary-light);
}
.rn-category > h2 i { margin-right: 8px; opacity: 0.7; }

/* Feature item — expandable */
.rn-item {
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); border: 1px solid var(--color-border);
  margin-bottom: 12px; overflow: hidden;
  transition: box-shadow .2s;
  display: block; text-decoration: none; color: inherit;
}
.rn-item:hover { box-shadow: var(--shadow-md); text-decoration: none; }

.rn-item__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; user-select: none;
  transition: background .15s; gap: 16px;
}
.rn-item__header:hover { background: var(--color-primary-light); }

.rn-item__title {
  font-weight: 600; font-size: 1rem; color: var(--color-text);
  /* Inline flow — NOT flex. Flex would split the title's text node into separate
     flex items each time the search highlighter wraps a match in <span>, breaking
     the title onto multiple lines (one per word fragment). */
}
.rn-item__chevron {
  font-size: 0.75rem; color: var(--color-text-muted);
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
  transition: transform .2s;
}
.rn-item.open .rn-item__chevron { transform: rotate(90deg); }

/* Items with no expandable body: hide the chevron and remove the click affordance. */
.rn-item:not(a):not(:has(.rn-item__body)) .rn-item__chevron { display: none; }
.rn-item:not(a):not(:has(.rn-item__body)) .rn-item__header { cursor: default; }
.rn-item:not(a):not(:has(.rn-item__body)) .rn-item__header:hover { background: transparent; }

/* Link cards (rn-item rendered as <a>) navigate to a detail page rather than expand.
   Distinguish them visually: hide the left-side rotating chevron and show a forward
   navigation arrow at the far right of the header that slides forward on hover. This
   matches the visual language used by .rn-highlight cards on the index page. */
a.rn-item .rn-item__chevron { display: none; }
/* Make the title fill available space so the arrow sits at the far right
   alongside the tags, instead of being pushed to the centre by space-between. */
a.rn-item .rn-item__title { flex: 1; }
a.rn-item .rn-item__header::after {
  content: "\f061"; /* fa-arrow-right */
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  flex-shrink: 0;
  align-self: center;
  transition: transform .15s, color .15s;
}
a.rn-item:hover .rn-item__header::after {
  color: var(--color-primary);
  transform: translateX(4px);
}

.rn-item__tags { display: flex; gap: 6px; flex-shrink: 0; }

.rn-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 500; padding: 3px 8px;
  border-radius: 12px;
}
.rn-tag--desktop { background: #ede9fe; color: #6d28d9; }
.rn-tag--cloud { background: #e0f2fe; color: #0369a1; }
.rn-tag--api { background: #fef3c7; color: #92400e; }

.rn-item__body {
  /* Animated expand/collapse. We can't transition `display`, so the body is always
     in flow but collapsed by default via max-height + opacity. The 1500px ceiling
     is well above any realistic body content height; long bodies still animate
     smoothly because the visible height stops at the actual content height while
     max-height carries on to its ceiling. */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 20px;
  border-top: 1px solid transparent;
  transition:
    max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.18s ease-out,
    padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s ease-out;
}
.rn-item.open .rn-item__body {
  max-height: 1500px;
  opacity: 1;
  padding: 0 20px 20px;
  border-top-color: var(--color-border);
}

.rn-item__summary {
  font-size: 0.95rem; color: var(--color-text-secondary);
  margin: 0 20px 16px; padding-bottom: 16px;
}

/* How-to guide inside item */
.rn-howto {
  background: var(--color-info-bg); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 12px 0;
}
.rn-howto h4 {
  font-size: 0.9rem; font-weight: 600; color: var(--color-info);
  margin-bottom: 12px;
}
.rn-howto h4 i { margin-right: 6px; }

.rn-steps { display: flex; flex-direction: column; gap: 22px; }
.rn-step {
  display: flex; gap: 14px; align-items: flex-start;
}
.rn-step__number {
  flex-shrink: 0; width: 30px; height: 30px;
  background: var(--color-primary); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  margin-top: 1px;
}
.rn-step__content { flex: 1; min-width: 0; line-height: 1.7; }
/* Only the FIRST direct-child <strong> is the step title (block-level); inline
   <strong> inside the description must remain inline. */
.rn-step__content > strong:first-child {
  display: block; font-size: 1rem; font-weight: 700;
  color: var(--color-text); margin-bottom: 6px;
}
.rn-step__content p { font-size: 0.95rem; color: var(--color-text); margin: 0 0 10px; line-height: 1.7; }
.rn-step__content p:last-child { margin-bottom: 0; }
.rn-step__content ul, .rn-step__content ol { margin: 6px 0 10px 22px; }
.rn-step__content li { margin-bottom: 4px; font-size: 0.95rem; line-height: 1.65; }

/* Detail line (permission key, settings) */
.rn-detail {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--color-text-secondary);
  margin-top: 8px; padding: 8px 12px;
  background: var(--color-bg); border-radius: var(--radius-sm);
}
.rn-detail i { color: var(--color-warning); }
.rn-detail code {
  background: var(--color-primary-light); padding: 2px 6px;
  border-radius: 4px; font-size: 0.82rem; font-family: 'Consolas', monospace;
}

/* Simple list for Other Changes */
.rn-simple-list {
  list-style: none; padding: 0;
}
.rn-simple-list li {
  padding: 10px 16px; font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.rn-simple-list li:last-child { border-bottom: none; }
.rn-simple-list li::before {
  content: '\2022'; color: var(--color-text-muted);
  margin-right: 10px; font-weight: bold;
}

/* Footer */
.rn-footer {
  text-align: center; padding: 32px 24px;
  font-size: 0.85rem; color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.rn-footer p { margin: 4px 0; }
.rn-footer__intersoft {
  display: inline-block;
  margin-bottom: 16px;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
}
.rn-footer__intersoft:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.rn-footer__intersoft-logo {
  height: 44px;
  display: block;
}

/* Expand/Collapse All button */
.rn-expand-all {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 0.85rem; font-weight: 500; color: var(--color-text-secondary);
  cursor: pointer; margin-bottom: 20px;
  transition: background .15s;
}
.rn-expand-all:hover { background: var(--color-primary-light); }

/* Search */
.rn-search { margin-bottom: 24px; position: relative; }
.rn-search__input-wrap { position: relative; }
.rn-search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.rn-search__input {
  width: 100%; padding: 12px 40px; font-size: 0.95rem; font-family: var(--font-sans);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm);
}
.rn-search__input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(27,48,100,0.1); outline: none; }
.rn-search__clear { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; display: none; }
.rn-search__status { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 8px; }
.rn-search__highlight { background: #fef08a; border-radius: 2px; }
.rn-item--hidden { display: none !important; }
.rn-category--hidden { display: none !important; }
.rn-subgroup--hidden { display: none !important; }

/* ============================================================
   Detail page (features/*.html)
   ============================================================ */
.rn-detail-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff; padding: 16px 24px;
}
.rn-detail-header__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.rn-detail-header__back {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background .15s;
}
.rn-detail-header__back:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.rn-detail-header__brand { display: flex; align-items: center; gap: 12px; }
.rn-detail-header__logo {
  height: 40px;
  background: #fff; padding: 7px 12px;
  border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
.rn-detail-header__version {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px; padding: 3px 12px; font-size: 0.85rem; font-weight: 600;
}

.rn-detail-main {
  max-width: 1100px; margin: 0 auto; padding: 32px 24px 40px;
  display: grid; grid-template-columns: 1fr 220px;
  /* Column gap only — NOT row gap. The TOC uses `grid-row: 1 / span 99` to keep
     `position: sticky` working through the full scroll. With a row gap, those 98
     phantom row gaps would add 98 × 48px = ~4700px of empty vertical space below
     the actual content. Sections already supply their own bottom margin. */
  column-gap: 48px;
  row-gap: 0;
}
.rn-detail-main > * { grid-column: 1; }
.rn-detail-toc {
  grid-column: 2; grid-row: 1 / span 99;
  position: sticky; top: 24px; align-self: start;
  background: var(--color-surface); border-radius: var(--radius-md);
  border: 1px solid var(--color-border); padding: 16px 20px;
}
.rn-detail-toc__title {
  font-size: 0.78rem; font-weight: 700; color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px;
}
.rn-detail-toc ul { list-style: none; }
.rn-detail-toc li { margin: 0; }
.rn-detail-toc a {
  display: block; padding: 6px 8px; font-size: 0.88rem;
  color: var(--color-text-secondary); text-decoration: none; border-radius: 4px;
}
.rn-detail-toc a:hover { background: var(--color-primary-light); color: var(--color-primary); }

.rn-breadcrumb {
  font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 16px;
}
.rn-breadcrumb a { color: var(--color-primary); text-decoration: none; }
.rn-breadcrumb a:hover { text-decoration: underline; }
.rn-breadcrumb__sep { margin: 0 6px; color: var(--color-text-muted); }

.rn-detail-main h1 {
  font-size: 2.2rem; font-weight: 800; color: var(--color-primary);
  margin-bottom: 14px; line-height: 1.25;
}
.rn-detail-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 40px;
}
.rn-detail-meta__category {
  font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary);
  background: var(--color-primary-light); padding: 4px 10px; border-radius: 12px;
}
.rn-detail-meta__category i { margin-right: 4px; opacity: 0.8; }

.rn-detail-main section { margin-bottom: 56px; scroll-margin-top: 24px; }
/* Last section sits flush against the main padding-bottom — no extra trailing gap. */
.rn-detail-main > section:last-of-type { margin-bottom: 0; }
.rn-detail-main section h2 {
  font-size: 1.45rem; font-weight: 700; color: var(--color-primary);
  margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary-light);
}
.rn-detail-main section h3 {
  font-size: 1.1rem; font-weight: 700; color: var(--color-primary);
  margin: 28px 0 12px;
}
.rn-detail-main p { margin: 0 0 16px; color: var(--color-text); line-height: 1.75; }
.rn-detail-main p:last-child { margin-bottom: 0; }
/* Lists in body copy (outside .rn-checklist / .rn-steps / .rn-detail-toc) */
.rn-detail-main > section ul:not(.rn-checklist):not(:where(.rn-detail-toc *)),
.rn-detail-main > section ol {
  margin: 0 0 18px 26px; line-height: 1.75;
}
.rn-detail-main > section li { margin-bottom: 6px; }
.rn-detail-main code {
  background: var(--color-primary-light); color: var(--color-primary);
  padding: 2px 6px; border-radius: 4px;
  font-family: 'Consolas', 'Menlo', monospace; font-size: 0.88em;
}
.rn-detail-main pre {
  background: #f1f4fa; padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 0.85rem; overflow-x: auto; margin: 0 0 16px;
  border: 1px solid var(--color-border);
}
.rn-detail-main pre code {
  background: transparent; color: var(--color-text); padding: 0;
}

/* Checklist */
.rn-checklist { display: flex; flex-direction: column; gap: 10px; }
.rn-checklist__item {
  position: relative;
  padding-left: 32px;
  font-size: 0.95rem; color: var(--color-text);
  line-height: 1.55;
}
.rn-checklist__item i {
  position: absolute;
  left: 0; top: 2px;
  color: var(--color-success);
  background: var(--color-success-bg);
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
}

/* Tables */
.rn-table {
  width: 100%; border-collapse: collapse;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden;
  font-size: 0.92rem; line-height: 1.6;
  margin: 0 0 20px;
}
.rn-table th {
  background: var(--color-primary-light); color: var(--color-primary);
  font-weight: 700; text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}
.rn-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.rn-table tr:last-child td { border-bottom: none; }
.rn-table p { margin: 0 0 8px; }
.rn-table p:last-child { margin-bottom: 0; }
.rn-table ul, .rn-table ol { margin: 0 0 8px 18px; }
.rn-table ul:last-child, .rn-table ol:last-child { margin-bottom: 0; }
.rn-table code {
  background: var(--color-primary-light); padding: 2px 6px;
  border-radius: 4px; font-size: 0.85rem; font-family: 'Consolas', 'Menlo', monospace;
}

/* Callouts */
.rn-callout {
  border-left: 4px solid; padding: 16px 20px; border-radius: var(--radius-sm);
  margin: 20px 0;
}
.rn-callout__title {
  font-weight: 700; font-size: 0.95rem; margin-bottom: 6px;
}
.rn-callout__title i { margin-right: 6px; }
.rn-callout p { margin: 0 0 8px; font-size: 0.94rem; line-height: 1.7; }
.rn-callout p:last-child { margin-bottom: 0; }
.rn-callout ul, .rn-callout ol { margin: 4px 0 0 22px; line-height: 1.7; font-size: 0.94rem; }
.rn-callout li { margin-bottom: 4px; }
.rn-callout--info {
  background: var(--color-info-bg); border-color: var(--color-info);
}
.rn-callout--info .rn-callout__title { color: var(--color-info); }
.rn-callout--warning {
  background: var(--color-warning-bg); border-color: var(--color-warning);
}
.rn-callout--warning .rn-callout__title { color: var(--color-warning); }

/* ============================================================
   Knowledge Base links — small inline pills (used on whats-new.html)
   and full reference cards (used on detail pages).
   KB articles live at https://www.intersoft.co.nz/Support/KbArticle.aspx?id=NNNNN
   ============================================================ */
.rn-kb-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 20px 14px;
}
.rn-kb-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600;
  background: rgba(27,48,100,0.06); color: var(--color-primary);
  padding: 3px 9px; border-radius: 12px;
  text-decoration: none;
  transition: background .15s, color .15s;
  letter-spacing: 0.02em;
}
.rn-kb-pill:hover {
  background: var(--color-primary); color: #fff; text-decoration: none;
}
.rn-kb-pill i { font-size: 0.6rem; opacity: 0.7; }
.rn-kb-pill:hover i { opacity: 1; }

.rn-kb-refs {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.rn-kb-ref {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  transition: box-shadow .2s, border-color .15s, transform .2s;
}
.rn-kb-ref:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  text-decoration: none;
  transform: translateY(-1px);
}
.rn-kb-ref__id {
  flex-shrink: 0;
  font-family: 'Consolas', 'Menlo', monospace;
  font-size: 0.78rem; font-weight: 700;
  background: var(--color-primary-light); color: var(--color-primary);
  padding: 4px 8px; border-radius: 4px;
  white-space: nowrap;
}
.rn-kb-ref__body { flex: 1; min-width: 0; line-height: 1.5; }
.rn-kb-ref__title {
  font-size: 0.92rem; font-weight: 600; color: var(--color-text);
  margin-bottom: 2px;
}
.rn-kb-ref__type {
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--color-text-muted);
}
.rn-kb-ref__chevron {
  flex-shrink: 0; align-self: center;
  color: var(--color-text-muted); font-size: 0.85rem;
  transition: transform .15s, color .15s;
}
.rn-kb-ref:hover .rn-kb-ref__chevron { color: var(--color-primary); transform: translateX(2px); }

/* Related links */
.rn-related-links { display: flex; flex-direction: column; gap: 8px; }
.rn-related-link {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 12px 16px;
  text-decoration: none; color: var(--color-primary); font-weight: 500;
  transition: box-shadow .2s, transform .2s;
}
.rn-related-link:hover { box-shadow: var(--shadow-md); transform: translateX(2px); }
.rn-related-link i { color: var(--color-text-muted); }

/* ============================================================
   Index page (Dev/Release Notes/index.html)
   ============================================================ */
.rn-index-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 56px 24px 80px;
  text-align: center;
}
.rn-index-header__inner { max-width: 1000px; margin: 0 auto; }
.rn-index-header__brand { margin-bottom: 24px; }
.rn-index-header__logo {
  height: 80px;
  background: #fff; padding: 14px 24px;
  border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}
.rn-index-header h1 {
  font-size: 3rem; font-weight: 800; margin: 0; letter-spacing: -0.02em;
}
.rn-index-header__tagline {
  margin-top: 10px; font-size: 1.05rem; opacity: 0.85; font-weight: 400;
}

.rn-version-switcher {
  margin-top: 32px;
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.rn-version-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.9rem; font-weight: 600;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.rn-version-pill:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  text-decoration: none;
}
.rn-version-pill--current {
  background: var(--color-brand-red);
  border-color: var(--color-brand-red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(185,28,44,0.4);
}
.rn-version-pill--current:hover {
  background: #a01828; border-color: #a01828; color: #fff;
}
.rn-version-pill i { font-size: 0.75rem; }

/* Index main wrapper */
.rn-index-main {
  max-width: 1000px; margin: 0 auto; padding: 0 24px 64px;
}

/* Latest release block — sits over the bottom of the header */
.rn-latest {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 36px 32px;
  margin-top: -40px; position: relative; z-index: 1;
  margin-bottom: 56px;
}
.rn-latest__header {
  text-align: center; margin-bottom: 28px;
}
.rn-latest__meta {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 12px;
}
.rn-latest__badge {
  display: inline-flex; align-items: center;
  background: var(--color-brand-red-light); color: var(--color-brand-red);
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 4px 12px; border-radius: 999px;
}
.rn-latest__date {
  font-size: 0.88rem; color: var(--color-text-secondary);
}
.rn-latest__title {
  font-size: 2rem; font-weight: 800; color: var(--color-primary);
  margin: 0 0 12px;
}
.rn-latest__intro {
  font-size: 1.02rem; color: var(--color-text-secondary);
  max-width: 720px; margin: 0 auto;
}

/* Stats bar inside latest block — flatter (no overlap, no negative margin) */
.rn-latest .rn-stats {
  margin: 28px auto;
  max-width: 100%;
}
.rn-latest .rn-stat {
  background: var(--color-bg);
  box-shadow: none; border: 1px solid var(--color-border);
}

/* Highlights */
.rn-highlights__title {
  font-size: 1.15rem; font-weight: 700; color: var(--color-primary);
  margin: 32px 0 16px;
  display: flex; align-items: center; gap: 10px;
}
.rn-highlights__title::before {
  content: ''; flex: 1; height: 2px; background: var(--color-primary-light);
}
.rn-highlights__title::after {
  content: ''; flex: 1; height: 2px; background: var(--color-primary-light);
}
.rn-highlights {
  display: flex; flex-direction: column; gap: 12px;
}
.rn-highlight {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  transition: box-shadow .2s, transform .2s, border-color .15s;
}
.rn-highlight:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary-light);
  text-decoration: none;
}
.rn-highlight__icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.rn-highlight__body { flex: 1; min-width: 0; }
.rn-highlight__title {
  font-size: 1rem; font-weight: 700; color: var(--color-text);
  margin-bottom: 4px;
}
.rn-highlight__summary {
  font-size: 0.9rem; color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.rn-highlight__tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.rn-highlight__chevron {
  flex-shrink: 0; color: var(--color-text-muted);
  font-size: 0.9rem;
}
.rn-highlight:hover .rn-highlight__chevron { color: var(--color-primary); }

/* Release KB-search container — wraps a label + a row of three product pills
   (Desktop & Business Layer / Cloud / Web Services) on whats-new.html and index.html. */
.rn-kb-search {
  text-align: center;
  margin: 0 auto 36px;
}
.rn-kb-search__label {
  font-size: 0.82rem; font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.rn-kb-search__links {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
/* Inline modifier — used inside content sections (e.g. detail-page kb-references)
   where the row should sit left-aligned alongside body copy rather than centered. */
.rn-kb-search--inline { text-align: left; margin: 0 0 24px; }
.rn-kb-search--inline .rn-kb-search__label { display: none; }
.rn-kb-search--inline .rn-kb-search__links { justify-content: flex-start; }

/* On the per-release dark header, the label is white-translucent */
.rn-header .rn-kb-search { margin-top: 16px; margin-bottom: 0; }
.rn-header .rn-kb-search__label { color: rgba(255,255,255,0.8); }

/* Release KB-search pill — one per product feed */
.rn-kb-search-link {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.9rem; font-weight: 500; color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 9px 16px; border-radius: 999px;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.rn-kb-search-link:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.rn-kb-search-link i { font-size: 0.78rem; opacity: 0.65; }
.rn-kb-search-link:hover i { opacity: 1; }

/* On the per-release header (white-on-navy), invert colours */
.rn-header .rn-kb-search-link {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.92);
}
.rn-header .rn-kb-search-link:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}

/* CTA */
.rn-latest__cta {
  text-align: center; margin-top: 32px;
}
.rn-cta-button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--color-brand-red); color: #fff;
  font-size: 1rem; font-weight: 600;
  padding: 14px 28px; border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(185,28,44,0.3);
  transition: background .15s, box-shadow .15s, transform .15s;
}
.rn-cta-button:hover {
  background: #a01828; color: #fff; text-decoration: none;
  box-shadow: 0 6px 16px rgba(185,28,44,0.45);
  transform: translateY(-1px);
}

/* Previous releases */
.rn-previous {}
.rn-previous__title {
  font-size: 1.4rem; font-weight: 700; color: var(--color-primary);
  text-align: center; margin-bottom: 8px;
}
.rn-previous__alltime {
  text-align: center; font-size: 0.9rem;
  color: var(--color-text-secondary); margin-bottom: 28px;
}
.rn-previous__alltime strong { color: var(--color-primary); }
.rn-previous__grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.rn-previous-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px 22px 18px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .2s, transform .2s, border-color .15s;
}
.rn-previous-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary-light);
  text-decoration: none;
}
.rn-previous-card__version {
  font-size: 1.4rem; font-weight: 800; color: var(--color-primary);
  letter-spacing: -0.01em;
}
.rn-previous-card__date {
  font-size: 0.82rem; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
}
.rn-previous-card__actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.rn-previous-card__kb a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--color-text-secondary);
  text-decoration: none;
  transition: color .15s;
}
.rn-previous-card__kb a:hover { color: var(--color-primary); text-decoration: underline; }
.rn-previous-card__kb i { font-size: 0.7rem; opacity: 0.7; }
.rn-previous-card__sep { color: var(--color-text-muted); margin: 0 4px; }
.rn-previous-card__link {
  font-size: 0.88rem; font-weight: 600; color: var(--color-brand-red);
  display: inline-flex; align-items: center; gap: 6px;
}
.rn-previous-card:hover .rn-previous-card__link i { transform: translateX(3px); }
.rn-previous-card__link i { transition: transform .15s; }

/* ============================================================
   Index empty state — shown before any release notes have been generated
   ============================================================ */
.rn-empty {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 56px 36px;
  margin-top: -40px;
  text-align: center;
  position: relative; z-index: 1;
}
.rn-empty__icon {
  width: 72px; height: 72px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 20px;
}
.rn-empty__title {
  font-size: 1.6rem; font-weight: 700; color: var(--color-primary);
  margin-bottom: 12px;
}
.rn-empty__body {
  font-size: 1rem; color: var(--color-text-secondary);
  max-width: 560px; margin: 0 auto;
}
.rn-empty__body code {
  background: var(--color-primary-light); color: var(--color-primary);
  padding: 2px 8px; border-radius: 4px;
  font-family: 'Consolas', monospace; font-size: 0.92em; font-weight: 600;
}

/* ============================================================
   Print styles
   ============================================================ */
@media print {
  .rn-header, .rn-index-header { padding: 24px; }
  /* In print mode, force every body open and skip the animation transitions. */
  .rn-item__body {
    max-height: none !important;
    opacity: 1 !important;
    padding: 0 20px 20px !important;
    border-top-color: var(--color-border) !important;
    transition: none !important;
  }
  .rn-item__chevron { display: none; }
  .rn-toc, .rn-expand-all, .rn-search { display: none; }
  .rn-stats { margin-top: 16px; }
  .rn-version-switcher { display: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .rn-detail-main { grid-template-columns: 1fr; }
  .rn-detail-toc { display: none; }
}
@media (max-width: 640px) {
  .rn-header h1 { font-size: 1.8rem; }
  .rn-index-header h1 { font-size: 2.1rem; }
  .rn-index-header { padding: 40px 20px 64px; }
  .rn-stats { gap: 12px; }
  .rn-stat { min-width: 100px; padding: 14px 16px; }
  .rn-stat__number { font-size: 1.5rem; }
  .rn-item__header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .rn-item__tags { align-self: flex-start; }
  .rn-latest { padding: 24px 20px; margin-top: -32px; }
  .rn-latest__title { font-size: 1.5rem; }
  .rn-highlight { flex-direction: row; }
  .rn-highlight__icon { width: 36px; height: 36px; }
}
