:root {
  --bg-page: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;

  --border: #e5e7eb;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --brand-red: #ef4444;

  --radius-sm: 10px;
  --radius-md: 14px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.06);

  --focus-ring: 0 0 0 4px rgba(239, 68, 68, 0.18);
  --sidebar-width: 260px;
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 10px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  z-index: 1000;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
}

/* Layout */
.layout {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  z-index: 50;
  transform: translateX(0);
  transition: transform 220ms ease;
  will-change: transform;
}

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 14px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding-right: 4px;
}

.sidebar-nav-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 10px 10px;
}

.sidebar-nav-group + .sidebar-nav-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-nav-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-primary);
  padding: 0 10px 8px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.25;
  position: relative;
}

.sidebar-nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav-link.is-active {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: inset 2px 0 0 var(--brand-red);
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 12px 10px 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

/* Main */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar-height);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-secondary);
  flex: 0 0 auto;
}

.menu-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.menu-toggle-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  position: relative;
  margin: 0 auto;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.menu-toggle-icon::before {
  top: -6px;
}

.menu-toggle-icon::after {
  top: 6px;
}

.topbar-title {
  min-width: 0;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.lang-toggle {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
}

.lang-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.lang-pill.is-active {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--text-primary);
}

.content {
  padding: 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px 18px 8px;
}

.meta-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
}

.meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.meta-value {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-secondary);
}

.policy-language {
  padding: 10px 8px 4px;
}

.policy-language + .policy-language {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.rs-kicker {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
}

.rs-kicker-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rs-kicker-sub {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.last-updated {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.card h2 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h2::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
  flex: 0 0 auto;
}

.card p {
  margin: 10px 0 0;
  color: var(--text-primary);
  font-size: 14.5px;
}

.card p + p {
  margin-top: 10px;
}

.card ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.card li {
  margin: 7px 0;
  color: var(--text-primary);
  font-size: 14.5px;
}

.card a {
  color: var(--brand-red);
  text-decoration: none;
  text-underline-offset: 3px;
}

.card a:hover {
  text-decoration: underline;
}

.contact.rs-callout {
  margin-top: 16px;
  padding: 14px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: rgba(239, 68, 68, 0.05);
}

.policy-footer {
  margin: 18px 8px 12px;
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}

.policy-footer a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Anchors shouldn't sit under sticky topbar */
#en,
#fr-ca,
.card h2[id] {
  scroll-margin-top: calc(var(--topbar-height) + 18px);
}

/* Mobile drawer */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.35);
  z-index: 40;
}

@media (max-width: 980px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    transform: translateX(-102%);
    box-shadow: var(--shadow-card);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 16px 16px;
  }

  .content {
    padding: 18px 16px 28px;
  }

  .lang-pill {
    min-width: 52px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

