/* Shared kit of the public pages (#1105): consent banner and settings dialog. Self-contained, so it looks the
   same on the landing and on /akty. The banner never takes part in the page flow (it is fixed), so it never shifts the
   content: a bottom sheet on a phone, a card in the corner on a wider screen. */
.lexkit-consent,
.lexkit-dialog {
  --lexkit-ink: #17202a;
  --lexkit-muted: #4a5563;
  --lexkit-line: #d5dbe3;
  --lexkit-paper: #ffffff;
  --lexkit-focus: #1d4ed8;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--lexkit-ink);
}

.lexkit-consent {
  /* Phone: a bottom sheet across the whole width. Above the BETA badge and other fixed elements of the pages. */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  box-sizing: border-box;
  width: 100%;
  max-height: 50vh;
  max-height: 50dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--lexkit-paper);
  border-top: 1px solid var(--lexkit-line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.14);
}

.lexkit-consent__title {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.3;
}

.lexkit-consent__text {
  margin: 0 0 12px;
  color: var(--lexkit-muted);
}

.lexkit-consent a,
.lexkit-dialog a {
  color: inherit;
  text-decoration: underline;
}

.lexkit-consent__actions,
.lexkit-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Accept and reject look the same: neither is the easier choice. */
.lexkit-btn {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--lexkit-ink);
  border-radius: 8px;
  background: var(--lexkit-paper);
  color: var(--lexkit-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lexkit-btn:hover {
  background: #f1f4f8;
}

.lexkit-link {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--lexkit-ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.lexkit-btn:focus-visible,
.lexkit-link:focus-visible,
.lexkit-dialog input:focus-visible,
.lexkit-consent a:focus-visible,
.lexkit-dialog a:focus-visible {
  outline: 3px solid var(--lexkit-focus);
  outline-offset: 2px;
}

.lexkit-dialog {
  box-sizing: border-box;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--lexkit-line);
  border-radius: 12px;
  background: var(--lexkit-paper);
}

.lexkit-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.lexkit-dialog__form {
  padding: 20px;
}

.lexkit-dialog h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.lexkit-dialog__categories {
  margin: 16px 0;
  padding: 0;
  border: 0;
}

.lexkit-dialog__categories legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.lexkit-category {
  padding: 12px 0;
  border-top: 1px solid var(--lexkit-line);
}

.lexkit-category__label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.lexkit-category__label input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.lexkit-category__description {
  margin: 4px 0 0 30px;
  color: var(--lexkit-muted);
}

/* Wider screens: a card in the corner, narrow enough to leave the text readable. */
@media (min-width: 769px) {
  .lexkit-consent {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-width: 440px;
    max-height: none;
    overflow: visible;
    padding: 16px;
    border: 1px solid var(--lexkit-line);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.18);
  }
}

@media print {
  .lexkit-consent { display: none; }
}

/* "Udostępnij" button (share.js, #1117): the same look on the landing, /cennik, /akty and the shared conversation. */
.lexkit-share {
  --lexkit-ink: #17202a;
  --lexkit-muted: #4a5563;
  --lexkit-line: #d5dbe3;
  --lexkit-paper: #ffffff;
  --lexkit-focus: #1d4ed8;
  position: relative;
  display: inline-block;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--lexkit-ink);
}

.lexkit-share__button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--lexkit-ink);
  border-radius: 8px;
  background: var(--lexkit-paper);
  color: var(--lexkit-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lexkit-share__button:hover,
.lexkit-share__item:hover {
  background: #f1f4f8;
}

.lexkit-share__icon {
  display: inline-flex;
}

.lexkit-share__live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.lexkit-share__menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--lexkit-line);
  border-radius: 10px;
  background: var(--lexkit-paper);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.18);
}

.lexkit-share__menu[hidden] {
  display: none;
}

.lexkit-share__item {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--lexkit-ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.lexkit-share__fallback {
  padding: 6px;
}

.lexkit-share__field {
  box-sizing: border-box;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--lexkit-line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}

.lexkit-share__error {
  margin: 6px 0 0;
  color: #b91c1c;
  font-size: 13px;
}

.lexkit-share__button:focus-visible,
.lexkit-share__item:focus-visible,
.lexkit-share__field:focus-visible {
  outline: 3px solid var(--lexkit-focus);
  outline-offset: 2px;
}

@media print {
  .lexkit-share { display: none; }
}
