/* Tutor Studio tokens — tutor surfaces only. Do not remap site-wide navy-50. */
:root {
  --apt-ink: #0b1528;
  --apt-navy: #1e3a8a;
  --apt-navy-deep: #132952;
  --apt-sky: #38bdf8;
  --apt-sky-deep: #2563eb;
  --apt-gold: #fbbf24;
  --apt-gold-deep: #d97706;
  --apt-paper: #f7f4ee;
  --apt-card: #ffffff;
  --apt-line: rgba(30, 58, 138, 0.10);
  --apt-muted: #64748b;
  --apt-ok: #0284c7;
  --apt-warn: #d97706;
  --apt-danger: #dc2626;
}

.apt-paper { background: var(--apt-paper); }

/* Hex-backed brand marks so gold never depends on compiled Tailwind utilities */
.apt-gold-mark {
  background: #fbbf24;
  color: #0b1528;
}
.apt-gold-label { color: #fbbf24; }
.apt-gold-eyebrow { color: #b45309; }
.apt-nav-pill {
  color: #b45309;
  background: rgba(253, 224, 71, 0.4);
}

/* Hero copy must stay light on navy even when body is text-slate-800 */
.apt-hero-gradient .apt-hero-copy { color: #dbeafe !important; }
.apt-hero-gradient .apt-hero-muted { color: rgba(219, 234, 254, 0.82) !important; }
.apt-hero-gradient .apt-hero-pill { color: #fde047; }
.apt-hero-gradient .apt-hero-dot { background: #fbbf24; }
.apt-hero-chip {
  border: 1px solid rgba(253, 224, 71, 0.45);
  background: rgba(251, 191, 36, 0.12);
}
.apt-hero-gradient a.apt-hero-link { color: #dbeafe; }
.apt-hero-gradient a.apt-hero-link:hover { color: #fff; }

/* Product chrome — 48px strip above sidebar + canvas */
.apt-topstrip {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 48px;
  background: #070d18;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.apt-topstrip-inner {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
}
.apt-topstrip-brand {
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}
.apt-topstrip-tag {
  font-size: 12px;
  color: #94a3b8;
}
.apt-topstrip-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.apt-topstrip-name {
  font-size: 13px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}
.apt-topstrip-out {
  font-size: 12px;
  color: #fca5a5;
  text-decoration: none;
  white-space: nowrap;
}
.apt-topstrip-out:hover { color: #fecaca; }
.apt-topstrip-help {
  position: relative;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}
.apt-topstrip-help .ap-help-dot {
    top: -6px;
    right: -8px;
    box-shadow: 0 0 0 2px #0f172a;
}
.apt-topstrip-help:hover { background: rgba(255,255,255,0.12); }
.apt-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #2563eb;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.apt-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 639px) {
  .apt-topstrip-tag,
  .apt-topstrip-name { display: none; }
}
.apt-card {
  background: var(--apt-card);
  border: 1px solid var(--apt-line);
  border-radius: 1.1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 28px -18px rgba(15, 23, 42, 0.22);
}

.toast-success { background: var(--apt-navy) !important; }

/* Landing hero (same family as public landing, gold secondary aurora instead of violet) */
.apt-hero-gradient {
  background: linear-gradient(155deg, #0b1528 0%, #132952 18%, #1e3a8a 42%, #2d4ba0 62%, #3d63c9 82%, #1a2f6b 100%);
}
.apt-hero-aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.apt-hero-aurora::before,
.apt-hero-aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.5;
  animation: apt-drift 20s ease-in-out infinite;
}
.apt-hero-aurora::before {
  width: min(55vw, 28rem);
  height: min(55vw, 28rem);
  top: -12%;
  right: -8%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.55) 0%, rgba(59, 130, 246, 0.2) 45%, transparent 72%);
}
.apt-hero-aurora::after {
  width: min(50vw, 24rem);
  height: min(50vw, 24rem);
  bottom: 5%;
  left: -12%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.28) 0%, rgba(245, 158, 11, 0.08) 50%, transparent 70%);
  animation-delay: -10s;
}
@keyframes apt-drift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(-3%, 4%) scale(1.08); opacity: 0.62; }
}
@media (prefers-reduced-motion: reduce) {
  .apt-hero-aurora::before,
  .apt-hero-aurora::after { animation: none; }
}

.apt-cta-gold {
  background: linear-gradient(165deg, #fde047 0%, #fbbf24 35%, #f59e0b 100%);
  box-shadow: 0 8px 28px rgba(217, 119, 6, 0.4), 0 2px 0 rgba(120, 53, 15, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #0b1528;
}
.apt-cta-gold:hover {
  background: linear-gradient(165deg, #facc15 0%, #f59e0b 40%, #d97706 100%);
}
.apt-header-signin {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 0.65rem;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.32);
}
.apt-header-signin svg { width: 1rem; height: 1rem; }
@media (min-width: 640px) {
  .apt-header-signin {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.75rem;
  }
}
.apt-cta-sky {
  background: linear-gradient(165deg, #38bdf8 0%, #3b82f6 40%, #2563eb 100%);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45), 0 2px 0 rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}
.apt-cta-sky:hover {
  background: linear-gradient(165deg, #0ea5e9 0%, #2563eb 45%, #1d4ed8 100%);
}
.apt-glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.apt-hairline {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(30, 58, 138, 0.2) 18%, rgba(56, 189, 248, 0.25) 50%, rgba(30, 58, 138, 0.2) 82%, transparent);
}

/* Portal sidebar */
.apt-sidebar {
  background: linear-gradient(180deg, #0b1528 0%, #132952 100%);
  top: 48px;
  height: calc(100% - 48px);
}
@media (max-width: 1023px) {
  .apt-sidebar { display: none !important; }
  .apt-mobile-header { display: flex !important; }
}
@media (min-width: 1024px) {
  .apt-sidebar { display: flex !important; }
  .apt-mobile-header { display: none !important; }
  .apt-mobile-bar { display: none !important; }
  .apt-topstrip-out { display: none; }
}
.apt-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.65rem;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.apt-sidebar-link:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}
.apt-sidebar-link.active {
  background: rgba(251, 191, 36, 0.14);
  color: #fde047;
  font-weight: 600;
  box-shadow: inset 2px 0 0 #fbbf24;
}
.apt-sidebar-link.danger {
  color: #fca5a5;
}
.apt-sidebar-link.danger:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #fecaca;
}
.apt-nav-label {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
}

.apt-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #0b1528;
  color: #fff;
  padding: 0.75rem 1rem;
}
.apt-mobile-header a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
}

.apt-mobile-bar {
  display: flex;
  align-items: stretch;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: #0b1528;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.15rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}
.apt-mobile-bar a {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.35rem 0.15rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 500;
  text-align: center;
}
.apt-mobile-bar a svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.apt-mobile-bar a.active {
  color: #fbbf24;
  font-weight: 600;
}

.apt-empty {
  color: #475569;
  font-size: 0.875rem;
  padding: 1rem 0;
}
.apt-empty-hint {
  color: #64748b;
  font-size: 0.75rem;
}

.apt-students-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.apt-students-head-copy {
  min-width: 0;
  flex: 1 1 12rem;
}
.apt-students-add {
  flex: 0 0 auto;
}

.apt-student-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  min-width: 0;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 0.75rem;
  padding: 1rem;
}
.apt-student-tile-id {
  min-width: 0;
}
.apt-student-tile-email {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.apt-student-tile-status {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.3;
  border-radius: 999px;
}
.apt-student-tile-status.is-active {
  background: #e0f2fe;
  color: #0369a1;
}
.apt-student-tile-status.is-pending {
  background: #fef3c7;
  color: #b45309;
}
.apt-student-tile-meta,
.apt-student-tile-child {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  overflow-wrap: anywhere;
}
.apt-student-tile-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.apt-student-tile-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e3a8a;
  background: #eef2ff;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
}
.apt-student-tile-code-exp {
  font-size: 0.65rem;
  color: #94a3b8;
}
.apt-student-tile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.apt-student-tile-actions a {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.25rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  color: #1e3a8a;
  text-decoration: none;
  background: #fff;
}
.apt-student-tile-actions a:hover {
  background: #f8fafc;
  border-color: #c7d2fe;
}
.apt-student-tile-actions button {
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0.25rem 0.15rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #1e3a8a;
}
.apt-student-tile-actions .apt-student-tile-remove {
  color: #f87171;
  margin-left: auto;
}
.apt-student-tile-actions .apt-student-tile-remove:hover {
  color: #dc2626;
}
@media (min-width: 768px) {
  .apt-student-tile {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .apt-student-tile-actions {
    justify-content: flex-end;
    max-width: 14rem;
  }
  .apt-student-tile-actions .apt-student-tile-remove {
    margin-left: 0;
  }
}

/* In-tile carousel (parent Tutor Assignments pattern, Studio tokens) */
.apt-carousel { position: relative; }
.apt-carousel-viewport {
  overflow: hidden;
  touch-action: pan-y;
  width: 100%;
  border-radius: 14px;
  outline: none;
}
.apt-carousel-viewport:focus-visible {
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28);
}
.apt-carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.38s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}
.apt-carousel-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.apt-carousel-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.apt-carousel-nav {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(30, 58, 138, 0.16);
  background: #fff;
  color: #1e3a8a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.35);
}
.apt-carousel-nav:hover:not(:disabled) { background: #eef2ff; }
.apt-carousel-nav:disabled { opacity: 0.28; cursor: default; box-shadow: none; }
.apt-carousel-dots { display: flex; align-items: center; gap: 6px; }
.apt-carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}
.apt-carousel-dot.active { width: 18px; background: #fbbf24; }
.apt-carousel-page-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.apt-attn-chip {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(247, 244, 238, 0.8);
  border: 1px solid rgba(30, 58, 138, 0.06);
}
.apt-attn-chip.is-plain { background: transparent; }
.apt-attn-chip.is-plain:hover { background: #f8fafc; }
.apt-dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.apt-dismiss:hover { background: #fee2e2; color: #b91c1c; }
.apt-feed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.apt-feed-filters select {
  padding: 0.4rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: #fff;
  color: #0f172a;
}
.apt-list-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.apt-list-pager button {
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(30, 58, 138, 0.16);
  background: #fff;
  color: #1e3a8a;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.apt-list-pager button:disabled { opacity: 0.35; cursor: default; }
.apt-results-table { width: 100%; font-size: 0.875rem; }
.apt-results-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  font-weight: 600;
  padding-bottom: 0.5rem;
}
.apt-results-table td { padding: 0.6rem 0; border-top: 1px solid #f1f5f9; }
.apt-view-all {
  display: none;
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e3a8a;
  text-decoration: none;
}
.apt-view-all.is-on { display: inline-flex; }
.apt-view-all:hover { text-decoration: underline; }

.apt-quiz-switch {
  display: flex;
  width: 100%;
  max-width: 22rem;
  padding: 3px;
  border-radius: 0.75rem;
  background: #e8eef8;
  border: 1px solid rgba(30, 58, 138, 0.1);
}
.apt-quiz-switch-tab {
  flex: 1;
  text-align: center;
  padding: 0.45rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
}
.apt-quiz-switch-tab.on {
  background: #1e3a8a;
  color: #fff;
}

.apt-help-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 80;
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease;
}
.apt-help-overlay.open { opacity: 1; visibility: visible; }
.apt-help-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(28rem, 100%);
  background: #fff; z-index: 81; transform: translateX(100%);
  transition: transform 0.25s ease; overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,0.08);
}
.apt-help-drawer.open { transform: translateX(0); }
.apt-help-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; background: #fff;
}
.apt-help-body { padding: 1.25rem; }
