/* Course onboarding, settings and a shared conversation menu for every viewport. */
.current-course {
  color: var(--muted);
  font-size: 14px;
}
.mode-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.home-conversations {
  margin-top: 28px;
}
.home-conversations .section-heading {
  gap: 12px;
  align-items: center;
}
.home-scenarios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
/* Desktop shows the five featured situations; phones list them all behind "Ver mais situações". */
.home-extra,
#show-more-home {
  display: none;
}
@media (max-width: 550px) {
  .home-see-all {
    display: none;
  }
  .home-extra {
    display: grid;
  }
  #show-more-home {
    display: flex;
    margin-top: 8px;
  }
  .home-conversations:not(.is-expanded) .home-scenarios {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), rgb(0 0 0 / 35%));
    mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), rgb(0 0 0 / 35%));
  }
  .home-conversations:not(.is-expanded) .home-scenarios > :nth-child(n + 5) {
    display: none;
  }
  .home-conversations.is-expanded #show-more-home {
    display: none;
  }
}
@media (max-width: 380px) {
  .home-conversations:not(.is-expanded) .home-scenarios > :nth-child(n + 3) {
    display: none;
  }
}
#settings-dialog select {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
  height: 44px;
  padding: 8px 10px;
  font-size: 16px;
}
#settings-dialog,
#course-onboarding {
  width: 480px;
  max-width: calc(100vw - 24px);
}
.course-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border: 0;
  padding: 8px 0;
  margin: 14px 0;
}
.course-choices label {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
}
.course-choices input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  margin: 0;
  accent-color: var(--navy);
}
.course-choices span {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.course-choices label:has(input:checked) {
  border-color: var(--gold);
  background: #fff8e8;
}
.course-choices label:has(input:focus-visible) {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
#course-onboarding .text-button {
  display: block;
  margin: 16px auto 0;
}
#conversation-menu {
  width: 880px;
  max-width: calc(100vw - 24px);
  max-height: calc(var(--chat-height, 100dvh) - 32px);
  padding: 0;
  overflow: hidden;
}
#conversation-menu[open] {
  display: flex;
  flex-direction: column;
}
.conversation-menu-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 12px;
  border-bottom: 1px solid var(--line);
}
.conversation-menu-heading p,
.conversation-menu-heading h2 {
  margin: 0 0 8px;
}
#close-conversation-menu {
  border: 0;
  border-radius: 10px;
  background: var(--paper);
  color: var(--navy);
  min-width: 44px;
  min-height: 44px;
}
.conversation-options {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  padding: 18px 24px 24px;
}
.conversation-options h3 {
  font-size: 15px;
  margin: 22px 0 12px;
}
/* Free conversation is the main option: a light brand-blue tint with a navy icon, calmer than a solid block. */
.free-conversation {
  width: 100%;
  background: #eef2fb;
  border-color: #c9d4ef;
}
.free-conversation:hover {
  background: #e5ebf9;
  border-color: #b3c1e6;
}
.free-conversation .situation-icon {
  background: #fff1cc;
  color: #a8731a;
}
#conversation-menu .situation-option[hidden] {
  display: none;
}
/* While collapsed, the last row fades out to hint that more situations follow. */
#conversation-menu .situation-grid.is-collapsed {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), rgb(0 0 0 / 35%));
  mask-image: linear-gradient(to bottom, #000 calc(100% - 70px), rgb(0 0 0 / 35%));
}
.show-more-situations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  border: 1px solid #e6e9f2;
  border-radius: 12px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
}
.show-more-situations svg {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
  animation: hint-down 1.6s ease-in-out 2;
}
@keyframes hint-down {
  50% {
    transform: rotate(90deg) translateX(3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .show-more-situations svg {
    animation: none;
  }
}
.show-more-situations:hover {
  border-color: #c9cedf;
  background: #f7f8fc;
}
.show-more-situations[hidden] {
  display: none;
}
/* Phones: real situations two per row, icon above the title; free conversation keeps the full row. */
@media (max-width: 550px) {
  #conversation-menu .situation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #conversation-menu .situation-grid .situation-option {
    grid-template-columns: 1fr;
    row-gap: 6px;
    min-height: 0;
    padding: 12px;
  }
  #conversation-menu .situation-grid .situation-option strong {
    font-size: 13px;
  }
  #conversation-menu .situation-grid .situation-option > span:not(.situation-icon) {
    margin-top: 0;
    font-size: 11px;
    line-height: 1.4;
  }
}
#request-new-link {
  margin-bottom: 12px;
}
@media (max-width: 1100px) {
  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 850px), (max-height: 620px) {
  .current-course {
    display: none;
  }
  .home-scenarios {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #conversation-menu {
    max-height: calc(var(--chat-height, 100dvh) - 24px - var(--safe-top) - var(--safe-bottom));
  }
  .conversation-menu-heading {
    padding: 16px 18px 8px;
  }
  .conversation-options {
    padding: 14px 18px 18px;
  }
}
@media (max-width: 380px) {
  .course-choices {
    grid-template-columns: 1fr;
  }
  .home-scenarios,
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .home-conversations .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

#settings-dialog {
  max-height: calc(100dvh - 24px - var(--safe-top, 0px) - var(--safe-bottom, 0px));
  overflow: hidden;
}
#settings-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 104px - var(--safe-top, 0px) - var(--safe-bottom, 0px));
}
#settings-form > * {
  flex-shrink: 0;
}
#settings-form .settings-fields {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex-shrink: 1;
  padding: 4px;
}
.settings-fields label {
  display: block;
  margin-top: 12px;
}
#settings-status:empty {
  display: none;
}
#settings-dialog .dialog-close {
  min-width: 44px;
  min-height: 44px;
}
#settings-save {
  min-height: 48px;
}
@media (max-height: 500px) {
  #settings-dialog {
    padding: 16px 20px;
  }
  #settings-form {
    max-height: calc(100dvh - 72px);
  }
  #settings-form > .eyebrow {
    display: none;
  }
  #settings-title {
    margin: 0 40px 12px 0;
  }
}
@media (max-height: 500px) and (min-width: 600px) {
  #settings-dialog {
    width: 600px;
  }
  #settings-form .settings-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 12px;
  }
  .settings-fields label {
    grid-row: 1;
  }
  #settings-dialog select {
    grid-row: 2;
  }
  .settings-fields > p:not(#model-settings-note) {
    display: none;
  }
  #model-settings-note {
    grid-column: 1 / -1;
  }
}

