.cookie-consent-root {
  position: fixed;
  inset: auto 24px 24px;
  z-index: 1000;
  max-width: 520px;
}

.cookie-consent-banner {
  background: var(--cookie-banner-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px var(--shadow-color);
  padding: 24px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.cookie-consent-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.3;
}

.cookie-consent-copy {
  font-size: 14px;
  line-height: 1.65;
  color: var(--copy-soft);
}

.cookie-consent-copy a,
.cookie-consent-copy a:visited {
  color: var(--teal-text, var(--accent));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.cookie-consent-btn {
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cookie-consent-btn:hover,
.cookie-consent-btn:focus-visible {
  background: var(--surface-hover);
  border-color: var(--border-strong-hover);
}

/* Keyboard focus: a 2px ring 2px off the button in the text teal (--teal-text: 5.7:1 on the light
   banner and dialog, 5.0:1 on the dark ones), so it shows on every button fill, the teal one too. */
.cookie-consent-btn:focus-visible,
.cookie-consent-close:focus-visible {
  outline: 2px solid var(--teal-text, var(--accent));
  outline-offset: 2px;
}

.cookie-consent-btn-primary {
  background: var(--cookie-primary-bg);
  color: var(--cookie-primary-text);
  border-color: var(--cookie-primary-bg);
}

.cookie-consent-btn-primary:hover,
.cookie-consent-btn-primary:focus-visible {
  background: var(--cookie-primary-hover-bg);
  border-color: var(--cookie-primary-hover-bg);
  color: var(--cookie-primary-text);
}

.cookie-consent-btn-strong {
  background: var(--cookie-strong-bg);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.cookie-consent-btn-strong:hover,
.cookie-consent-btn-strong:focus-visible {
  background: var(--cookie-strong-hover-bg);
  border-color: var(--border-strong-hover);
  color: var(--text-primary);
}

.cookie-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
}

.cookie-consent-modal.is-open {
  display: block;
}

.cookie-consent-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-scrim);
}

.cookie-consent-dialog {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 16px auto;
  background: var(--cookie-dialog-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 24px 80px var(--shadow-color);
  padding: 28px;
}

.cookie-consent-dialog h2 {
  font-size: 26px;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.cookie-consent-dialog > p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--copy-soft);
}

/* Heading and close button on one row. These rules lived in assets/site-a11y.css, which no page
   has loaded since the redesign, so the button fell back to the browser's default look. */
.cookie-consent-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.cookie-consent-dialog-header h2 {
  margin: 0;
  flex: 1;
}

.cookie-consent-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cookie-consent-close:hover,
.cookie-consent-close:focus-visible {
  background: var(--surface-hover);
}

.cookie-consent-categories {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.cookie-consent-category {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--cookie-category-bg);
  padding: 18px;
}

.cookie-consent-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.cookie-consent-category h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.cookie-consent-category p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-label);
}

.cookie-consent-signal-note {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--cookie-signal-border);
  border-radius: 10px;
  background: var(--cookie-signal-bg);
  color: var(--copy-soft);
  font-size: 13px;
  line-height: 1.6;
}

.cookie-consent-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.cookie-consent-switch input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.cookie-consent-fixed-note {
  font-size: 12px;
  color: var(--text-label);
}

.cookie-consent-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.cookie-consent-inventory {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.12));
}

.cookie-consent-inventory h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.cookie-consent-inventory > p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-label);
}

.cookie-consent-inventory-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
}

.cookie-consent-inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cookie-consent-inventory-table th,
.cookie-consent-inventory-table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}

.cookie-consent-inventory-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface, #fff);
  font-weight: 600;
  color: var(--text-label);
  white-space: nowrap;
}

.cookie-consent-inventory-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 768px) {
  .cookie-consent-root {
    inset: auto 16px 16px;
    max-width: none;
  }

  .cookie-consent-banner,
  .cookie-consent-dialog {
    padding: 20px;
  }

  .cookie-consent-actions,
  .cookie-consent-dialog-actions {
    flex-direction: column;
  }

  .cookie-consent-btn {
    width: 100%;
  }

  .cookie-consent-category-header {
    align-items: start;
    flex-direction: column;
  }

}
