:root.ca-widget-enabled {
  --ca-font-scale: 100%;
  --ca-line-height: 1.00;
  --ca-letter-spacing: 0em;
  --ca-content-scale: 1;
  --ca-widget-primary: #1f5ea8;
  --ca-widget-primary-dark: #0f3f78;
  --ca-widget-surface: #ffffff;
  --ca-widget-card: #edf1f5;
  --ca-widget-border: #dde3ea;
  --ca-widget-text: #0f172a;
  --ca-widget-shadow: rgba(15, 23, 42, 0.2);
}

html.ca-widget-enabled {
  font-size: var(--ca-font-scale);
  line-height: var(--ca-line-height);
  letter-spacing: var(--ca-letter-spacing);
}

html.ca-high-contrast {
  filter: contrast(145%) saturate(120%);
  background: #000 !important;
  color: #fff !important;
}

html.ca-highlight-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 0.15em;
  background: #fff6a0 !important;
  color: #0f172a !important;
}

html.ca-readable-font,
html.ca-readable-font body,
html.ca-readable-font button,
html.ca-readable-font input,
html.ca-readable-font select,
html.ca-readable-font textarea {
  font-family: Verdana, Tahoma, Arial, sans-serif !important;
  letter-spacing: 0.02em;
}

html.ca-align-left body {
  text-align: left;
}

html.ca-align-center body {
  text-align: center;
}

html.ca-align-right body {
  text-align: right;
}

html.ca-hide-images img,
html.ca-hide-images svg,
html.ca-hide-images picture,
html.ca-hide-images video,
html.ca-hide-images canvas {
  visibility: hidden !important;
}

html.ca-highlight-titles h1,
html.ca-highlight-titles h2,
html.ca-highlight-titles h3,
html.ca-highlight-titles h4,
html.ca-highlight-titles h5,
html.ca-highlight-titles h6 {
  background: #fff6a0 !important;
  color: #0b1220 !important;
  box-shadow: inset 0 -3px 0 #eab308;
}

html.ca-widget-enabled body {
  zoom: var(--ca-content-scale);
}

.ca-reading-mask {
  position: fixed;
  left: 0;
  top: -999px;
  width: 100vw;
  height: 140px;
  pointer-events: none;
  opacity: 0;
  z-index: 9998;
  transition: opacity 0.12s ease;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.6) 0%,
    rgba(15, 23, 42, 0.55) 34%,
    rgba(255, 255, 255, 0) 35%,
    rgba(255, 255, 255, 0) 65%,
    rgba(15, 23, 42, 0.55) 66%,
    rgba(15, 23, 42, 0.6) 100%
  );
}

html.ca-reading-mask-active .ca-reading-mask {
  opacity: 1;
}

.ca-text-magnifier {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 10002;
  max-width: min(380px, 84vw);
  padding: 10px 12px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1.3;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.45);
}

.ca-text-magnifier.is-visible {
  display: block;
}

.ca-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.ca-widget--left {
  left: 16px;
  right: auto;
}

.ca-widget--right {
  right: 16px;
  left: auto;
}

.ca-widget__toggle {
  border: 0;
  border-radius: 999px;
  width: 60px;
  height: 60px;
  color: var(--ca-widget-icon, #fff);
  background: linear-gradient(150deg, var(--ca-widget-primary), var(--ca-widget-primary-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--ca-widget-shadow);
}

.ca-widget__icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
}

.ca-widget__icon--glyph {
  font-size: 29px;
  line-height: 1;
  font-weight: 700;
}

.ca-widget__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.ca-widget__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ca-widget__panel {
  width: min(498px, calc(100vw - 24px));
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--ca-widget-border);
  border-radius: 12px;
  background: var(--ca-widget-surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.ca-widget__title {
  margin: 2px 2px 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ca-widget-text);
}

.ca-widget__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ca-card {
  appearance: none;
  border: 1px solid var(--ca-widget-border);
  border-radius: 8px;
  background: var(--ca-widget-card);
  color: var(--ca-widget-text);
  min-height: 86px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.ca-card:hover {
  transform: translateY(-1px);
}

.ca-card[aria-pressed="true"] {
  border-color: var(--ca-widget-primary);
  box-shadow: inset 0 0 0 1px var(--ca-widget-primary);
  background: #d9e8fb;
}

.ca-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 28px;
  line-height: 1;
}

.ca-card__icon--large {
  font-size: 36px;
}

.ca-card__icon--reading-mask {
  width: 40px;
  height: 40px;
  font-size: 36px;
}

.ca-card__label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
}

.ca-card--control {
  cursor: default;
}

.ca-widget__statement {
  appearance: none;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  margin-top: 4px;
  margin-bottom: 4px;
  border: 1px solid var(--ca-widget-border);
  border-radius: 8px;
  background: transparent;
  color: var(--ca-widget-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: background-color 0.12s ease;
}

.ca-widget__statement:hover {
  background-color: var(--ca-widget-card);
}

.ca-stepper {
  width: 100%;
  margin-top: 2px;
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 6px;
}

.ca-stepper__value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.ca-stepper__btn {
  appearance: none;
  border: 1px solid var(--ca-widget-border);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: #111827;
  color: #fff;
  cursor: pointer;
}

.ca-widget__reset {
  appearance: none;
  margin-top: 10px;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--ca-widget-border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ca-widget-text);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

html.ca-modal-open {
  overflow: hidden;
}

.ca-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
}

.ca-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.ca-modal__dialog {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: min(560px, calc(100vw - 24px));
  max-height: min(76vh, 720px);
  overflow: auto;
  border: 1px solid var(--ca-widget-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 40px rgba(15, 23, 42, 0.34);
  padding: 16px;
}

.ca-widget--left .ca-modal__dialog {
  left: 14px;
  right: auto;
}

.ca-modal__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.ca-modal__body {
  font-size: 14px;
  line-height: 1.55;
  color: #111827;
  white-space: pre-line;
}

.ca-modal__close {
  margin-top: 12px;
  appearance: none;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #111827;
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 520px) {
  .ca-widget--right {
    right: 12px;
    bottom: 12px;
  }

  .ca-widget--left {
    left: 12px;
    bottom: 12px;
  }

  .ca-widget__panel {
    width: min(498px, calc(100vw - 16px));
    max-height: min(70vh, 640px);
    overflow: auto;
  }

  .ca-widget__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }



  .ca-modal__dialog {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .ca-widget--left .ca-modal__dialog {
    left: 8px;
    right: auto;
  }

  .ca-widget__toggle {
    width: 56px;
    height: 56px;
  }
}