/* ---------- Settings: one window with tabs (each tab is its own dialog) ---------- */
.config-dialog {
  width: 640px;
  max-width: calc(100vw - 24px);
  min-height: min(470px, calc(100dvh - 24px));
  box-sizing: border-box;
}
.config-dialog.config-switch[open],
.config-dialog.config-switch[open]::backdrop {
  animation: none;
}
.config-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: -8px 52px 22px 0;
  padding: 4px;
  background: #eef1f8;
  border-radius: 12px;
}
.config-tabs::-webkit-scrollbar {
  display: none;
}
.config-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.config-tab:hover {
  background: #ffffffa8;
}
.config-tab[aria-current='page'] {
  background: white;
  color: var(--navy);
  box-shadow: 0 1px 4px #1c244b1f;
}
.config-tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
#settings-dialog #settings-form {
  max-height: calc(100dvh - 160px - var(--safe-top, 0px) - var(--safe-bottom, 0px));
}
.config-text {
  margin: 10px 0 18px;
  line-height: 1.6;
}
.config-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}
.support-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.support-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.support-list span {
  min-width: 80px;
  color: var(--muted);
}
.support-list a {
  color: var(--navy);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.config-link {
  margin: 0 0 14px;
  padding: 0;
}
/* "Em breve": orange tag for anything that still needs the server. */
.soon-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff0e2;
  color: #b4560b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: 1px;
  white-space: nowrap;
}
.settings-fields select:disabled {
  opacity: 0.6;
}
/* Active subscription shows in green. */
#account-dialog .status-ok {
  color: #2f8a5f;
  font-weight: 700;
}
@media (max-width: 550px) {
  .config-tabs {
    margin: -4px 48px 18px 0;
  }
}
/* Every settings tab is the same window: fixed size, tabs in one row, compact content. */
.config-dialog,
#settings-dialog.config-dialog,
#account-dialog.config-dialog {
  width: 680px;
  height: min(600px, calc(100dvh - 24px));
  min-height: 0;
  padding: 28px 32px;
  overflow-y: auto;
}
.config-dialog[open] {
  display: flex;
  flex-direction: column;
}
.config-dialog .config-tabs {
  flex-wrap: nowrap;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin: -4px 48px 18px 0;
}
.config-dialog .config-tabs::-webkit-scrollbar {
  display: none;
}
.config-dialog .config-tab {
  padding: 6px 9px;
  font-size: 12px;
}
.config-dialog .eyebrow {
  margin: 0;
}
.config-dialog h2 {
  margin: 4px 0 12px;
  font-size: 22px;
}
.config-dialog .profile-details {
  gap: 10px 20px;
  margin: 8px 0 10px;
}
.config-dialog .profile-actions {
  margin-top: auto;
}
#settings-dialog #settings-form {
  flex: 1;
  min-height: 0;
  max-height: none;
}
#settings-form #settings-save {
  margin-top: auto;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  align-content: start;
}
.settings-grid .settings-field label,
.settings-grid .settings-field .settings-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--blue);
}
/* Provisional admin tool: frees this week's review for testing. */
.settings-grid .settings-field.settings-wide {
  grid-column: 1 / -1;
  margin-top: 8px;
}
#reset-review {
  width: fit-content;
  font-size: 13px;
}
.settings-grid select {
  width: 100%;
  min-height: 40px;
  height: 40px;
  font-size: 14px;
}
.settings-note {
  grid-column: 1 / -1;
  margin: 2px 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.settings-note:empty {
  display: none;
}
@media (max-width: 550px) {
  .config-dialog,
  #settings-dialog.config-dialog,
  #account-dialog.config-dialog {
    height: min(680px, calc(100dvh - 24px));
    padding: 22px 18px;
  }
  .config-dialog .config-tabs {
    flex-wrap: wrap;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-grid select {
    font-size: 16px;
  }
}
/* Brand and copyright line at the foot of "Minha conta" (moved from the sidebar). */
.config-legal {
  flex-shrink: 0;
  margin: 14px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.config-legal strong {
  color: var(--navy);
}
.config-dialog .profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.config-dialog .profile-actions > * {
  width: 100%;
  margin: 0;
}
#account-dialog .config-link {
  margin-bottom: 6px;
}

/* "Minha conta": an identity card, then subscription and access side by side. */
.account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f8fc;
}
.account-card-avatar {
  flex: 0 0 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 14px;
  font-weight: 700;
}
.account-card-id {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.account-card-id strong {
  font-size: 16px;
  color: var(--navy);
}
.account-card-id span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}
.account-pill {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e9edf8;
  color: #354d83;
  font-size: 11px;
  font-weight: 700;
}
.account-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.account-box {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.account-box h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.account-box dl {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
}
.account-box dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.account-box dt {
  color: var(--muted);
}
.account-box dd {
  margin: 0;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
}
.account-box .config-link {
  margin: auto 0 0;
  align-self: flex-start;
  font-size: 12px;
}
#account-dialog .status-warn {
  color: #b4560b;
}
#account-dialog #account-status:empty {
  display: none;
}
@media (max-width: 550px) {
  .account-boxes {
    grid-template-columns: 1fr;
  }
}
.account-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.account-box-head h3 {
  margin: 0;
}
#account-dialog .account-box-head .config-link {
  width: auto;
  margin: 0;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
}
.account-box dl {
  margin: 0;
}
.config-dialog #account-status {
  margin: 10px 0 0;
}
@media (max-width: 550px) {
  .account-card,
  .account-box {
    padding: 11px 14px;
  }
  .account-boxes {
    gap: 10px;
    margin-top: 10px;
  }
}
#account-dialog .account-box-head .config-link {
  min-height: 0;
  height: auto;
  line-height: 1.2;
}
.account-box-head {
  min-height: 24px;
}

