/* Cookie consent bar + settings modal (works with or without styles.css) */

.mf-cookie-modal-open { overflow: hidden; }

.mf-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(11, 16, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mf-cookie-modal {
  position: relative;
  width: min(480px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(15, 18, 40, 0.08));
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(31, 38, 90, 0.18);
  color: var(--text-2, #3b4259);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.mf-cookie-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text, #0b1020);
}

.mf-cookie-sub {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.55;
}

.mf-cookie-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3, #6b7388);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mf-cookie-close:hover {
  background: var(--surface-2, #f0f2fa);
  color: var(--text, #0b1020);
}

.cookie {
  position: fixed;
  left: 16px;
  right: auto;
  bottom: calc(16px + var(--bottom-dock-h, 0px) + var(--cookie-gap, 12px));
  width: min(360px, calc(100vw - 32px));
  max-width: 360px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(15, 18, 40, 0.08));
  border-radius: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(31, 38, 90, 0.12);
  z-index: 1000;
  font-size: 13px;
  color: var(--text-2, #3b4259);
  font-weight: 400;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  transition: transform 0.35s ease, opacity 0.35s ease, bottom 0.35s ease;
}

.cookie-text {
  margin: 0;
  line-height: 1.55;
}

.cookie-text a {
  color: var(--accent, #6366f1);
  text-decoration: underline;
}

.cookie-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-bar-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
}

.cookie.hidden {
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

.cookie-prefs {
  display: flex;
  flex-direction: column;
  margin: 16px 0 22px;
  width: 100%;
  box-sizing: border-box;
}

.cookie-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 0;
  border-top: 1px solid var(--border, rgba(15, 18, 40, 0.08));
}

.cookie-row:first-child {
  border-top: none;
  padding-top: 8px;
}

.cookie-info {
  flex: 1;
  min-width: 0;
}

.cookie-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #0b1020);
  margin-bottom: 4px;
}

.cookie-desc {
  font-size: 12.5px;
  font-weight: 300;
  color: var(--text-3, #6b7388);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch span {
  position: absolute;
  inset: 0;
  background: var(--border-strong, rgba(15, 18, 40, 0.16));
  border-radius: 999px;
  transition: background 0.2s;
}

.switch span::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.switch input:checked + span {
  background: var(--accent, #6366f1);
}

.switch input:checked + span::before {
  transform: translateX(18px);
}

.switch.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cookie .btn,
.mf-cookie-modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.cookie .btn-primary,
.mf-cookie-modal .btn-primary {
  background: var(--accent, #6366f1);
  color: #fff;
}

.cookie .btn-ghost,
.mf-cookie-modal .btn-ghost {
  background: transparent;
  color: var(--text-2, #3b4259);
  border-color: var(--border, rgba(15, 18, 40, 0.08));
}

.cookie .btn-sm,
.mf-cookie-modal .btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.legal-footer-min {
  padding: 24px 16px 32px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3, #6b7388);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.legal-footer-min a {
  color: var(--text-3, #6b7388);
  text-decoration: none;
}

.legal-footer-min a:hover {
  color: var(--accent, #6366f1);
}
