:root {
  color-scheme: light;
  --blue: #5d9bef;
  --sky: #82c8f8;
  --violet: #8d6be8;
  --lavender: #b178ee;
  --aqua: #6be7e9;
  --navy: #17345f;
  --ink: #142b4d;
  --muted: #48617f;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(23, 52, 95, 0.14);
  --glass-line: rgba(255, 255, 255, 0.5);
  --shadow: 0 18px 42px rgba(28, 43, 94, 0.2);
  font-family: Inter, "SF Pro Text", "SF Pro Display", "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #476dd4;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 3%, rgba(107, 231, 233, 0.55), transparent 28rem),
    linear-gradient(158deg, #5d9bef 0%, #776fe1 52%, #b178ee 100%);
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid #0a2f6d;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(107, 231, 233, 0.5);
}

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

.top-bar {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 10;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: rgba(19, 44, 92, 0.34);
  color: #ffffff;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.icon-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
}

.brand-lockup span {
  overflow-wrap: anywhere;
}

.hero-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  background:
    linear-gradient(rgba(13, 36, 82, 0.36), rgba(13, 36, 82, 0.48)),
    linear-gradient(135deg, rgba(107, 231, 233, 0.2), rgba(177, 120, 238, 0.22));
  color: #ffffff;
  box-shadow: var(--shadow);
}

.hero-meta,
.hero-actions,
.with-action,
.feed-head,
.sharing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-meta {
  font-size: 13px;
  font-weight: 800;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.live-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--aqua);
}

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

h1 {
  margin: 16px 0 9px;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 4px 0 7px;
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: 0;
}

p {
  margin: 0;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.45;
}

.hero-card p {
  color: rgba(255, 255, 255, 0.94);
}

.hero-actions {
  margin-top: 17px;
}

.primary-button,
.secondary-button,
.small-button,
.action-card button {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 850;
}

.primary-button,
.action-card button {
  padding: 0 18px;
  background: var(--aqua);
  color: var(--navy);
}

.secondary-button,
.small-button {
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.thread-tabs {
  position: sticky;
  top: calc(max(10px, env(safe-area-inset-top)) + 70px);
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 14px 0 18px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  background: rgba(19, 44, 92, 0.28);
  box-shadow: 0 12px 26px rgba(23, 52, 95, 0.12);
  backdrop-filter: blur(18px);
}

.thread-tab {
  min-height: 42px;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
}

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

.view {
  display: none;
}

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

.section-heading {
  margin: 0 0 14px;
  color: #ffffff;
}

.section-heading p,
.label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading p {
  color: rgba(255, 255, 255, 0.84);
}

.label {
  color: #526982;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.surface p,
.surface small {
  color: var(--muted);
}

.action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: var(--card-strong);
}

.rail-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.rail-list article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  min-height: 112px;
}

.rail-list article:not(:last-child) {
  padding-bottom: 12px;
  background: linear-gradient(to bottom, transparent 0 32px, rgba(255, 255, 255, 0.55) 32px 100%) 16px 0 / 2px 100% no-repeat;
}

.rail-dot,
.plan-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.rail-list .surface {
  padding: 15px;
}

.student-strip {
  display: flex;
  gap: 8px;
  margin: 0 -18px 15px;
  padding: 0 18px 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.student-strip::-webkit-scrollbar {
  display: none;
}

.student-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-size: 14px;
  font-weight: 850;
}

.student-chip.is-selected {
  background: var(--aqua);
}

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

.capture-tile {
  display: grid;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.capture-tile.is-priority {
  background: #eefeff;
}

.capture-tile span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--navy);
  font-size: 22px;
  font-weight: 900;
}

.capture-tile strong {
  align-self: end;
  font-size: 16px;
  line-height: 1.2;
}

.capture-tile small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.thread-feed,
.summary-card,
.sharing-card {
  margin-top: 14px;
  padding: 16px;
}

.feed-head span {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
}

.thread-feed ol {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.thread-feed li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
}

.thread-feed time {
  color: #526982;
  font-size: 13px;
  font-weight: 850;
}

.thread-feed strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
}

.next-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.next-stack article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 15px;
}

.sharing-card {
  align-items: center;
  background: var(--card-strong);
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 36px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #dbe6f5;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(23, 52, 95, 0.25);
  transition: transform 180ms ease;
}

.switch input:checked + span {
  background: var(--aqua);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.switch input:focus-visible + span {
  outline: 3px solid #0a2f6d;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(107, 231, 233, 0.5);
}

.thumb-dock {
  position: fixed;
  right: max(14px, calc((100vw - 430px) / 2 + 14px));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, calc((100vw - 430px) / 2 + 14px));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: 402px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  background: rgba(16, 39, 86, 0.72);
  box-shadow: 0 18px 42px rgba(23, 52, 95, 0.32);
  backdrop-filter: blur(20px);
}

.thumb-dock button {
  display: grid;
  min-height: 58px;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.thumb-dock span {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
  line-height: 1;
}

.thumb-dock .dock-primary {
  background: var(--aqua);
  color: var(--navy);
}

.toast {
  position: fixed;
  right: max(22px, calc((100vw - 430px) / 2 + 22px));
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: max(22px, calc((100vw - 430px) / 2 + 22px));
  z-index: 30;
  max-width: 386px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--navy);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(circle at 30% 0%, rgba(107, 231, 233, 0.45), transparent 32rem),
      linear-gradient(140deg, #5d9bef 0%, #776fe1 50%, #b178ee 100%);
  }

  .app-shell {
    padding-top: 24px;
  }
}

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