/* Account actions: light buttons right below the boxes, with the legal line kept at the foot. */
.config-dialog .profile-actions {
  margin-top: 16px;
}
#account-dialog .profile-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: white;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
#account-dialog .profile-actions button:hover {
  border-color: #c9cedf;
  background: #f7f8fc;
}
#account-dialog .config-legal {
  margin-top: auto;
  padding-top: 14px;
}

/* Library and administration content inside their tabs. */
.config-rows {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.config-row {
  display: grid;
  gap: 3px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.config-row strong {
  font-size: 14px;
  color: var(--navy);
}
.config-row small {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.config-rows[aria-busy='true']::before {
  content: 'Carregando…';
  font-size: 13px;
  color: var(--muted);
}

/* Course flag next to the course name: Germany for German, United Kingdom for English. */
.current-course,
.mobile-course-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mobile-course-line {
  gap: 5px;
}
.course-flag {
  flex: 0 0 auto;
  width: 22px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #1c244b1f;
}
.mobile-course-line .course-flag {
  width: 15px;
  height: 10px;
}
body:not([data-course='en']) .flag-en,
body[data-course='en'] .flag-de {
  display: none;
}
.mobile-brand .mobile-course-line {
  display: flex;
  gap: 5px;
}
.mobile-course-line .course-flag {
  margin-right: 1px;
}
/* The course shows once, with its flag, at the top right; the brand keeps just "Método EA". */
.mobile-brand .mobile-course-line {
  display: none;
}
@media (max-width: 850px), (max-height: 620px) {
  .current-course {
    display: inline-flex;
    margin-left: auto;
    font-size: 13px;
  }
}

/* Settings remain usable with touch, including the e-mail confirmation action. */
@media (max-width: 850px), (max-height: 620px) {
  .config-dialog .config-tab,
  #account-dialog .account-box-head .config-link,
  #account-dialog .profile-actions button {
    min-height: 44px;
  }
}

/* Signed-out visitors see a red "Fazer login" where the course flag sits, so it is clear they are offline. */
.topbar-login {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #c62828;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.topbar-login:hover {
  text-decoration: underline;
}
.signed-out .topbar-login {
  display: inline-flex;
}
.signed-out .current-course {
  display: none !important;
}

/* Goethe level picker: a way back to the list of exams. */
.situation-welcome .exam-back {
  justify-self: start;
  margin: 0 0 12px;
}

/* Study plan: questionnaire, week progress, AI focus and the day-by-day routine. */
/* The "Ajustar plano" button sits on the title's own line, centred on it. */
#plan-view .page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
}
#plan-view .page-heading > div {
  display: contents;
}
#plan-view .page-heading .eyebrow,
#plan-subtitle {
  grid-column: 1 / -1;
}
#plan-view .page-heading .eyebrow {
  margin: 0 0 4px;
}
#plan-view .page-heading h1 {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
}
/* The subtitle reads as the title's caption: right under it, a touch larger than the default. */
#plan-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
}
#plan-view .page-heading {
  margin-bottom: 20px;
}
#plan-edit {
  grid-column: 2;
  grid-row: 2;
  white-space: nowrap;
}
.plan-status:empty {
  display: none;
}
.plan-status {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
  background: #fff8e8;
  color: var(--navy);
  font-size: 13px;
}
.plan-form {
  display: grid;
  gap: 8px;
  max-width: 760px;
}
.plan-form legend {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
}
.plan-choices {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0;
}
.plan-choices label {
  background: white;
}
.plan-exam {
  display: grid;
  grid-template-columns: max-content minmax(0, 260px);
  justify-content: start;
  align-items: center;
  gap: 10px 14px;
  border: 0;
  padding: 8px 0;
  margin: 0;
}
.plan-exam #plan-level-field {
  display: contents;
}
.plan-exam #plan-level-field[hidden] {
  display: none;
}
.plan-exam label {
  font-size: 13px;
  color: var(--muted);
}
.plan-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  padding: 8px 0 16px;
  margin: 0;
}
.plan-days label {
  position: relative;
}
.plan-days input {
  position: absolute;
  opacity: 0;
}
.plan-days span {
  display: grid;
  place-items: center;
  min-width: 52px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.plan-days input:checked + span {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}
.plan-days input:focus-visible + span {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.plan-form .gold-button {
  justify-self: start;
}
.plan-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px 24px;
  margin-bottom: 16px;
}
.plan-summary > div {
  flex: 1 1 280px;
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-size: 14px;
}
#plan-progress {
  width: 100%;
  height: 10px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #e3e7f1;
  overflow: hidden;
}
#plan-progress::-webkit-progress-bar {
  background: #e3e7f1;
}
#plan-progress::-webkit-progress-value {
  background: var(--gold);
  border-radius: 999px;
}
#plan-progress::-moz-progress-bar {
  background: var(--gold);
}
#plan-countdown {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e9edf8;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}
.plan-review {
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(ellipse at top left, #fff8e8, #fff 70%);
}
.plan-review h2 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--navy);
}
.plan-review > p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.plan-review ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.plan-review li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-size: 13px;
}
.plan-review li p {
  margin: 4px 0 0;
  color: var(--muted);
}
.plan-review .plan-example s {
  color: #b23b3b;
}
.plan-review .plan-example span {
  color: #2f8a5f;
  font-weight: 600;
}
.plan-week {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.plan-day {
  display: grid;
  align-content: start;
  gap: 8px;
}
.plan-day h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.plan-day.today h3 {
  color: var(--navy);
}
.plan-task {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--navy);
  text-align: left;
}
.plan-day.today .plan-task:not(.done) {
  border-color: var(--gold);
}
.plan-task:hover {
  border-color: var(--navy);
}
.plan-task strong {
  display: block;
  font-size: 13px;
}
.plan-task small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.plan-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #c9cfdf;
  border-radius: 50%;
  color: transparent;
}
.plan-check .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}
.plan-task.done .plan-check {
  border-color: #2f8a5f;
  background: #2f8a5f;
  color: white;
}
.plan-task.done strong {
  color: var(--muted);
  text-decoration: line-through;
}
.plan-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.plan-task.done .plan-time {
  color: #2f8a5f;
  font-weight: 600;
}
@media (max-width: 550px) {
  .plan-exam {
    grid-template-columns: 1fr;
  }
}

