/* Tractrix consent banner and cookie settings dialog (assets/js/consent.js). Uses the roles from site.css. */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; padding: 0 16px 16px; pointer-events: none;
  animation: cc-in var(--tx-dur-deliberate, 360ms) var(--tx-ease-settle, ease-out) both;
}
.cc-in {
  position: relative; pointer-events: auto; max-width: 980px; margin: 0 auto; max-height: min(70vh, 560px); overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--rule-strong); border-top: 3px solid var(--accent);
  border-radius: var(--tx-radius); box-shadow: 0 8px 32px rgba(11, 37, 69, .18), 0 1px 3px rgba(11, 37, 69, .12);
  padding: 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 32px; align-items: end;
}
.cc-title { grid-column: 1; font-family: var(--tx-font-sans); font-size: 1.05rem; font-weight: 600; margin: 0 0 4px; margin-inline-end: 40px; }
.cc-text { grid-column: 1; margin: 0; font-size: .92rem; line-height: 1.55; max-width: 44rem; }
.cc-signal { grid-column: 1; display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; font-size: .86rem; font-weight: 600; color: var(--ok); }
.cc-signal svg { flex: none; width: 16px; height: 16px; margin-top: 3px; }
.cc-links { grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0; font-size: .86rem; }
.cc-banner .cc-btns { grid-column: 2; grid-row: 2 / span 4; align-self: end; }
.cc-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* Accept, Reject and Customise share one style: equal prominence, no nudging. */
.cc-btn {
  min-height: 44px; padding: 0 16px; border-radius: var(--tx-radius-sm); border: 1.5px solid var(--heading); background: var(--surface);
  color: var(--heading); font: 600 .92rem/1.2 var(--tx-font-sans); cursor: pointer; white-space: normal; hyphens: auto; overflow-wrap: break-word;
  transition: background var(--tx-dur-fast) var(--tx-ease), color var(--tx-dur-fast) var(--tx-ease);
}
@media (hover: hover) { .cc-btn:hover { background: var(--heading); color: var(--surface); } .cc-x:hover { color: var(--heading); border-color: var(--rule-strong); } }
.cc-btn:active { background: var(--heading); color: var(--surface); }
.cc-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cc-x {
  position: absolute; top: 10px; inset-inline-end: 10px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: var(--tx-radius-sm); background: transparent; color: var(--text-muted); cursor: pointer;
}
.cc-x svg { width: 16px; height: 16px; }
html.cc-open body { padding-bottom: var(--cc-h, 0); }
html.cc-open { scroll-padding-bottom: var(--cc-h, 0); }
@keyframes cc-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 860px) {
  .cc-in { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .cc-banner .cc-btns { grid-column: 1; grid-row: auto; margin-top: 14px; }
}
@media (max-width: 600px) {
  .cc-banner { padding: 0 8px 8px; }
  .cc-in { padding: 16px; max-height: 62vh; }
  .cc-text { font-size: .88rem; line-height: 1.5; }
  .cc-links { gap: 2px 16px; }
  .cc-btn { padding: 0 8px; font-size: .88rem; }
}

/* ------------------------------------------------------------------ settings dialog */
.cc-dialog {
  width: min(640px, calc(100vw - 24px)); max-height: min(88vh, 860px); padding: 0; border: 1px solid var(--rule-strong);
  border-radius: var(--tx-radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(4, 16, 31, .35);
}
.cc-dialog[open] { display: flex; flex-direction: column; animation: cc-in var(--tx-dur-deliberate, 360ms) var(--tx-ease-settle, ease-out) both; }
.cc-dialog::backdrop { background: rgba(7, 24, 46, .55); }
html.cc-modal { overflow: hidden; }
.cc-dh { position: relative; padding: 18px 0 14px; padding-inline: 24px 60px; border-bottom: 1px solid var(--rule); border-top: 3px solid var(--accent); }
.cc-dh h2 { font-family: var(--tx-font-serif); font-size: 1.45rem; margin: 0; }
.cc-dh h2:focus { outline: none; }
.cc-dh h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.cc-db { padding: 16px 24px 8px; overflow-y: auto; font-size: .92rem; }
.cc-db > p { margin: 0 0 12px; }
.cc-db .cc-signal { margin: 0 0 12px; }
.cc-cat { border: 1px solid var(--rule); border-radius: var(--tx-radius-sm); padding: 14px 16px 10px; margin: 0 0 10px; background: var(--bg); }
.cc-ch { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 4px; }
.cc-ch h3 { font-size: 1rem; margin: 0; }
.cc-cat > p { margin: 0 0 6px; color: var(--text-muted); font-size: .88rem; }
.cc-cat details { font-size: .86rem; }
.cc-cat summary { cursor: pointer; color: var(--link); padding: 4px 0; width: max-content; max-width: 100%; }
.cc-items { list-style: none; margin: 6px 0 4px; padding: 0; }
.cc-items li { padding: 8px 0; border-top: 1px solid var(--rule); color: var(--text-muted); overflow-wrap: anywhere; }
.cc-items code { color: var(--heading); }
.cc-items span { font-family: var(--tx-font-mono); font-size: .76rem; }
.cc-none { font-style: italic; }
.cc-tag {
  flex: none; font-family: var(--tx-font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  border: 1px solid var(--rule-strong); border-radius: 3px; padding: 3px 8px; white-space: nowrap;
}
/* switch: a real checkbox with role="switch", unchecked by default */
.cc-sw { position: relative; flex: none; width: 48px; height: 28px; }
.cc-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cc-sw span { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--text-muted); transition: background var(--tx-dur-fast) var(--tx-ease); }
.cc-sw span::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform var(--tx-dur-fast) var(--tx-ease);
}
.cc-sw input:checked + span { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); }
.cc-sw input:checked + span::after { transform: translateX(20px); background: #fff; }
.cc-sw input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.cc-sw input:disabled { cursor: not-allowed; }
.cc-sw input:disabled + span { opacity: .45; }
.cc-reg { margin: 14px 0 6px; padding-top: 14px; border-top: 1px solid var(--rule); }
.cc-reg label { display: block; font-weight: 600; color: var(--heading); margin-bottom: 6px; }
.cc-reg select { font: inherit; min-height: 40px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--tx-radius-sm); background: var(--surface); color: var(--text); max-width: 100%; }
.cc-reg p { margin: 8px 0 0; font-size: .86rem; color: var(--text-muted); }
.cc-reg .cc-basis { color: var(--text); }
.cc-meta { font-family: var(--tx-font-mono); font-size: .72rem; color: var(--text-muted); overflow-wrap: anywhere; margin: 12px 0 8px !important; }
.cc-df { padding: 14px 24px 18px; border-top: 1px solid var(--rule); background: var(--surface); }
@media (max-width: 600px) {
  .cc-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .cc-dh { padding: 14px 0 12px; padding-inline: 16px 56px; }
  .cc-dh h2 { font-size: 1.25rem; }
  .cc-db { padding: 14px 16px 6px; }
  .cc-df { padding: 12px 16px 14px; }
}
@media (max-width: 400px) { .cc-df .cc-btns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .cc-df .cc-btn[data-cc="save"] { grid-column: 1 / -1; } }

/* footer "Cookie settings" button looks like the footer links */
.footer-linkbtn { font: inherit; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; text-align: start; }
.footer-linkbtn:hover { color: var(--link); text-decoration: underline; }

/* consent status on legal pages */
.cc-status { font-family: var(--tx-font-mono); font-size: .84rem; }

@media (prefers-reduced-motion: reduce) { .cc-banner, .cc-dialog[open] { animation: none; } }
@media print { .cc-banner, .cc-dialog { display: none !important; } }
@media (forced-colors: active) { .cc-sw span { border: 2px solid CanvasText; } .cc-sw input:checked + span { background: Highlight; } }
