: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.2);
  --glass-strong: rgba(255, 255, 255, 0.28);
  --line: rgba(255, 255, 255, 0.36);
  --shadow: 0 18px 46px rgba(21, 27, 70, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #567fdc;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "SF Pro Display", "Avenir Next", system-ui, sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(107, 231, 233, 0.34), transparent 25%),
    radial-gradient(circle at 88% 30%, rgba(177, 120, 238, 0.42), transparent 28%),
    linear-gradient(165deg, #5d9bef 0%, #7687ec 42%, #8d6be8 70%, #b178ee 100%);
  color: var(--ink);
}

button {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid rgba(107, 231, 233, 0.9);
  outline-offset: 3px;
}

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

.phone-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.34), transparent 75%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 18px;
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.04;
}

h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.18;
}

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

.icon-button,
.small-button,
.nav-button,
.tag-row button,
.attendance-grid button,
.attachment-row button {
  border: 1px solid var(--line);
  background: var(--glass);
  color: #fff;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel,
.section-block,
.capture-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.27), rgba(255, 255, 255, 0.13));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-height: 330px;
  padding: 22px;
  border-radius: 16px;
}

.hero-copy h2 {
  max-width: 13ch;
  font-size: 30px;
  line-height: 1.02;
}

.radar-map {
  position: relative;
  min-height: 172px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(23, 52, 95, 0.18), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at center, rgba(107, 231, 233, 0.24), transparent 55%);
  overflow: hidden;
}

.ring,
.ring::before {
  position: absolute;
  border-radius: 50%;
}

.ring {
  inset: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.ring-one {
  width: 62px;
  height: 62px;
}

.ring-two {
  width: 114px;
  height: 114px;
}

.ring-three {
  width: 164px;
  height: 164px;
}

.radar-map::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 82px;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--aqua), transparent);
  transform-origin: top;
  transform: rotate(42deg);
  animation: sweep 5.2s linear infinite;
}

.dot {
  position: absolute;
  min-width: 68px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.dot-ready {
  right: 18px;
  top: 31px;
}

.dot-refresh {
  left: 16px;
  bottom: 30px;
}

.dot-watch {
  right: 31px;
  bottom: 18px;
}

.section-block {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
}

.section-block.first {
  margin-top: 0;
}

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

.pill,
.small-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.pill {
  display: inline-flex;
  align-items: center;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.82);
}

.signal-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.signal-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.signal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--navy);
  font-weight: 900;
}

.high .signal-icon {
  background: var(--aqua);
}

.medium .signal-icon {
  background: #d9c4ff;
}

.quiet .signal-icon {
  background: #c7e9ff;
}

.plan-stack {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-stack li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(23, 52, 95, 0.18);
}

.time {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 10px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.student-list {
  display: grid;
  gap: 10px;
}

.student-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 13px;
  background: rgba(23, 52, 95, 0.16);
}

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

.avatar.teal {
  background: var(--aqua);
}

.avatar.violet {
  background: #d9c4ff;
}

.avatar.blue {
  background: #bfe6ff;
}

.avatar.lavender {
  background: #f1d7ff;
}

.status-chip {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 900;
}

.cluster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.cluster-grid div {
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 13px;
  background: rgba(23, 52, 95, 0.18);
}

.cluster-grid strong {
  display: block;
  font-size: 31px;
  line-height: 1;
}

.cluster-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.capture-card {
  margin-top: 12px;
  padding: 15px;
  border-radius: 13px;
  box-shadow: none;
}

.capture-card:first-of-type {
  margin-top: 0;
}

.tag-row,
.attendance-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.tag-row button,
.attendance-grid button {
  min-height: 44px;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 850;
}

.attendance-grid button.present,
.tag-row button {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.86);
}

.capture-card.note {
  background: rgba(23, 52, 95, 0.2);
}

.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 800;
}

.attachment-row button {
  min-width: 58px;
  min-height: 40px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--aqua);
  font-weight: 900;
}

.primary-action {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  color: var(--navy);
  background: var(--aqua);
  box-shadow: 0 16px 30px rgba(23, 52, 95, 0.24);
  font-weight: 950;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(calc(100% - 28px), 402px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(39, 59, 127, 0.52);
  box-shadow: 0 18px 42px rgba(23, 52, 95, 0.36);
  backdrop-filter: blur(24px);
  transform: translateX(-50%);
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.nav-button svg {
  width: 19px;
  height: 19px;
}

.nav-button.active {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.9);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 20;
  width: min(calc(100% - 44px), 360px);
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes sweep {
  to {
    transform: rotate(402deg);
  }
}

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

  .phone-shell {
    min-height: min(900px, calc(100vh - 48px));
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 28px;
    box-shadow: 0 28px 80px rgba(25, 31, 84, 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