/* Focus card chips and the error notebook (speech and writing). */
.plan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.plan-chips span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}
.plan-review small {
  color: var(--muted);
  font-size: 12px;
}
.plan-review > .plan-errors-link {
  margin-top: 16px;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}
.plan-errors-link .short {
  display: none;
}
@media (max-width: 600px) {
  .plan-review > .plan-errors-link {
    width: 100%;
  }
  .plan-errors-link .long {
    display: none;
  }
  .plan-errors-link .short {
    display: inline;
  }
}
.navy-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 700;
}
.navy-button:hover {
  background: var(--blue);
}
.plan-notebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.plan-notebook h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 20px;
  letter-spacing: -0.3px;
}
.plan-notebook h3 .icon {
  width: 24px;
  height: 24px;
}
.plan-notebook-list {
  display: grid;
  gap: 10px;
}
.plan-notebook-list > [hidden] {
  display: none;
}
.notebook-more {
  justify-self: center;
  min-height: 40px;
  padding: 0 18px;
}
.plan-notebook-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}
.plan-error {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: white;
  font-size: 13px;
}
.plan-error.repetindo {
  border-left-color: #c0473f;
}
.plan-error.melhorando {
  border-left-color: #6b8cc7;
}
.plan-error.superado {
  border-left-color: #2f8a5f;
  opacity: 0.75;
}
.plan-error > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  color: var(--navy);
}
.plan-error p {
  margin: 4px 0 0;
  color: var(--muted);
}
.plan-error .plan-example s {
  color: #b23b3b;
}
.plan-error .plan-example span {
  color: #2f8a5f;
  font-weight: 600;
}
.plan-error .plan-example small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.3px;
}
.plan-history {
  margin-top: 6px;
}
.plan-history summary {
  width: fit-content;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.plan-history .plan-example {
  padding-left: 10px;
  border-left: 2px solid var(--line);
}
.plan-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff3d6;
  color: #7a5a12;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.plan-error.repetindo .plan-badge {
  background: #fbe4e2;
  color: #9c2f28;
}
.plan-error.melhorando .plan-badge {
  background: #e6edf9;
  color: #34518a;
}
.plan-error.superado .plan-badge {
  background: #e3f3ea;
  color: #2f8a5f;
}
/* The way to practise a mistake stands out in the school's yellow. */
.plan-error .text-button.train-button {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
/* "Aprender com meus erros": what the tool does, and this week's review button. */
.errors-intro {
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(ellipse at top left, #fff8e8, #fff 70%);
}
.errors-intro h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 18px;
}
.errors-intro ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: errors-step;
}
.errors-intro li {
  position: relative;
  padding-left: 36px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  counter-increment: errors-step;
}
.errors-intro li::before {
  content: counter(errors-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}
.errors-intro li strong {
  display: block;
  color: var(--navy);
}
.errors-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 18px;
}
.errors-action p {
  margin: 0;
  color: var(--navy);
  font-size: 13px;
}
.errors-action .gold-button {
  gap: 10px;
  font-size: 13px;
}
@media (max-width: 600px) {
  .errors-action .gold-button {
    width: 100%;
  }
}

