/* EU AI Act full-text reader */

/* Fixed header (~80–100px) — anchors must clear it */
.eau-page {
  scroll-margin-top: 0;
}

.eau-doc [id],
.eau-page .eau-chips [id],
.eau-page #pdf-download,
.eau-page #document,
.eau-page #tools,
.eau-page #hero,
.eau-page #contact,
.eau-page #preamble,
.eau-page #annexes {
  scroll-margin-top: 7.5rem;
}

.eau-page .eau-hero .hero-subtitle a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.eau-toolbar {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.eau-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.eau-chip {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(20, 30, 40, 0.15);
  border-radius: 4px;
  background: #f7f5f1;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.3;
}

.eau-chip:hover,
.eau-chip:focus-visible {
  border-color: #1a1a1a;
  background: #fff;
}

.eau-pdf-card {
  background: linear-gradient(160deg, #f3eee6 0%, #ebe4d8 100%);
  border: 1px solid rgba(20, 30, 40, 0.08);
  padding: 1.25rem 1.35rem 1.4rem;
  min-width: 0;
  overflow: hidden;
}

.eau-pdf-k {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5c564c;
}

.eau-pdf-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.eau-pdf-card > p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #333;
}

.eau-pdf-form {
  min-width: 0;
}

.eau-pdf-form .form-group {
  margin-bottom: 0.65rem;
}

.eau-pdf-form input[type="email"],
.eau-pdf-form input[type="text"] {
  width: 100%;
  max-width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(20, 30, 40, 0.2);
  border-radius: 4px;
  font: inherit;
  background: #fff;
}

.eau-consent {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.75rem 0 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #444;
}

.eau-consent input {
  margin-top: 0.2rem;
}

.eau-pdf-form .btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.3;
}

.eau-pdf-unlock {
  margin-top: 0.85rem;
  min-width: 0;
}

.eau-pdf-unlock .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.9rem;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
  font-size: 0.95rem;
}

.eau-pdf-note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: #666;
}

.eau-doc-sec {
  padding: 0 0 3rem;
}

.eau-doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  position: relative;
}

.eau-toc-open {
  display: none;
  margin-bottom: 1rem;
}

.eau-toc-panel {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 6.5rem);
  overflow: auto;
  background: #f7f5f1;
  border: 1px solid rgba(20, 30, 40, 0.08);
  padding: 0.85rem 0.75rem 1rem;
}

.eau-toc-sticky {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f7f5f1;
  padding: 0 0 0.65rem;
  margin: 0 0 0.35rem;
  border-bottom: 1px solid rgba(20, 30, 40, 0.1);
}

.eau-toc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.eau-toc-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.eau-toc-close {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.eau-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.eau-toc-item {
  margin: 0;
}

.eau-toc-item a {
  display: block;
  padding: 0.28rem 0.4rem;
  color: #222;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.35;
  border-radius: 3px;
}

.eau-toc-sub a {
  padding-left: 0.9rem;
  color: #444;
  font-size: 0.78rem;
  line-height: 1.4;
}

.eau-toc-item a:hover,
.eau-toc-item a:focus-visible,
.eau-toc-item a.is-active {
  background: #fff;
  color: #000;
}

.eau-toc-foot {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
}

.eau-doc {
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(20, 30, 40, 0.06);
  padding: 1.25rem 1.35rem 2rem;
}

.eau-disclaimer {
  margin-bottom: 1.25rem;
}

.eau-doc .eli-container,
.eau-doc .oj-normal,
.eau-doc .oj-p {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.55;
  color: #1a1a1a;
}

.eau-doc .oj-doc-ti,
.eau-doc .oj-art-ti,
.eau-doc .oj-cpt-ti,
.eau-doc .oj-ti-section-2,
.eau-doc h2.oj-ti-section-2 {
  font-family: inherit;
  font-weight: 700;
  text-align: left;
  margin: 1.5rem 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.35;
  color: #111;
}

.eau-doc .oj-ti-art,
.eau-doc h3.oj-ti-art {
  font-family: inherit;
  font-weight: 700;
  text-align: left;
  margin: 2rem 0 0.15rem;
  font-size: 1.2rem;
  line-height: 1.3;
  color: #111;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(20, 30, 40, 0.1);
}

.eau-doc .eli-title {
  margin: 0 0 0.85rem;
}

.eau-doc .oj-sti-art,
.eau-doc h4.oj-sti-art {
  font-family: inherit;
  font-weight: 600;
  text-align: left;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
  color: #333;
}

.eau-chip {
  max-width: 100%;
}

.eau-doc .oj-hd-ti {
  font-size: 1.1rem;
}

.eau-flag {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  background: #003399;
  color: #fc0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.eau-preamble {
  margin: 1rem 0 1.5rem;
  border: 1px solid rgba(20, 30, 40, 0.12);
  background: #faf9f7;
  padding: 0.5rem 0.85rem 0.85rem;
}

.eau-preamble-summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.45rem 0;
}

