/* Tatiana lesson screen — Priority 1 (UI-CONSOLIDATION-018) */
@import url("/css/lfm-tokens.css");

:root {
  --ma-bg: var(--lfm-paper);
  --ma-ink: var(--lfm-ink);
  --ma-muted: var(--lfm-muted);
  --ma-line: var(--lfm-line);
  --ma-green: var(--lfm-progress);
  --ma-seg: var(--lfm-progress-track);
  --ma-safe-top: var(--lfm-safe-t);
  --ma-safe-bottom: var(--lfm-safe-b);
  --ma-radius: var(--lfm-radius-art);
  --ma-font: var(--lfm-sans);
}

html, body.ma-lesson {
  margin: 0;
  min-height: 100%;
  background: var(--ma-bg);
  color: var(--ma-ink);
  font-family: var(--ma-font);
  -webkit-font-smoothing: antialiased;
}

body.ma-lesson {
  padding: calc(10px + var(--ma-safe-top)) 20px 0;
}

.ma-shell {
  max-width: 420px;
  margin: 0 auto;
  padding-bottom: calc(20px + var(--ma-safe-bottom));
}

/* Header — compact school title (Tatiana) */
.ma-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ma-brand {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ma-ink);
  text-decoration: none;
}

.ma-menu-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.ma-menu-btn span {
  display: block;
  height: 2px;
  background: var(--ma-ink);
  border-radius: 1px;
}
.ma-menu-btn span:first-child { width: 16px; }
.ma-menu-btn span:last-child { width: 11px; margin-left: auto; }

.ma-kicker {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ma-muted);
}

.ma-title {
  margin: 0 0 14px;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* Progress — five segments, muted forest green */
.ma-progress {
  margin: 0 0 18px;
}

.ma-segs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 8px;
}

.ma-seg {
  height: 6px;
  border-radius: var(--lfm-radius-pill);
  background: var(--ma-seg);
}

.ma-seg.done {
  background: var(--ma-green);
}

.ma-progress-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ma-muted);
}

/* ArtworkFrame */
.ma-art {
  margin: 0 0 18px;
  border-radius: var(--ma-radius);
  overflow: hidden;
  background: var(--ma-matte, #5a7286);
  line-height: 0;
}

.ma-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(46vh, 360px);
  object-fit: contain;
  object-position: center;
  background: var(--ma-matte, #5a7286);
}

.ma-task-title {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
}

.ma-task-body {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #222;
  white-space: pre-wrap;
}

/* Sticky LessonAction — long practice stays reachable */
.ma-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -4px;
  padding: 12px 4px calc(12px + var(--ma-safe-bottom));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
}

.ma-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: var(--lfm-radius-pill);
  background: #111;
  color: #fff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 14px 18px;
  cursor: pointer;
}

.ma-upload:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ma-upload svg {
  flex: 0 0 auto;
}

.ma-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--ma-green);
}
.ma-status.err { color: var(--lfm-danger); }

.ma-divider {
  height: 1px;
  background: var(--ma-line);
  margin: 18px 0;
  border: 0;
}

/* PartnerPreview */
.ma-partner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding-bottom: 8px;
}

.ma-partner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ma-muted);
}

.ma-partner h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ma-partner p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--ma-muted);
}

.ma-partner-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--ma-seg);
}

.ma-partner-go {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ma-line);
  display: grid;
  place-items: center;
  color: var(--ma-ink);
  background: #fff;
}

.ma-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.28);
  display: none;
}
.ma-drawer.open { display: block; }

.ma-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 86vw);
  height: 100%;
  background: #fff;
  padding: calc(18px + var(--ma-safe-top)) 18px calc(18px + var(--ma-safe-bottom));
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
}

.ma-drawer-panel a,
.ma-drawer-panel button.linkish {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--ma-line);
  background: transparent;
  color: var(--ma-ink);
  font: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}

.ma-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--ma-safe-bottom));
  transform: translateX(-50%) translateY(12px);
  background: #111;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--lfm-radius-pill);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ma-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ma-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  display: none;
}
.ma-overlay.active { display: block; }

.ma-star {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  background: radial-gradient(circle, #ffe9a8 0%, #f0c14b 45%, transparent 70%);
  filter: drop-shadow(0 0 12px rgba(240, 193, 75, 0.7));
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0;
  animation: ma-star 1.6s ease forwards;
}

.ma-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e8c35a;
  opacity: 0;
  animation: ma-particle 1.4s ease-out forwards;
}

@keyframes ma-star {
  0% { opacity: 0; transform: scale(0.4); }
  25% { opacity: 1; transform: scale(1.05); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.9); }
}
@keyframes ma-particle {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

.ma-expo, .ma-salute {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.96);
  display: none;
  padding: calc(20px + var(--ma-safe-top)) 20px calc(20px + var(--ma-safe-bottom));
  overflow: auto;
}
.ma-expo.open, .ma-salute.open { display: block; }

.ma-expo h2, .ma-salute h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-family: var(--lfm-serif);
}
.ma-expo p, .ma-salute p {
  margin: 0 0 16px;
  color: var(--ma-muted);
  font-size: 0.9rem;
}
.ma-expo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.ma-expo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--ma-seg);
}
.ma-close {
  border: 0;
  border-radius: var(--lfm-radius-pill);
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
}

.ma-salute-sky {
  position: relative;
  height: min(52vh, 360px);
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #1a2740 0%, #3d4f6f 42%, #8b6b4a 78%, #c4a574 100%);
  margin-bottom: 16px;
}
.ma-salute-sky::after {
  content: "Монмартр";
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ma-burst {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: ma-burst 1.8s ease-out infinite;
}
@keyframes ma-burst {
  0% { opacity: 0; transform: scale(0.3); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.4) translateY(-40px); }
}

@media (prefers-reduced-motion: reduce) {
  .ma-star, .ma-particle, .ma-burst { animation: none; opacity: 0.85; }
}

@media (min-width: 720px) {
  body.ma-lesson { background: var(--lfm-bg); }
  .ma-shell {
    max-width: 440px;
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 20px 22px calc(20px + var(--ma-safe-bottom));
    background: var(--ma-bg);
    box-shadow: 0 0 0 1px var(--ma-line);
  }
  .ma-title { font-size: 1.85rem; }
}