/* Minha conta: one block with the person on top and each fact as label over value. */
/* usage-plans.css (loaded later) gives this area its own scroll; the whole window scrolls instead. */
#account-dialog div.account-details-scroll {
  flex: none;
  overflow: visible;
}
.config-dialog .account-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 16px;
}
.config-dialog .account-summary .account-card {
  padding: 0;
  border: 0;
  background: none;
}
.config-dialog .account-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.config-dialog .account-facts > div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}
.config-dialog .account-facts dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.config-dialog .account-facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}
.config-dialog .account-facts .config-link {
  justify-self: start;
  width: auto;
  min-height: 0;
  height: auto;
  margin: 2px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.2;
}
.config-dialog .account-facts .config-link[hidden] {
  display: none;
}
.config-dialog .account-facts dd.status-ok {
  color: #2f8a5f;
}
.config-dialog .account-facts dd.status-warn {
  color: #b4560b;
}
@media (max-width: 550px) {
  .config-dialog .account-summary {
    padding: 12px 14px;
  }
  .config-dialog .account-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
  }
  .config-dialog .account-facts dt {
    letter-spacing: 0.5px;
  }
  .config-dialog .account-facts dd {
    font-size: 14px;
  }
}

/* Settings as an accordion: every window lists the sections, only the current one is open. */
/* One fixed window for every section, admin included: switching never resizes it. */
.config-dialog,
#settings-dialog.config-dialog,
#account-dialog.config-dialog,
#plans-dialog.config-dialog,
#terms-dialog.config-dialog,
#admin-dialog.config-dialog {
  width: min(720px, calc(100vw - 24px));
  height: min(720px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
#settings-form {
  max-height: none;
}
/* Only the whole window scrolls: sections and admin panes keep their natural height. */
.config-dialog > *,
#admin-dialog .admin-panel,
#admin-dialog .admin-detail-scroll,
#settings-form .settings-fields {
  flex-shrink: 0;
}
#settings-form .settings-fields {
  overflow-y: visible;
}
#settings-dialog #settings-form {
  flex: none;
}
.config-acc {
  display: grid;
  flex-shrink: 0;
}
.config-acc-title {
  margin: -4px 48px 10px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
.config-acc-tail {
  margin-top: 18px;
}
.config-acc-tail:empty {
  display: none;
}
.config-dialog .config-acc button.config-acc-head,
#admin-dialog .config-acc button.config-acc-head:not(.dialog-close) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 2px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.config-acc-head[hidden] {
  display: none !important;
}
.config-acc-head .icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  /* rotate (not transform): reduced-motion hover rules reset transform on button icons. */
  rotate: 90deg;
  transition: rotate 0.15s ease;
}
.config-acc-head[aria-expanded='true'] .icon {
  rotate: -90deg;
}
.config-acc-head:hover span,
.config-acc-head:focus-visible span {
  color: var(--blue);
}
.config-acc-head.is-open {
  margin-bottom: 4px;
}
.config-dialog.is-collapsed .config-acc-tail {
  margin-top: 0;
}
.config-dialog.is-collapsed > :not(.config-acc):not(.dialog-close):not(.config-legal) {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .config-acc-head .icon {
    transition: none;
  }
}
#admin-dialog .admin-panel,
#admin-dialog .admin-detail-scroll,
#admin-dialog #admin-plans-panel {
  flex: none;
  min-height: auto;
  overflow: visible;
}
#admin-dialog.config-dialog {
  overflow-y: auto;
}
/* Idioma e voz: Voz da tutora and the admin review tool share a row; selects line up. */
.settings-grid .settings-field {
  align-self: end;
}
#settings-form .settings-note {
  margin: 2px 0 6px;
}
#settings-form #settings-save {
  margin-top: 10px;
}
#reset-review {
  width: 100%;
  min-height: 40px;
  height: 40px;
}
@media (max-width: 550px) {
  #settings-form .settings-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 10px;
  }
  .config-acc-tail {
    margin-top: 12px;
  }
}

