/* Practice-area mockup. Builds on styles.css tokens. */

.practice main.app { padding-bottom: calc(var(--tabbar-h, 90px) + 24px); }

.app-top { display: flex; align-items: center; justify-content: space-between; }
.avatar {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}

.kicker { margin-top: 22px; }
.hello { margin: 4px 0 8px; }
.streak { display: flex; align-items: center; gap: 6px; margin: 0 0 18px; }
.streak svg { width: 22px; height: 22px; fill: var(--red); }

/* ---------- Rings ---------- */

.practice .hero-art { height: 116px; margin: 14px 0 0; }
.practice .bubble { font-size: 24px; }
.practice .chips { margin: 4px 0 22px; }
.hello { font-size: clamp(28px, 7vw, 38px); }

.rings-card {
  display: flex;
  justify-content: center;
  padding: 22px 18px;
  border-radius: 24px;
  border: 2px solid var(--line);
  background: #ffffff;
}
.rings-wrap { position: relative; width: 200px; height: 200px; }
.rings { width: 200px; height: 200px; transform: rotate(-90deg); }
.rings circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.rings .fill { transition: stroke-dashoffset 1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.rings-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.rings-center span { font-size: 34px; font-weight: 900; line-height: 1; }
.rings-center small { font-size: 13px; font-weight: 800; color: var(--muted); margin-top: 2px; }

.ring-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 18px; }
.ring-stat { border-radius: 16px; padding: 12px 12px 14px; }
.ring-stat .label { display: block; font-size: 13px; font-weight: 800; }
.ring-stat .value { display: block; font-size: 22px; font-weight: 900; color: var(--ink); line-height: 1.2; margin-top: 2px; }
.ring-stat .note { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.ring-stat.blue { background: var(--blue-50); }
.ring-stat.blue .label { color: var(--blue-dark); }
.ring-stat.yellow { background: var(--yellow-50); }
.ring-stat.yellow .label { color: var(--yellow-ink); }
.ring-stat.red { background: var(--red-50); }
.ring-stat.red .label { color: var(--red-dark); }
#continue { margin-top: 4px; }
#tab-hoy #continue { margin: 0 0 18px; } /* the day's action, right under the greeting */

.celebrate {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--yellow);
  font-weight: 800;
  text-align: center;
}

/* ---------- Plan ---------- */

.plan { display: grid; gap: 12px; margin-top: 14px; }
.plan-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.plan-item:hover { border-color: var(--blue-100); }
.plan-item .plan-icon {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 900;
  color: #ffffff;
}
.plan-item strong { display: block; font-weight: 800; }
.plan-item .muted { font-size: 14px; }
.plan-item .go { margin-left: auto; color: var(--blue); font-weight: 900; font-size: 20px; }
.plan-item.done { background: var(--blue-50); border-color: transparent; }
.plan-item.done .go { color: var(--blue-dark); font-size: 15px; }