.eau-preamble-body {
  margin-top: 0.75rem;
  max-height: none;
}

.eau-doc table {
  width: 100%;
  border-collapse: collapse;
}

.eau-doc td {
  vertical-align: top;
  padding: 0.15rem 0.35rem 0.35rem 0;
}

/* Nested TOC */
.eau-toc-search-wrap {
  margin: 0 0 0.55rem;
}

.eau-toc-search {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(20, 30, 40, 0.2);
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  background: #fff;
}

.eau-toc-search-empty {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: #888;
}

.eau-toc-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.55rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(20, 30, 40, 0.12);
}

.eau-toc-chat[hidden] {
  display: none !important;
}

.eau-toc-group {
  list-style: none;
  margin: 0.15rem 0;
}

.eau-toc-details {
  border: 0;
  margin: 0;
}

.eau-toc-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.2rem 0;
}

.eau-toc-summary::-webkit-details-marker {
  display: none;
}

.eau-toc-summary::before {
  content: "▸";
  flex: 0 0 auto;
  font-size: 0.7rem;
  line-height: 1.6;
  color: #666;
}

.eau-toc-details[open] > .eau-toc-summary::before {
  content: "▾";
}

.eau-toc-chapter {
  font-size: 0.82rem;
  font-weight: 600;
  color: #111;
  text-decoration: none;
  line-height: 1.35;
}

.eau-toc-chapter:hover {
  text-decoration: underline;
}

.eau-toc-children {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0 0 0 0.85rem;
}

/* You are here */
.eau-here-bar {
  position: sticky;
  top: 80px;
  z-index: 40;
  background: rgba(247, 245, 241, 0.96);
  border-bottom: 1px solid rgba(20, 30, 40, 0.1);
  backdrop-filter: blur(8px);
}

.eau-here-inner {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
}

.eau-here-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
  white-space: nowrap;
}

.eau-here-path {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #1a1a1a;
}

/* NotebookLM card */
.eau-nlm-card {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.35rem;
  background: #f7f5f1;
  border: 1px solid rgba(20, 30, 40, 0.08);
}

.eau-nlm-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.eau-nlm-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0;
}

.eau-nlm-prompt {
  cursor: pointer;
  border: 1px solid rgba(20, 30, 40, 0.15);
  background: #fff;
  font: inherit;
}

.eau-nlm-pending {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: #555;
  line-height: 1.45;
}

.eau-nlm-pending code {
  font-size: 0.8em;
}

.eau-nlm-actions {
  margin: 0.75rem 0 0;
}

/* Mobile tables */
.eau-doc .eli-container table,
.eau-doc table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 960px) {
  .eau-toolbar {
    grid-template-columns: 1fr;
  }

  /* Hide "Ви тут" on mobile */
  .eau-here-bar {
    display: none !important;
  }

  .eau-doc-layout {
    grid-template-columns: 1fr;
  }

  .eau-toc-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 72px;
    z-index: 45;
    margin: 0 0 1rem;
    width: 100%;
    min-height: 44px;
  }

  .eau-toc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.45);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  .eau-page.eau-toc-open-active .eau-toc-backdrop {
    display: block;
  }

  .eau-toc-panel {
    position: fixed;
    z-index: 1101;
    inset: 0 auto 0 0;
    width: min(340px, 90vw);
    max-height: none;
    height: 100%;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
    padding: 0.75rem 0.75rem 1rem;
    visibility: hidden;
    pointer-events: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .eau-page.eau-toc-open-active .eau-toc-panel {
    transform: translateX(0);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.22);
    visibility: visible;
    pointer-events: auto;
  }

  .eau-page.eau-toc-open-active .eau-toc-open {
    visibility: hidden;
  }

  .eau-toc-sticky {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f7f5f1;
    padding: 0.15rem 0 0.75rem;
    margin: 0 0 0.5rem;
    border-bottom: 1px solid rgba(20, 30, 40, 0.1);
  }

  .eau-toc-panel-head {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: transparent;
    padding: 0;
    margin: 0 0 0.5rem;
    border-bottom: 0;
  }

  .eau-toc-chat {
    font-size: 0.82rem;
    min-height: 44px;
    padding: 0.65rem 0.7rem;
  }

  .eau-toc-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(20, 30, 40, 0.15);
    border-radius: 8px;
    background: #fff;
    font-size: 1.85rem;
    line-height: 1;
    cursor: pointer;
    color: #111;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .eau-toc-close:hover,
  .eau-toc-close:focus-visible,
  .eau-toc-close:active {
    background: #eee;
  }
}

@media print {
  .eau-toc-panel,
  .eau-toc-open,
  .eau-pdf-card,
  .eau-nlm-card,
  .eau-here-bar,
  .eau-toolbar,
  .hero-buttons,
  .at-related,
  .cta-block,
  .breadcrumbs {
    display: none !important;
  }

  .eau-doc-layout {
    display: block;
  }

  .eau-doc {
    border: 0;
    padding: 0;
  }
}
