/* Bilingual exercises, conversation turns and copyable mail templates. */
.article-body .learn-dialogue {
  --learn-dialogue-paper: #f5f8fc;
  --learn-dialogue-other: #fff;
  --learn-dialogue-own: #e6f0ff;
  --learn-dialogue-ink: #172f49;
  --learn-dialogue-muted: #40566d;
  --learn-dialogue-border: #b7c8da;
  margin: 20px 0 28px;
  padding: clamp(14px, 3vw, 26px);
  background: var(--learn-dialogue-paper);
  border: 1px solid var(--learn-dialogue-border);
  border-radius: 18px;
  min-width: 0;
}
:root[data-theme="dark"] body .article-body .learn-dialogue {
  --learn-dialogue-paper: #101b2c;
  --learn-dialogue-other: #1d2b40;
  --learn-dialogue-own: #193958;
  --learn-dialogue-ink: #edf5ff;
  --learn-dialogue-muted: #c1d0e0;
  --learn-dialogue-border: #425b74;
}
.learn-dialogue-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 20px;
}
.learn-dialogue-toolbar:empty { display: none; }
.article-body .learn-dialogue-turns {
  display: grid;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.article-body .learn-dialogue-turn {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  justify-self: start;
  max-width: min(91%, 600px);
  margin: 0;
  padding: 0;
  min-width: 0;
}
.article-body .learn-dialogue-turn.is-own {
  grid-template-columns: minmax(0, 1fr) 39px;
  justify-self: end;
}
.learn-dialogue-turn.is-own .learn-dialogue-avatar { grid-column: 2; grid-row: 1; }
.learn-dialogue-turn.is-own .learn-dialogue-message { grid-column: 1; grid-row: 1; }
.learn-dialogue-turn.is-own .learn-dialogue-role { text-align: right; }
.learn-dialogue-avatar {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dce5ef;
  color: #233f5c;
}
.learn-dialogue-avatar svg { width: 23px; height: 23px; }
.learn-dialogue-turn.is-own .learn-dialogue-avatar {
  background: #0b57ab;
  color: #fff;
}
:root[data-theme="dark"] body .learn-dialogue-avatar { background: #38536a; color: #f2f7ff; }
:root[data-theme="dark"] body .learn-dialogue-turn.is-own .learn-dialogue-avatar { background: #2769b0; color: #fff; }
.learn-dialogue-message { min-width: 0; }
.learn-dialogue-role {
  display: block;
  margin: 0 5px 5px;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1.4;
  color: var(--learn-dialogue-muted);
}
.learn-dialogue-bubble {
  border: 1px solid var(--learn-dialogue-border);
  border-radius: 14px 14px 14px 4px;
  background: var(--learn-dialogue-other);
  padding: 12px 15px;
  overflow-wrap: anywhere;
}
.learn-dialogue-turn.is-own .learn-dialogue-bubble {
  border-radius: 14px 14px 4px 14px;
  background: var(--learn-dialogue-own);
}
.article-body .learn-dialogue-german,
:root[data-theme="dark"] body .article-body .learn-dialogue-german {
  color: var(--learn-dialogue-ink);
  font-size: clamp(1.02rem, 2vw, 1.14rem);
  font-weight: 650;
  line-height: 1.55;
  margin: 0;
}
.article-body .learn-dialogue-japanese,
:root[data-theme="dark"] body .article-body .learn-dialogue-japanese {
  font-size: .91rem;
  line-height: 1.6;
  margin: 8px 0 0;
  color: var(--learn-dialogue-muted);
}
.learn-dialogue [hidden] { display: none !important; }
.learn-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  margin-top: 6px;
}
.learn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 36px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #9db1c7;
  border-radius: 8px;
  background: #fff;
  color: #164b80;
  font: inherit;
  font-size: .79rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  white-space: normal;
  text-align: left;
  transition: background-color .15s, border-color .15s;
}
.learn-action svg { width: 17px; height: 17px; flex: none; }
.learn-action--icon { padding: 5px; }
.learn-action:hover, .learn-action[aria-pressed="true"] { background: #dcecff; border-color: #467fbd; }
.learn-action:focus-visible { outline: 3px solid #0865b8; outline-offset: 3px; }
:root[data-theme="dark"] body .learn-action { background: #23344b; color: #d3eaff; border-color: #64819f; }
:root[data-theme="dark"] body .learn-action:hover,
:root[data-theme="dark"] body .learn-action[aria-pressed="true"] { background: #315a82; }
:root[data-theme="dark"] body .learn-action:focus-visible { outline-color: #a7d6ff; }
.learn-phrase-table .learn-de-text { display: block; font-size: 1.01rem; font-weight: 650; line-height: 1.6; overflow-wrap: anywhere; }
.article-body .jc-info-table.learn-phrase-table { min-width: 0; }
.article-body .learn-phrase-table th,
.article-body .learn-phrase-table td { min-width: 0; }
.learn-phrase-table td.learn-translation-cell { line-height: 1.6; }
.article-body .learn-mail-template {
  position: relative;
  border: 1px solid var(--jc-line);
  border-left: 4px solid var(--jc-blue);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-wrap: anywhere;
}
.article-body .learn-mail-template p { margin: 0; }
.article-body .learn-mail-template .learn-inline-actions { margin-top: 12px; }
.learn-action-status {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 45;
  max-width: min(calc(100vw - 24px), 320px);
  padding: 9px 14px;
  color: #fff;
  background: #163853;
  border: 1px solid #527696;
  border-radius: 9px;
  box-shadow: 0 4px 18px #16283a33;
  font-size: .84rem;
}
.learn-action-status:empty { display: none; }
@media (max-width: 640px) {
  .article-body .learn-dialogue { margin: 16px 0 22px; padding: 13px 10px; border-radius: 14px; }
  .learn-dialogue-toolbar { justify-content: flex-start; margin-bottom: 17px; }
  .article-body .learn-dialogue-turns { gap: 17px; }
  .article-body .learn-dialogue-turn { max-width: 97%; grid-template-columns: 31px minmax(0, 1fr); gap: 7px; }
  .article-body .learn-dialogue-turn.is-own { grid-template-columns: minmax(0, 1fr) 31px; }
  .learn-dialogue-avatar { width: 31px; height: 31px; }
  .learn-dialogue-avatar svg { width: 19px; height: 19px; }
  .learn-dialogue-bubble { padding: 10px 12px; }
  .learn-action { min-height: 40px; min-width: 40px; }
  .learn-phrase-table td.learn-de-cell, .learn-phrase-table td.learn-translation-cell { padding: 11px 12px; }
  .learn-phrase-table td.learn-de-cell::before, .learn-phrase-table td.learn-translation-cell::before { display: none; }
  .learn-phrase-table td.learn-de-cell:first-child { font-weight: 650; background: transparent; }
}

/* The playback rate is shared by the page and each conversation toolbar. */
.learn-playback-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin: 0 0 22px;
  padding: 10px 13px;
  border: 1px solid #b7c8da;
  border-radius: 10px;
  background: #edf5fd;
  color: #233f5c;
}
.learn-playback-speed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1.4;
  min-width: 0;
  white-space: nowrap;
}
.learn-playback-speed input[type="range"] {
  width: 116px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  accent-color: #14528b;
}
.learn-playback-speed output {
  min-width: 3.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.learn-playback-note { font-size: .79rem; font-weight: 500; line-height: 1.5; }
.learn-dialogue-toolbar .learn-playback-speed { color: var(--learn-dialogue-muted); }
.learn-spoken-example {
  margin: 7px 0 0;
  font-size: .79rem;
  color: #315a82;
  overflow-wrap: anywhere;
}
.learn-spoken-example summary { width: fit-content; cursor: pointer; font-weight: 700; }
.article-body .learn-spoken-example p {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #edf5fd;
  font-size: .86rem;
  color: #233f5c;
  line-height: 1.5;
}
:root[data-theme="dark"] body .learn-playback-settings,
:root[data-theme="dark"] body .article-body .learn-spoken-example p {
  background: #193958;
  color: #dceaff;
  border-color: #425b74;
}
:root[data-theme="dark"] body .learn-spoken-example { color: #a7d6ff; }
:root[data-theme="dark"] body .learn-playback-speed input[type="range"] { accent-color: #80b9ff; }
@media (max-width: 520px) {
  .learn-dialogue-toolbar .learn-playback-speed { flex-basis: 100%; justify-content: center; }
  .learn-playback-settings { padding: 9px 11px; }
  .learn-playback-speed input[type="range"] { width: 128px; min-height: 44px; }
}
.learn-spoken-example > .learn-action { margin-top: 6px; }
