.retention-trigger {
  display: inline-grid;
  min-height: 42px;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  padding: 5px 11px;
  border: 1px solid #d9cbbb;
  border-radius: 12px;
  color: #2e332d;
  background: rgba(255, 253, 249, 0.78);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.retention-trigger > span {
  grid-row: 1 / 3;
  font-size: 17px;
}

.retention-trigger strong,
.retention-trigger small {
  line-height: 1.05;
}

.retention-trigger strong {
  font-size: 11px;
  font-weight: 800;
}

.retention-trigger small {
  color: #7b6e62;
  font-size: 9px;
  font-weight: 750;
}

.retention-trigger:hover,
.retention-trigger.is-goal-reached {
  border-color: #9ba991;
  background: #eef3e9;
}

.mobile-nav__retention {
  width: 100%;
  margin-top: 8px;
}

.retention-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(88vh, 860px);
  padding: 0;
  border: 1px solid #cdbdab;
  border-radius: 24px;
  color: #282c28;
  background: #f8f3e9;
  box-shadow: 0 28px 80px rgba(24, 29, 25, 0.28);
}

.retention-dialog::backdrop {
  background: rgba(20, 25, 22, 0.58);
  backdrop-filter: blur(4px);
}

.retention-dialog__shell {
  max-height: inherit;
  overflow: auto;
  padding: 30px;
}

.retention-dialog__header,
.retention-panel__heading,
.retention-summary,
.retention-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.retention-dialog__header {
  align-items: flex-start;
  margin-bottom: 22px;
}

.retention-dialog__header span,
.retention-panel__heading span {
  color: #8b4b18;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.45px;
}

.retention-dialog__header h2 {
  margin: 5px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: -1.2px;
}

.retention-dialog__header p,
.retention-panel p,
.retention-summary p {
  margin: 0;
  color: #6c675f;
  font-size: 12px;
  line-height: 1.55;
}

.retention-dialog__header > button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid #d7c8b7;
  border-radius: 50%;
  color: #554d45;
  background: #fffdf8;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.retention-summary {
  align-items: stretch;
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: 18px;
  color: #fffaf1;
  background: #253e34;
}

.retention-summary > div {
  flex: 1;
}

.retention-summary > div + div {
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.17);
}

.retention-summary small {
  display: block;
  margin-bottom: 7px;
  color: #d8c6a9;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.3px;
}

.retention-summary strong {
  display: block;
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
}

.retention-summary p {
  color: #cad1cb;
}

.retention-progress {
  height: 6px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.retention-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #e0a85f;
  transition: width 240ms ease;
}

.retention-dialog__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.retention-panel,
.retention-achievements-section {
  padding: 19px;
  border: 1px solid #ddd0c1;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.8);
}

.retention-panel__heading {
  align-items: flex-start;
  margin-bottom: 15px;
}

.retention-panel__heading h3 {
  margin: 3px 0 0;
  font-size: 16px;
}

.retention-panel__heading em {
  padding: 4px 8px;
  border-radius: 99px;
  color: #48604f;
  background: #e7efe7;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.retention-panel label:not(.retention-import) {
  display: grid;
  gap: 6px;
  margin-bottom: 9px;
}

.retention-panel label > span {
  color: #655d54;
  font-size: 10px;
  font-weight: 800;
}

.retention-panel input[type="text"],
.retention-panel input[type="time"] {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #d6c8b8;
  border-radius: 10px;
  color: #2d302d;
  background: #fffdf8;
  font: inherit;
  font-size: 13px;
}

.retention-action,
.retention-inline-actions button,
.retention-import {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #bda995;
  border-radius: 10px;
  color: #3b3935;
  background: #fffdf8;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.retention-action {
  margin-bottom: 10px;
}

.retention-goals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 11px;
}

.retention-goals button {
  display: grid;
  gap: 3px;
  padding: 10px 5px;
  border: 1px solid #d8caba;
  border-radius: 11px;
  color: #394039;
  background: #fffdf8;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.retention-goals button small {
  color: #81766b;
  font-family: inherit;
  font-size: 9px;
  font-weight: 750;
}

.retention-goals button.is-selected {
  border-color: #58705f;
  color: #fff;
  background: #334c40;
}

.retention-goals button.is-selected small {
  color: #dce4dc;
}

.retention-inline-actions {
  justify-content: flex-start;
  gap: 7px;
  margin: 10px 0;
}

.retention-inline-actions button,
.retention-import {
  flex: 1;
}

.retention-import input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.retention-reminder > small {
  display: block;
  color: #786f66;
  font-size: 9px;
  line-height: 1.4;
}

.retention-achievements-section {
  margin-top: 14px;
}

.retention-achievements {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.retention-achievement {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px;
  border: 1px solid #e2d8cc;
  border-radius: 12px;
  opacity: 0.55;
  background: #f7f2ea;
}

.retention-achievement > span {
  display: inline-flex;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #74695e;
  background: #e7ded3;
  font-size: 12px;
  font-weight: 850;
}

.retention-achievement strong,
.retention-achievement small,
.retention-achievement em {
  display: block;
}

.retention-achievement strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.retention-achievement small,
.retention-achievement em {
  color: #756e66;
  font-size: 9px;
  line-height: 1.35;
}

.retention-achievement em {
  margin-top: 4px;
  color: #7f4b22;
  font-style: normal;
  font-weight: 750;
}

.retention-achievement.is-unlocked {
  border-color: #c5aa81;
  opacity: 1;
  background: #fff8e9;
}

.retention-achievement.is-unlocked > span {
  color: #fffaf0;
  background: #9b5b24;
}

.retention-toast {
  position: fixed;
  z-index: 10000;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 13px 17px;
  border: 1px solid #5c7766;
  border-radius: 12px;
  color: #fff;
  background: #29463a;
  box-shadow: 0 16px 42px rgba(23, 31, 26, 0.25);
  font-size: 12px;
  font-weight: 750;
}

.retention-toast[data-tone="achievement"] {
  border-color: #d4a35d;
  background: #74411b;
}

.retention-toast[data-tone="warning"] {
  border-color: #ba755c;
  background: #703827;
}

body.retention-dialog-open {
  overflow: hidden;
}

@media (max-width: 1120px) {
  .retention-trigger strong {
    display: none;
  }

  .retention-trigger {
    grid-template-columns: auto auto;
    grid-template-rows: auto;
  }

  .retention-trigger > span {
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .nav-actions > .retention-trigger {
    display: inline-grid;
  }

  .mobile-nav__retention strong {
    display: block;
  }

  .mobile-nav__retention {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
  }

  .mobile-nav__retention > span {
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  .retention-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 18px;
  }

  .retention-dialog__shell {
    padding: 19px;
  }

  .retention-dialog__header h2 {
    font-size: 29px;
  }

  .retention-summary,
  .retention-dialog__grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .retention-summary > div + div {
    padding-top: 17px;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.17);
    border-left: 0;
  }

  .retention-achievements {
    grid-template-columns: 1fr;
  }

  .retention-toast {
    right: 16px;
    bottom: 16px;
  }
}
