:root {
  color-scheme: dark;
  --blue: #5d9bef;
  --sky: #82c8f8;
  --violet: #8d6be8;
  --lavender: #b178ee;
  --aqua: #6be7e9;
  --navy: #17345f;
  --ink: #f8fbff;
  --muted: rgba(248, 251, 255, 0.78);
  --glass: rgba(255, 255, 255, 0.18);
  --glass-strong: rgba(255, 255, 255, 0.26);
  --line: rgba(255, 255, 255, 0.36);
  --shadow: 0 18px 50px rgba(25, 28, 78, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #4d77d7;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "SF Pro Display", "Avenir Next", system-ui, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(107, 231, 233, 0.42), transparent 28rem),
    radial-gradient(circle at 82% 24%, rgba(177, 120, 238, 0.46), transparent 26rem),
    linear-gradient(155deg, var(--blue) 0%, var(--violet) 54%, var(--lavender) 100%);
  color: var(--ink);
}

button {
  font: inherit;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom));
}

.app-bar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 8px 0 12px;
  backdrop-filter: blur(18px);
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
  color: white;
  font-size: 30px;
  line-height: 1;
  box-shadow: var(--shadow);
}

.title-lockup {
  min-width: 0;
  text-align: center;
}

.app-name,
.eyebrow,
.step-kicker,
.skill-label {
  display: block;
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  overflow: hidden;
  color: white;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.05;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.15;
}

p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.38;
}

.group-hero,
.plan-card,
.memory-strip,
.skill-card,
.roster-summary,
.student-list li,
.note-card,
.attachment-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.group-hero {
  display: grid;
  gap: 16px;
  min-height: 220px;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(23, 52, 95, 0.18), rgba(23, 52, 95, 0.34)),
    radial-gradient(circle at 78% 22%, rgba(107, 231, 233, 0.5), transparent 9rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.1));
}

.hero-copy {
  max-width: 31ch;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-self: end;
}

.hero-stats span {
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
}

.hero-stats strong {
  display: block;
  color: white;
  font-size: 20px;
}

.view-tabs {
  position: fixed;
  right: 18px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 18px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 394px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(23, 52, 95, 0.42);
  box-shadow: 0 12px 34px rgba(23, 52, 95, 0.32);
  backdrop-filter: blur(22px);
}

.tab,
.chip {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.tab.is-active,
.chip.is-active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
}

.view {
  display: none;
  padding-top: 22px;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.plan-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.2);
}

.plan-step {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 20px;
}

.plan-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 1px;
  left: 10px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.34);
}

.plan-step:last-child {
  padding-bottom: 0;
}

.step-dot {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: rgba(23, 52, 95, 0.3);
}

.plan-step.current .step-dot {
  border-color: var(--aqua);
  background: var(--aqua);
  box-shadow: 0 0 0 6px rgba(107, 231, 233, 0.18);
}

.quick-log {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 850;
}

.primary-action {
  border: 0;
  background: var(--aqua);
  color: var(--navy);
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.memory-strip,
.attachment-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.memory-icon,
.attachment-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: rgba(107, 231, 233, 0.22);
  color: white;
  font-weight: 900;
}

.filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  min-width: 82px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.12);
}

.skill-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
  padding: 16px;
}

.skill-card.strong {
  background: rgba(107, 231, 233, 0.18);
}

.skill-card.watch {
  background: rgba(255, 255, 255, 0.2);
}

.skill-card.new {
  background: rgba(177, 120, 238, 0.22);
}

.seen-count {
  min-width: 54px;
  padding: 8px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.roster-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 13px 14px;
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.roster-summary strong {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.student-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.student-list li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.status {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.status.ok {
  background: var(--aqua);
}

.status.watch {
  background: #ffdca8;
}

.status.note {
  background: #e6d6ff;
}

.note-card {
  margin-bottom: 12px;
  padding: 16px;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 850;
}

.note-meta strong {
  color: var(--aqua);
}

.attachment-card {
  margin-bottom: 10px;
}

.attachment-card.muted {
  opacity: 0.86;
}

.icon-button:focus-visible,
.tab:focus-visible,
.chip:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible {
  outline: 3px solid rgba(107, 231, 233, 0.95);
  outline-offset: 3px;
}

@media (min-width: 760px) {
  body {
    display: grid;
    place-items: start center;
    padding: 28px;
  }

  .phone-shell {
    min-height: calc(100vh - 56px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 32px;
    box-shadow: 0 24px 70px rgba(23, 52, 95, 0.38);
  }

  .view-tabs {
    right: calc(50% - 197px);
    left: calc(50% - 197px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .view {
    animation: show-view 180ms ease-out;
  }

  .primary-action:active,
  .secondary-action:active,
  .tab:active,
  .chip:active {
    transform: scale(0.98);
  }
}

@keyframes show-view {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