/* Planos: the subscription facts, today's usage and the next plans, all in one window. */
#plans-summary .account-facts {
  margin: 0;
  padding: 0;
  border: 0;
}
#plans-dialog .usage-meter {
  margin: 8px 0 0;
}
#plans-dialog #plans-status:empty {
  display: none;
}
#plans-dialog #plans-list:not(:empty) {
  margin-top: 4px;
}
#plans-dialog .plans-note {
  margin: 10px 0 6px;
}
@media (max-width: 550px) {
  #plans-summary .account-facts dd {
    font-size: 14px;
  }
}
/* Today's usage sits inside the subscription block, under the facts. */
#plans-summary .usage-meter {
  margin: 12px 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
#plans-summary .usage-meter-heading strong {
  margin-right: auto;
}
#plans-summary .usage-meter #usage-reset-mine {
  min-height: 0;
  margin: 0;
}
#plans-dialog .plan-option {
  padding: 9px 14px;
}
#plans-summary .usage-meter {
  margin-top: 10px;
  padding-top: 10px;
}
#plans-dialog .plan-option {
  margin-top: 6px;
}
#plans-dialog .plans-note {
  margin: 8px 0 4px;
}
#plans-dialog .config-acc-tail {
  margin-top: 8px;
}
/* Minha conta keeps a single fact (e-mail), so it takes the full width. */
#account-dialog .account-facts,
#account-dialog .account-facts[class] {
  grid-template-columns: minmax(0, 1fr);
}
#account-dialog .account-facts #verify-email-button {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: auto;
  min-height: 44px; /* Stays an easy touch target while reading as a link. */
  margin: 0;
}
/* Dialects belong to the German course only. */
body[data-course='en'] .dialect-options {
  display: none;
}
/* Dialects not yet open: same card, faded, with a small "Em breve" tag in the corner. */
.situation-option.is-soon {
  position: relative;
  cursor: default;
  padding-top: 26px;
}
.situation-option.is-soon:hover {
  border-color: #e6e9f2;
  background: #fff;
}
.situation-option.is-soon > :not(.soon-tag) {
  opacity: 0.55;
}
.soon-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
/* Minha conta: what the tutor remembers, with a way to erase it. */
#account-dialog .memory-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#account-dialog .memory-summary summary {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}
#account-dialog .memory-summary summary::-webkit-details-marker {
  display: none;
}
#account-dialog .memory-summary #memory-count {
  font-weight: 400;
  color: var(--muted);
}
#account-dialog .memory-summary #memory-title {
  flex: 1;
}
#account-dialog .memory-summary summary .icon {
  flex: none;
  transform: rotate(90deg);
  transition: transform 160ms ease;
}
#account-dialog .memory-summary[open] summary .icon {
  transform: rotate(-90deg);
}
#account-dialog .memory-summary p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
#account-dialog .memory-summary p[hidden] {
  display: none;
}
#account-dialog .memory-summary .memory-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#account-dialog .memory-summary ul {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
}
#account-dialog .memory-summary ul:empty {
  display: none;
}
#account-dialog #memory-forget {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0;
}
#account-dialog #memory-forget[hidden] {
  display: none;
}
/* Phones: compact situation cards (icon beside the title, two-line description), so the first rows, the
   "Ver mais" button and the dialects fit without scrolling. */
@media (max-width: 550px) {
  #conversation-menu .situation-grid .situation-option,
  #conversation-menu .free-conversation {
    grid-template-columns: 28px 1fr;
    column-gap: 8px;
    row-gap: 4px;
    padding: 10px;
  }
  #conversation-menu .situation-option .situation-icon {
    width: 28px;
    height: 28px;
  }
  #conversation-menu .situation-grid .situation-option > span:not(.situation-icon),
  #conversation-menu .free-conversation > span:not(.situation-icon) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin-top: 0;
  }
  .conversation-options h3 {
    margin: 14px 0 8px;
  }
}
/* Narrowest phones: two cards per row leave no room for an icon beside the title. */
@media (max-width: 380px) {
  #conversation-menu .situation-grid .situation-option {
    grid-template-columns: 1fr;
  }
  #conversation-menu .situation-grid .situation-option .situation-icon {
    display: none;
  }
}
.review-wait {
  color: var(--blue);
  font-weight: 600;
}
