/* The web app at /app. Builds on site.css tokens so it matches the landing page. */

.app-main {
  max-width: 44rem;
  padding-bottom: 6rem;
  outline: none;
}

.app-nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.95rem;
}

.app-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0;
}

.app-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Phones: the tabs move to a bottom bar, like the iPhone app. */
@media (max-width: 34rem) {
  .app-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 5;
    justify-content: space-around;
    gap: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
  }

  .app-nav a {
    flex: 1;
    text-align: center;
    padding: 0.6rem 0;
  }

  .app-nav a[aria-current="page"] {
    box-shadow: none;
    color: var(--accent);
  }

  .app .site-footer {
    display: none;
  }
}

.demo-banner {
  margin: 0;
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  background: var(--accent-soft);
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  margin: 0 0 1rem;
}

@media (min-width: 40rem) {
  .card {
    padding: 1.6rem 1.75rem;
  }
}

.card.narrow {
  max-width: 28rem;
  margin: 1.5rem auto;
}

.card h1 {
  font-size: clamp(1.6rem, 6vw, 2.1rem);
}

.card > :last-child {
  margin-bottom: 0;
}

.back {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.95rem;
}

.back a {
  text-decoration: none;
}

.notice {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}

.notice.error {
  background: color-mix(in srgb, #c0392b 12%, var(--surface));
}

.notice p {
  margin: 0 0 0.5rem;
}

.notice p:last-child {
  margin: 0;
}

.button.small {
  min-height: 40px;
  padding: 0.45rem 1rem;
  font-size: 0.95rem;
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

.button.google {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1.1rem 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

/* Forms */

.stack {
  display: grid;
  gap: 0.6rem;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="email"],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.4 var(--sans);
}

textarea {
  resize: vertical;
  font-size: 1.1rem;
}

.field {
  display: grid;
  gap: 0.3rem;
  margin: 0 0 0.9rem;
}

.inline-form {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

@media (min-width: 30rem) {
  .inline-form {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .inline-form label,
  .inline-form .fine {
    grid-column: 1 / -1;
  }

  .inline-form .fine {
    margin: 0;
  }
}

.checks {
  display: grid;
  gap: 0.4rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 400;
  min-height: 40px;
}

.check input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Onboarding choices */

.choices {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0;
}

.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choice-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}

/* Today */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.1;
}

.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}

.today .preview {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read */

.article-body p {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 2.05;
  margin: 0 0 1.1rem;
}

.word {
  all: unset;
  cursor: pointer;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}

.word:hover {
  background: var(--accent-soft);
}

.word.glossed {
  text-decoration: underline dotted var(--muted);
  text-underline-offset: 0.3em;
}

.word.tapped {
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.word:focus-visible {
  outline: 2px solid var(--focus);
}

.define-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 6;
  max-width: 40rem;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgb(0 0 0 / 0.12);
  padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
}

.define-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.define-term {
  font-family: var(--serif);
  font-size: 1.8rem;
}

.define-reading {
  color: var(--accent);
  font-size: 1.1rem;
  margin: 0.2rem 0 0.4rem;
}

.icon-button {
  all: unset;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
}

.icon-button:hover {
  background: var(--accent-soft);
}

.sticky-actions {
  justify-content: flex-end;
}

/* Talk */

.transcript {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.6rem;
  max-height: min(55vh, 34rem);
  overflow-y: auto;
}

.turn {
  max-width: 88%;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.turn.user {
  justify-self: end;
  background: var(--accent-soft);
  border-color: transparent;
}

.turn .who {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.turn p {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.7;
}

.reply-form .actions {
  margin-top: 0.6rem;
}

/* Wrap-up */

.corrections,
.vocab,
.rows {
  list-style: none;
  padding: 0;
  margin: 0;
}

.corrections li,
.vocab li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.corrections li p {
  margin: 0.25rem 0 0;
}

.corrections s {
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.vocab strong {
  font-family: var(--serif);
  font-size: 1.2rem;
}

/* Review */

.flashcard {
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.flash-term {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 12vw, 3.4rem);
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

.flash-mistake {
  font-family: var(--serif);
  font-size: 1.5rem;
}

.card-back {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-size: 1.1rem;
}

.center-actions,
.grades {
  justify-content: center;
}

.grades {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.grades[hidden] {
  display: none;
}

/* Friends */

.rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.rows .fine {
  margin: 0.15rem 0 0;
}

.row-actions {
  display: flex;
  gap: 0.5rem;
}

.friend-row .field {
  margin: 0;
  min-width: 11rem;
}

.invite-link code {
  word-break: break-all;
  font-size: 0.85rem;
}
