:root {
  color-scheme: light;
  --ink: #18263e;
  --muted: #5f6e83;
  --line: rgba(25, 38, 62, 0.12);
  --surface: rgba(255, 255, 255, 0.94);
  --soft: rgba(239, 246, 255, 0.78);
  --blue: #4f86df;
  --violet: #8068df;
  --mint: #4bbd9b;
  --amber: #d8922a;
  --coral: #d86e65;
  --shadow: 0 24px 70px rgba(42, 54, 84, 0.26);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(126, 180, 255, 0.54), transparent 26rem),
    radial-gradient(circle at 80% 20%, rgba(241, 158, 113, 0.48), transparent 24rem),
    linear-gradient(145deg, #f8fbff 0%, #e5efff 46%, #f4e9ff 100%);
}

html {
  scroll-behavior: smooth;
}

button,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #243552;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 10;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: #18263e;
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.phone {
  position: relative;
  width: min(100%, 420px);
  min-height: min(880px, calc(100vh - 36px));
  max-height: 900px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.9));
  box-shadow: var(--shadow);
}

.topbar,
.class-strip,
.quick-access,
.flow-toolbar,
.session-bar,
.phase-tabs,
.phase,
.capture-dock {
  padding-inline: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(16px);
}

.topbar {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  gap: 12px;
  align-items: center;
  padding-top: 18px;
  padding-bottom: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(79, 134, 223, 0.14);
  font-size: 1.3rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: #47617e;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.12;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.class-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.class-strip span,
.class-strip strong {
  display: block;
}

.class-strip span {
  color: var(--muted);
  font-size: 0.88rem;
}

.privacy-chip,
.card-heading button,
.live-header button {
  border-radius: 999px;
  color: #1f4f9d;
  background: rgba(79, 134, 223, 0.14);
  font-size: 0.86rem;
  font-weight: 900;
}

.quick-access {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding-bottom: 10px;
}

.quick-access button {
  min-width: 0;
  border-radius: 14px;
  color: #33435a;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  font-weight: 900;
}

.flow-toolbar {
  position: sticky;
  top: 76px;
  z-index: 5;
  padding-block: 8px;
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.96), rgba(250, 253, 255, 0.86));
  backdrop-filter: blur(16px);
}

.session-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 0 0;
}

.session-bar button {
  border-radius: 999px;
  color: #2f4360;
  background: rgba(79, 134, 223, 0.12);
  font-weight: 900;
}

.session-bar .save-session {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.phase-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0;
}

.phase-tab {
  border-radius: 999px;
  color: #45566d;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.phase-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.phase {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-bottom: 18px;
  scroll-margin-top: 168px;
}

.phase + .phase {
  margin-top: 4px;
  padding-top: 18px;
}

.phase + .phase::before {
  content: "";
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 134, 223, 0.24), transparent);
}

.wrap-phase {
  padding-bottom: 20px;
}

.hero-card,
.signal,
.plan-card,
.roster-preview,
.attendance-card,
.skill-pad,
.capture-card,
.thread,
.share-card,
.next-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(42, 54, 84, 0.08);
}

.hero-card {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 244, 255, 0.86)),
    var(--surface);
}

.hero-card p:last-child,
.signal p,
.thread p,
.next-card li {
  margin-bottom: 0;
}

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

.signal {
  min-height: 132px;
  padding: 14px;
}

.dot {
  display: block;
  width: 12px;
  height: 12px;
  margin-bottom: 12px;
  border-radius: 50%;
}

.blue { background: var(--blue); }
.amber { background: var(--amber); }
.coral { background: var(--coral); }
.mint { background: var(--mint); }

.card-heading,
.live-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-card,
.roster-preview,
.attendance-card,
.skill-pad,
.capture-card,
.thread,
.share-card,
.next-card {
  padding: 14px;
}

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

.plan-list li,
.thread-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: var(--soft);
}

.plan-list span,
.thread time {
  color: #49617c;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.student-row,
.attendance-chips,
.skill-grid,
.scope-pills,
.context-row,
.capture-actions,
.share-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-row button,
.attendance-chips button,
.skill-grid button,
.scope-pills button,
.context-row button,
.capture-actions button,
.share-options button {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
}

.student-row button {
  display: grid;
  min-width: 112px;
  justify-items: start;
  padding: 8px 12px;
}

.student-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.live-header {
  align-items: center;
}

.live-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: #0f5d4b;
  background: rgba(75, 189, 155, 0.16);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.is-present,
.share-options .is-selected {
  color: #0f5d4b !important;
  background: rgba(75, 189, 155, 0.16) !important;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill-grid button {
  border-radius: 16px;
  white-space: normal;
}

.compact-heading {
  align-items: center;
}

.inline-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
}

.inline-actions button,
.capture-actions button {
  color: #1f4f9d;
  background: rgba(79, 134, 223, 0.12);
}

.capture-card {
  display: grid;
  gap: 12px;
  border-color: rgba(79, 134, 223, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.9)),
    var(--surface);
}

.capture-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scope-pills .is-selected,
.context-row button:first-child {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.context-row button {
  background: rgba(255, 255, 255, 0.9);
}

.thread {
  display: grid;
  gap: 8px;
}

.thread-item {
  grid-template-columns: 44px 1fr;
}

.share-card label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  line-height: 1.45;
}

.next-card ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.capture-dock {
  position: sticky;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 6px 12px 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 42px rgba(42, 54, 84, 0.2);
  backdrop-filter: blur(14px);
}

.capture-dock button {
  min-width: 0;
  border-radius: 16px;
  color: #33435a;
  background: rgba(79, 134, 223, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
}

.capture-dock .primary-capture {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

@media (max-width: 430px) {
  .app {
    padding: 0;
  }

  .phone {
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .phase-tabs {
    top: auto;
  }

  .capture-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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