:root {
  --bg-deep: #07132d;
  --bg-mid: #0c1d45;
  --surface: rgba(9, 21, 50, 0.78);
  --panel: rgba(12, 28, 66, 0.82);
  --card: rgba(255, 255, 255, 0.1);
  --line: rgba(177, 201, 255, 0.28);
  --ink: #edf4ff;
  --muted: #b8c8ea;
  --tone: #4f83ff;
  --tone-deep: #2556c4;
  --tone-soft: #9bb8ff;
  --tone-border: #6f98ff;
  --tone-bg: rgba(79, 131, 255, 0.2);
  --shadow: 0 24px 50px rgba(2, 10, 28, 0.54);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(79, 131, 255, 0.28), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(31, 186, 210, 0.2), transparent 35%),
    linear-gradient(145deg, var(--bg-deep) 0%, var(--bg-mid) 56%, #081633 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 52% 12%, black 28%, transparent 84%);
  z-index: -1;
}

body.area-student {
  --tone: #4f83ff;
  --tone-deep: #2556c4;
}

body.area-parents {
  --tone: #25a372;
  --tone-deep: #137a4f;
  --tone-soft: #8be2be;
  --tone-border: #4ccf93;
  --tone-bg: rgba(37, 163, 114, 0.2);
}

body.area-school {
  --tone: #c9852d;
  --tone-deep: #8e5b1d;
  --tone-soft: #f5c688;
  --tone-border: #e4a24a;
  --tone-bg: rgba(201, 133, 45, 0.2);
}

body.area-teacher {
  --tone: #7a3fd9;
  --tone-deep: #4a2292;
  --tone-soft: #ceb4ff;
  --tone-border: #9f79e8;
  --tone-bg: rgba(122, 63, 217, 0.2);
}

.shell {
  width: min(1280px, 95vw);
  margin: 14px auto 22px;
  display: grid;
  gap: 12px;
}

.shell-head,
.quick-grid,
.frame-wrap {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.shell-head {
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  background: linear-gradient(145deg, var(--surface), rgba(10, 26, 58, 0.85));
  padding: 18px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--tone-soft);
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 800;
}

h1 {
  margin: 6px 0 8px;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.55rem, 2.4vw, 2.3rem);
  line-height: 1.04;
}

.shell-copy {
  margin: 0;
  color: var(--muted);
  max-width: 74ch;
}

.shell-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 9px 13px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.1);
}

.btn.primary {
  background: linear-gradient(125deg, var(--tone), var(--tone-deep));
}

.btn.soft {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e9f0ff;
}

.btn.ghost {
  background: rgba(7, 17, 40, 0.64);
  border: 1px solid rgba(177, 201, 255, 0.32);
  color: #d8e6ff;
}

.update-note {
  margin: 10px 0 0;
  border-radius: 12px;
  border: 1px solid var(--tone-border);
  background: var(--tone-bg);
  color: #d6e6ff;
  padding: 10px 12px;
  font-size: 13px;
}

.head-panel {
  border: 1px solid rgba(182, 205, 255, 0.26);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(15, 35, 81, 0.92), rgba(9, 24, 58, 0.9));
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.head-panel h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
}

.meta-line {
  margin: 0;
  font-size: 13px;
  color: #d6e5ff;
}

.meta-grid {
  display: grid;
  gap: 8px;
}

.meta-grid div {
  border: 1px solid rgba(197, 216, 255, 0.18);
  border-radius: 11px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.meta-grid strong {
  display: block;
  font-size: 12px;
  color: #bcd0fb;
  margin-bottom: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta-grid span {
  display: block;
  color: #f0f5ff;
  font-size: 13px;
}

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

.quick-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(165deg, var(--panel), rgba(8, 21, 49, 0.88));
  box-shadow: var(--shadow);
  padding: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.quick-card:hover {
  border-color: var(--tone-border);
}

.quick-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #d9e7ff;
}

.quick-number {
  margin: 8px 0 4px;
  font-family: "Outfit", sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  color: #ffffff;
}

.quick-card p {
  margin: 0;
  color: #b8c8ea;
  font-size: 13px;
}

.frame-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(9, 20, 44, 0.92), rgba(7, 15, 34, 0.9));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.frame-head {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(179, 201, 249, 0.24);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.frame-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #dbe7ff;
}

.frame-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-btn,
.switch-btn {
  border: 1px solid rgba(182, 205, 255, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e7f0ff;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.tool-btn:hover,
.switch-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.switch-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.switch-btn.is-active {
  background: linear-gradient(125deg, var(--tone), var(--tone-deep));
  border-color: transparent;
  color: #fff;
}

.frame-body {
  height: calc(100vh - 300px);
  min-height: 560px;
}

.frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  transition: opacity 0.2s ease;
}

.frame-wrap.is-collapsed .frame-body {
  min-height: 0;
  height: 0;
}

.frame-wrap.is-collapsed iframe {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1120px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .shell {
    width: min(1280px, 96vw);
  }

  .shell-head {
    grid-template-columns: 1fr;
  }

  .frame-body {
    height: calc(100vh - 360px);
    min-height: 500px;
  }
}

@media (max-width: 640px) {
  .shell {
    margin-top: 10px;
    gap: 10px;
  }

  .shell-head,
  .frame-wrap,
  .quick-card {
    border-radius: 13px;
  }

  .shell-head {
    padding: 14px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .frame-body {
    height: calc(100vh - 430px);
    min-height: 440px;
  }
}

.shell-profile-corner {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 70;
}

.shell-profile-btn {
  border: 1px solid rgba(192, 213, 255, 0.5);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
  color: #eaf1ff;
  background: rgba(8, 22, 54, 0.9);
  cursor: pointer;
}

.shell-profile-menu {
  margin-top: 8px;
  width: min(330px, 92vw);
  border: 1px solid rgba(189, 209, 251, 0.52);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(10, 26, 58, 0.98), rgba(8, 21, 49, 0.96));
  box-shadow: var(--shadow);
  padding: 12px;
}

.shell-profile-menu h3 {
  margin: 0 0 8px;
  font-family: "Outfit", sans-serif;
  font-size: 1.02rem;
}

.shell-profile-grid {
  display: grid;
  gap: 5px;
}

.shell-profile-grid p {
  margin: 0;
  font-size: 13px;
  color: #d3e1fd;
}

.shell-profile-grid strong {
  color: #aecaef;
}

.shell-profile-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shell-profile-actions .tool-btn {
  border-radius: 10px;
}

@media (max-width: 760px) {
  .shell-profile-corner {
    top: 8px;
    left: 8px;
  }

  .shell-profile-btn {
    padding: 7px 11px;
    font-size: 13px;
  }
}
