.policy-tools, .policy-navigation { display: none; }

@media screen and (max-width: 1100px), screen and (max-width: 1366px) and (max-aspect-ratio: 3/2), screen and (max-width: 1600px) and (any-pointer: coarse) {
  body.renduva-legal > header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: max(.35rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .35rem max(1rem, env(safe-area-inset-left));
  }
  .renduva-legal > header > a { display: inline-flex; align-items: center; min-height: 44px; line-height: 1.2; }
  .renduva-legal > header > a + a { margin-left: auto; font-size: .875rem; text-align: right; }
  .renduva-legal > header > .language-picker { position: relative; inset: auto; flex: none; width: 44px; height: 44px; }
  .renduva-legal main { overflow-wrap: anywhere; }

  .renduva-legal[data-policy-mode] .policy-tools {
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }
  .policy-tools select, .policy-tools button, .policy-navigation button {
    min-height: 44px;
    font: inherit;
    color: #deefff;
    background: #092746;
    border: 1px solid #48718e;
    border-radius: .55rem;
    padding: .3rem .7rem;
  }
  .policy-tools select { flex: 1; min-width: 0; max-width: 32rem; text-overflow: ellipsis; }
  .policy-tools button { min-width: 0; font-size: .875rem; }
  .policy-tools .policy-preferences { display: grid; place-items: center; flex: none; width: 44px; padding: 0; }
  /* Visitors can read the policy before making a decision. Both preference
     controls open the original settings panel without changing consent. */
  body.renduva-legal[data-policy-mode] #renduva-consent:not(:has(details[open])) { display: none; }
  .policy-navigation button { display: inline-grid; place-items: center; width: 48px; }
  .policy-navigation button:disabled { opacity: .35; }
  .policy-tools :focus-visible, .policy-navigation :focus-visible { outline: 2px solid #a1e9ff; outline-offset: 1px; }

  body[data-policy-mode="pages"] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }
  body[data-policy-mode="pages"] main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: clamp(.3rem, 1.6vh, 1.3rem);
    min-height: 0;
    width: 100%;
    max-width: 48rem !important;
    box-sizing: border-box;
    padding: clamp(.3rem, 1.5vh, 1rem) max(1rem, 4vw, env(safe-area-inset-right)) max(.3rem, env(safe-area-inset-bottom)) max(1rem, 4vw, env(safe-area-inset-left));
    margin: 0 auto;
  }
  body[data-policy-mode="pages"] .policy-frame {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #08254ae8;
    border-radius: .65rem;
    outline: 1px solid #4676a142;
    /* Padding lives on the child content, keeping the column pitch exact. */
  }
  body[data-policy-mode="pages"] .policy-topic:not(.is-current) { display: none; }
  body[data-policy-mode="pages"] .policy-topic.is-current {
    column-count: 1;
    column-fill: auto;
    column-gap: 0;
    box-sizing: border-box;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
  }
  body[data-policy-mode="pages"] .policy-topic > * {
    margin: 0;
    padding: .45rem clamp(.6rem, 2vw, 1.25rem);
  }
  body[data-policy-mode="pages"] .policy-topic > :first-child { padding-top: .6rem; }
  body[data-policy-mode="pages"] .policy-topic h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
  body[data-policy-mode="pages"] .policy-topic h2 { font-size: clamp(1.15rem, 3.8vw, 1.65rem); line-height: 1.2; }
  body[data-policy-mode="pages"] .policy-topic p { font-size: 1rem; line-height: 1.48; orphans: 2; widows: 2; }
  body[data-policy-mode="pages"] .policy-topic p.eyebrow { font-size: .8125rem; }
  body[data-policy-mode="pages"] .policy-topic > button { margin: .4rem .75rem; max-width: calc(100% - 1.5rem); min-height: 44px; color: #a5e6ff; }
  body[data-policy-mode="pages"] .policy-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
  }
  .policy-navigation output { font-variant-numeric: tabular-nums; color: #c3d9ef; font-size: .875rem; }
  body[data-policy-mode="full"] .policy-tools { justify-content: flex-end; margin-bottom: 1rem; }
  body[data-policy-mode="full"] .policy-tools select { display: none; }

  /* Reflow each record into three labelled fields; the semantic table remains
     available to assistive technology and the labels follow the active locale. */
  .renduva-legal .policy-frame .table-wrap { overflow: visible; }
  .renduva-legal .policy-frame table {
    display: block;
    min-width: 0;
    width: 100%;
    white-space: normal;
  }
  .policy-frame table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .policy-frame table :is(tbody, tr) { display: block; }
  .policy-frame tbody tr { padding-block: .4rem; border-bottom: 1px solid #31577a; break-inside: avoid; }
  .policy-frame tbody td {
    display: block;
    padding: .15rem 0;
    border: 0;
    line-height: 1.35;
    white-space: normal;
    font-size: .9375rem;
  }
  .policy-frame tbody td::before { content: attr(data-policy-label) " · "; font-weight: 650; color: #a6def6; }
}
@media print {
  .policy-tools, .policy-navigation { display: none !important; }
  .policy-frame { display: contents; }
}