/* ---------- Week strip ---------- */

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.day { text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.day svg { display: block; width: 100%; max-width: 40px; margin: 6px auto 0; transform: rotate(-90deg); }
.day circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.day.today { color: var(--blue-dark); }

.free-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  margin: 12px 0 18px;
  padding: 18px;
  border-radius: 24px;
  background: var(--blue);
  color: #ffffff;
  text-align: left;
  box-shadow: 0 4px 0 var(--blue-dark);
}
.free-card::after {
  content: "";
  position: absolute;
  left: 40px;
  bottom: -9px;
  width: 20px;
  height: 20px;
  background: var(--blue);
  border-radius: 3px;
  transform: rotate(45deg);
}
.free-card strong { display: block; font-size: 18px; font-weight: 900; }
.free-card .muted { color: #dfe7ff; font-size: 15px; font-weight: 600; }
.free-icon {
  flex: none;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
}
.free-icon svg { width: 24px; height: 24px; fill: currentColor; }

/* ---------- Drill ---------- */

.back { padding-left: 0; margin-top: 12px; min-height: 40px; }
.drill-say { margin-top: 8px; }
.drill-buttons { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.drill-buttons button { min-height: 58px; white-space: nowrap; padding-left: 14px; padding-right: 14px; }
.drill-feedback { margin-top: 22px; text-align: center; }
.drill-score { margin: 0; }
#drill-score { font-size: 54px; font-weight: 900; line-height: 1; }
#drill-message { font-size: 18px; font-weight: 700; margin: 8px 0 18px; }
.drill-done { text-align: center; padding-top: 30px; }
.done-badge {
  width: 84px; height: 84px;
  margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-size: 42px;
  font-weight: 900;
  box-shadow: 0 0 0 10px var(--yellow-50);
}
.drill-done h2 { margin-top: 22px; }

/* ---------- Progress ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.stat { border-radius: 16px; padding: 14px; display: flex; flex-direction: column; }
.stat-num { font-size: 30px; font-weight: 900; line-height: 1.1; }
.stat-label { font-size: 13px; font-weight: 800; }
.stat-delta { font-size: 12px; font-weight: 800; color: var(--blue-dark); margin-top: 2px; }
.stat-blue { background: var(--blue-50); }
.stat-yellow { background: var(--yellow-50); }
.stat-red { background: var(--red-50); }

.chart-card { margin-top: 12px; padding: 12px 8px 4px; border: 2px solid var(--line); border-radius: 20px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-card text { font-family: inherit; font-size: 11px; font-weight: 700; fill: var(--muted); }
.chart-card .value { fill: var(--ink); font-weight: 900; font-size: 12px; }

.sound-progress { display: grid; gap: 14px; margin-top: 12px; }
.sp-head { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 6px; }
.sp-head span { color: var(--blue-dark); font-size: 15px; }
.sp-bars { position: relative; height: 14px; border-radius: 7px; background: var(--gray-50); overflow: hidden; }
.sp-bars i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; }
.sp-bars .before { width: 4px; border-radius: 2px; background: var(--ink); }
.sp-bars .now { background: var(--blue); transition: width 1s cubic-bezier(0.2, 0.7, 0.2, 1); }

.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 28px; }
.cal-nav h2 { margin: 0; flex: 1; text-align: center; }
.cal-arrow { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: #ffffff; color: var(--ink); font: inherit; font-size: 24px; font-weight: 900; line-height: 1; }
.cal-arrow:disabled { opacity: 0.35; }
.cal-count { text-align: center; margin: 4px 0 0; font-weight: 700; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.cal-head { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.cal-day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  background: var(--gray-50);
  color: var(--muted);
}
.cal-day.full { background: var(--blue); color: #ffffff; }
.cal-day.part { background: #c4d5ff; color: var(--blue-dark); }
.cal-day.future { background: transparent; color: #b6bcc8; }
.cal-day.today { outline: 3px solid var(--red); outline-offset: 1px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
.cal-legend span { display: flex; align-items: center; gap: 6px; }
.cal-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-dot.full { background: var(--blue); }
.cal-dot.part { background: #c4d5ff; }
.cal-dot.none { background: var(--gray-50); border: 1px solid var(--line); }

.before-after { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- Free talk ---------- */

.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.topic {
  min-height: 42px;
  padding: 8px 16px;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
}
.topic[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #ffffff; }
.topic-prompt {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--yellow-50);
  font-weight: 700;
}
#free-start { margin-top: 8px; }
.timer { text-align: center; font-size: 56px; font-weight: 900; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
#free-recording h1 { text-align: center; margin-top: 30px; }
#free-analyzing { text-align: center; padding-top: 90px; }

.sample-badge {
  display: inline-block;
  margin-top: 20px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--yellow-50);
  color: var(--yellow-ink);
  font-size: 13px;
  font-weight: 800;
}
.free-score { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fact { padding: 8px 12px; border-radius: 12px; background: var(--gray-50); font-size: 14px; font-weight: 700; }
.fact strong { font-weight: 900; }

.transcript {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 2px solid var(--line);
  font-size: 18px;
  line-height: 1.8;
}
.transcript .mark {
  padding: 1px 3px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.transcript .mark:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.transcript .bad { background: var(--red-50); color: var(--red-dark); text-decoration: underline wavy var(--red); text-underline-offset: 4px; }
.transcript .good { background: var(--blue-50); color: var(--blue-dark); }
.transcript .gram { background: var(--yellow-50); color: var(--yellow-ink); font-weight: 700; text-decoration: underline dotted var(--yellow-dark); text-underline-offset: 4px; }
.transcript-legend .gram { background: var(--yellow-50); color: var(--yellow-ink); }

.grammar { display: grid; gap: 14px; margin-top: 16px; }
.gram-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.gram-card p { font-size: 16px; }
.gram-said, .gram-fixed { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; margin-bottom: 8px; }
.gram-said { background: var(--red-50); }
.gram-said .gram-text { color: var(--red-dark); text-decoration: line-through; text-decoration-thickness: 2px; }
.gram-fixed { background: var(--blue-50); margin-bottom: 12px; }
.gram-label { font-size: 13px; font-weight: 800; color: var(--muted); }
.gram-text { font-size: 18px; font-weight: 800; }
.gram-fixed mark { background: var(--yellow); color: var(--ink); border-radius: 4px; padding: 0 3px; }
.gram-card .listen-btn { width: 100%; }

.transcript-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.transcript-legend b { font-weight: 800; padding: 0 4px; border-radius: 4px; }
.transcript-legend .bad { background: var(--red-50); color: var(--red-dark); }
.transcript-legend .good { background: var(--blue-50); color: var(--blue-dark); }

.next-step {
  margin-top: 28px;
  padding: 20px;
  border-radius: 22px;
  background: var(--yellow);
}
.next-step h2 { margin-top: 0; }
.next-step button { width: 100%; }

/* ---------- Tab bar and toast ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  /* Close to iOS's own tab bar (~83pt with the home bar): the labels may sit a little into
     the home-bar area, so only part of that inset is added (Andrew: too tall, Nov 5). */
  padding: 4px 12px max(6px, calc(env(safe-area-inset-bottom) - 12px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.tabbar button {
  flex: 0 1 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 0;
  padding: 2px 4px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 15px;
  font-weight: 800;
}
/* Each icon sits in a 32px circle; the active tab's circle is gold with a dark-blue icon,
   the same gold chip as the home-screen widgets (app/android .../dilo_w_*.xml). */
.tabbar svg { width: 32px; height: 32px; padding: 5px; border-radius: 50%; transition: background-color .15s; }
.tabbar button.active { color: var(--blue-dark); }
.tabbar button.active svg { background: var(--yellow); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  width: min(90vw, 420px);
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  z-index: 10;
}

@media (max-width: 420px) {
  .rings-card { flex-direction: column; align-items: stretch; }
  .rings { margin: 0 auto; }
}

/* ---------- "Get the app" card (getapp.js), same blue + gold as the home-screen widgets ---------- */
.get-app { margin: 0 0 18px; padding: 18px 18px 14px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #3274ff, #1745d8); }
.get-app h3 { margin: 0 0 6px; font-size: 20px; font-weight: 900; color: #fff; }
.get-app-kicker { margin: 0 0 2px; font-size: 12px; font-weight: 900; letter-spacing: .08em; color: var(--yellow); }
.get-app ul { margin: 0 0 14px; padding-left: 20px; color: #d6e2ff; }
.get-app li { margin: 2px 0; }
.get-app-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.get-app-btn { display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--yellow);
  color: #1745d8; font-weight: 900; text-decoration: none; }
.get-app-later { background: none; border: 0; color: #d6e2ff; font: inherit; font-weight: 700; padding: 10px 6px; cursor: pointer; }

/* Going between the practice page and Cuenta is a full page load. Keep the old page on screen until the
   new one is drawn and cross-fade (iOS 18.2+ / Chrome 126+; older browsers just load as before), with
   the tab bar held still so it doesn't flash (Andrew, Nov 7: the page briefly went blank). */
@view-transition { navigation: auto; }
.tabbar { view-transition-name: tabbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.15s; }
::view-transition-group(tabbar) { animation: none; }
