:root {
  --bg: #fcf8ff;
  --bg-soft: #f5f2ff;
  --panel: rgba(255, 255, 255, 0.58);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --text: #1b1b24;
  --muted: #5e5d70;
  --line: rgba(119, 117, 135, 0.22);
  --primary: #3525cd;
  --primary-2: #4f46e5;
  --green: #00714d;
  --yellow: #a16207;
  --red: #ba1a1a;
  --chip: #e2dfff;
  --shadow: 0 24px 70px rgba(77, 68, 227, 0.14);
  --glass-blur: blur(22px);
}

[data-theme="dark"] {
  --bg: #0b1326;
  --bg-soft: #131b2e;
  --panel: rgba(30, 41, 59, 0.62);
  --panel-strong: rgba(30, 41, 59, 0.84);
  --text: #dae2fd;
  --muted: #bbc9cd;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #22d3ee;
  --primary-2: #6366f1;
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #fb7185;
  --chip: rgba(34, 211, 238, 0.12);
  --shadow: 0 24px 80px rgba(34, 211, 238, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, var(--bg), var(--bg-soft));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body,
.panel,
.metric,
.course-item,
.assignment-item,
.graph-node,
.tab-button,
.hub-card {
  transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 180ms ease, opacity 180ms ease;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
}

.brand,
.top-actions,
.button-row,
.status-line,
.item-actions,
.action-strip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.26);
  touch-action: manipulation;
  user-select: none;
}

.brand-mark img {
  width: 30px;
  height: 30px;
  display: block;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  letter-spacing: 0;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 20px;
  margin: 28px 0 20px;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.55fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}

.auth-panel h2 {
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.auth-panel p {
  margin-top: 10px;
  color: var(--muted);
}

.user-pill {
  max-width: 220px;
  overflow: hidden;
  padding: 9px 12px;
  color: var(--primary);
  background: var(--chip);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-copy,
.panel,
.metric,
.diagnostics {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
}

.hero-copy {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 28px;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
}

.overview-grid,
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1;
}

.metric.glow strong {
  color: var(--primary);
}

.app-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

.app-view.view-courses {
  grid-template-columns: 340px minmax(0, 1fr);
}

.app-tabs {
  position: sticky;
  top: 92px;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
}

.tab-button {
  min-height: 44px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 900;
}

.tab-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--primary), transparent 78%);
}

.view-section {
  display: none !important;
}

.view-section.active {
  display: block !important;
}

.sidebar.view-section.active,
.home-hub.view-section.active,
.metrics.view-section.active,
.workspace.view-section.active,
.quick-panel.view-section.active,
.graph-panel.view-section.active {
  display: grid !important;
}

.hero-panel.view-section.active,
.action-strip.view-section.active {
  display: flex !important;
}

.sidebar,
.content,
.workspace {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 18px;
}

.tools-panel {
  display: grid;
  gap: 12px;
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 10px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-strong), var(--bg) 22%);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--primary), white 10%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary), transparent 82%);
}

.primary,
.ghost,
.icon-button,
.mini {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 1px solid transparent;
  padding: 0 16px;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.24);
}

.ghost,
.icon-button,
.mini {
  color: var(--text);
  background: color-mix(in srgb, var(--panel-strong), transparent 16%);
  border: 1px solid var(--line);
  padding: 0 13px;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.language-select {
  width: 76px;
  min-height: 42px;
  font-weight: 900;
}

.mini {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 0.82rem;
}

button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary), white 20%);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.ghost.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary), transparent 76%);
}

.danger {
  color: var(--red);
}

.danger-primary {
  background: linear-gradient(135deg, var(--red), color-mix(in srgb, var(--red), var(--primary) 35%));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--red), transparent 76%);
}

.course-list {
  box-shadow: none;
}

.course-item,
.assignment-item {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel-strong), transparent 8%);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.course-item.active {
  border-color: color-mix(in srgb, var(--primary), white 20%);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--primary), transparent 84%);
}

.course-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chip {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--chip);
  font-size: 0.74rem;
  font-weight: 900;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.hero-panel p:last-child {
  color: var(--muted);
  margin-top: 8px;
}

.home-hub {
  gap: 16px;
}

.hub-panel {
  display: grid;
  gap: 18px;
}

.hub-panel h2 {
  margin-top: 4px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.hub-panel p {
  margin-top: 8px;
  color: var(--muted);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hub-card {
  min-height: 116px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  padding: 16px;
  color: var(--text);
  text-align: left;
  background: color-mix(in srgb, var(--panel-strong), transparent 10%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.08);
}

.hub-card span {
  color: var(--muted);
  font-weight: 850;
}

.hub-card strong {
  color: var(--primary);
  font-size: 2rem;
  line-height: 1;
}

.quick-panel {
  display: grid;
  gap: 14px;
}

.ai-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: color-mix(in srgb, var(--panel-strong), transparent 18%);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.ai-panel h2 {
  margin-top: 3px;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.ai-panel p {
  margin-top: 6px;
  color: var(--muted);
}

.assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.assistant-answer {
  min-height: 82px;
  padding: 14px;
  white-space: pre-wrap;
  color: var(--text);
  background: color-mix(in srgb, var(--bg), transparent 28%);
  border: 1px solid var(--line);
  border-radius: 16px;
  line-height: 1.5;
}

.quick-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.quick-head h2 {
  margin-top: 3px;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.quick-tip {
  max-width: 360px;
  color: var(--muted);
  text-align: right;
  font-size: 0.9rem;
  font-weight: 750;
}

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

.quick-grid .ghost {
  min-width: 0;
  padding-inline: 10px;
}

.score-ring {
  flex: 0 0 128px;
  width: 128px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0deg, color-mix(in srgb, var(--line), transparent 10%) 0deg);
  color: var(--text);
  font-weight: 900;
}

.score-ring span {
  width: 88px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-strong);
  font-size: 1.35rem;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line), transparent 20%);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.workspace {
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
}

.graph-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.graph-header,
.graph-actions,
.todo-form {
  display: flex;
  align-items: end;
  gap: 12px;
}

.graph-header {
  justify-content: space-between;
  align-items: center;
}

.graph-header h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.todo-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(130px, 0.45fr) minmax(180px, 1fr) auto;
  padding: 12px;
  background: color-mix(in srgb, var(--panel-strong), transparent 18%);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.todo-form-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.graph-stage {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  cursor: grab;
  background:
    radial-gradient(circle at 18px 18px, color-mix(in srgb, var(--primary), transparent 76%) 1.5px, transparent 2px),
    linear-gradient(135deg, color-mix(in srgb, var(--bg-soft), transparent 22%), color-mix(in srgb, var(--panel-strong), transparent 45%));
  background-size: 36px 36px, 100% 100%;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white, transparent 82%), inset 0 -40px 120px color-mix(in srgb, var(--primary), transparent 94%);
  touch-action: none;
}

.graph-stage.panning {
  cursor: grabbing;
}

.graph-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.graph-stage svg,
.graph-stage #graphNodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.graph-line {
  stroke: color-mix(in srgb, var(--primary), transparent 12%);
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0.85;
  filter: drop-shadow(0 8px 10px color-mix(in srgb, var(--primary), transparent 82%));
}

.graph-node {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 4px;
  width: 145px;
  min-height: 62px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel-strong), white 10%), color-mix(in srgb, var(--panel-strong), transparent 4%));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(31, 41, 55, 0.12);
  touch-action: none;
  will-change: left, top, transform;
}

.graph-node:hover {
  transform: translateY(-2px);
}

.zoom-pill {
  min-width: 58px;
  padding: 9px 10px;
  color: var(--primary);
  background: var(--chip);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
}

.graph-node strong,
.graph-node span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-node span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.graph-node.active {
  border-color: var(--primary);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--primary), transparent 72%);
}

.graph-node.link-source {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
}

.graph-node.link-source span {
  color: rgba(255, 255, 255, 0.78);
}

.graph-node.todo {
  border-left: 5px solid var(--red);
}

.graph-node.doing {
  border-left: 5px solid var(--yellow);
}

.graph-node.done {
  border-left: 5px solid var(--green);
}

.graph-empty {
  position: absolute;
  left: 24px;
  top: 24px;
  color: var(--muted);
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.assignments {
  display: grid;
  gap: 10px;
}

.badge {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.green {
  background: var(--green);
}

.yellow {
  background: var(--yellow);
}

.red {
  background: var(--red);
}

.message {
  min-height: 20px;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
}

.diagnostics {
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.82rem;
}

.diagnostics summary {
  cursor: pointer;
  font-weight: 900;
}

.diagnostics ul {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  margin: 8px 0 0;
  padding-left: 18px;
}

.diagnostics .warn {
  color: var(--yellow);
}

.diagnostics .info {
  color: var(--muted);
}

.success {
  color: var(--green);
}

.loader {
  position: fixed;
  right: 20px;
  bottom: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 10, 22, 0.54);
  backdrop-filter: blur(16px);
}

.confirm-card {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.confirm-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--primary));
  border-radius: 14px;
  font-weight: 950;
}

.confirm-card h2 {
  font-size: 1.2rem;
}

.confirm-card p {
  margin-top: 6px;
  color: var(--muted);
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.focus-mode .sidebar,
.focus-mode .overview,
.focus-mode .diagnostics,
.focus-mode .action-strip,
.focus-mode .workspace {
  display: none;
}

.focus-mode .app-view {
  grid-template-columns: 1fr;
}

.focus-mode .content {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.compact-mode .panel,
.compact-mode .metric,
.compact-mode .course-item,
.compact-mode .assignment-item {
  padding: 12px;
  border-radius: 16px;
}

.compact-mode .shell {
  padding-top: 12px;
}

.compact-mode .content,
.compact-mode .sidebar,
.compact-mode .workspace {
  gap: 10px;
}

body.secret-open {
  overflow: hidden;
}

.secret-love {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  color: #fff7fb;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 170, 211, 0.9), transparent 24%),
    radial-gradient(circle at 82% 14%, rgba(163, 111, 255, 0.74), transparent 26%),
    radial-gradient(circle at 55% 88%, rgba(255, 214, 102, 0.5), transparent 24%),
    linear-gradient(135deg, #170520 0%, #3d0b3c 42%, #8a174d 100%);
}

.secret-love::before,
.secret-love::after {
  content: "";
  position: absolute;
  width: 58vmin;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 38% 62% 48% 52%;
  filter: blur(0.2px);
  animation: secretOrbit 18s linear infinite;
}

.secret-love::before {
  top: -14vmin;
  left: -10vmin;
}

.secret-love::after {
  right: -16vmin;
  bottom: -18vmin;
  animation-direction: reverse;
}

.secret-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.secret-sky span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 28px 8px rgba(255, 255, 255, 0.5);
  animation: secretFloat 7s ease-in-out infinite;
}

.secret-sky span:nth-child(1) {
  left: 14%;
  top: 22%;
}

.secret-sky span:nth-child(2) {
  left: 78%;
  top: 24%;
  animation-delay: -1.4s;
}

.secret-sky span:nth-child(3) {
  left: 30%;
  top: 76%;
  animation-delay: -2.8s;
}

.secret-sky span:nth-child(4) {
  left: 68%;
  top: 72%;
  animation-delay: -4s;
}

.secret-sky span:nth-child(5) {
  left: 50%;
  top: 12%;
  animation-delay: -5s;
}

.secret-card {
  position: relative;
  width: min(880px, 100%);
  height: min(92vh, 980px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
  overflow: visible;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)),
    rgba(32, 8, 42, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 34px;
  box-shadow: 0 36px 120px rgba(19, 1, 25, 0.55);
  backdrop-filter: blur(28px);
  animation: secretRise 680ms cubic-bezier(0.2, 0.9, 0.18, 1) both;
}

.secret-card::before {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, 0.22) 45%, transparent 56% 100%);
  transform: translateX(-80%);
  animation: secretShine 4.8s ease-in-out infinite;
}

.secret-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: inherit;
}

.secret-scroll {
  min-height: 0;
  padding: clamp(28px, 6vw, 64px) clamp(28px, 6vw, 64px) 18px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.secret-dock {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding: 14px clamp(18px, 4vw, 40px) clamp(18px, 4vw, 34px);
  background:
    linear-gradient(180deg, transparent, rgba(31, 7, 42, 0.72) 18%, rgba(31, 7, 42, 0.86));
  border-radius: 0 0 34px 34px;
  backdrop-filter: blur(18px);
}

.secret-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 4;
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  font-weight: 900;
}

.secret-kicker {
  color: #ffd7e7;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.secret-card h2 {
  margin-top: 8px;
  font-size: clamp(4rem, 14vw, 9rem);
  line-height: 0.9;
  text-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
}

.secret-card h2 span {
  display: inline-block;
  background: linear-gradient(90deg, #fff, #ffd1e5, #fff2a8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 18px 44px rgba(255, 117, 178, 0.35));
}

.secret-lead {
  max-width: 720px;
  margin-top: 18px;
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 2.7rem);
  font-weight: 850;
  line-height: 1.08;
}

.secret-lines {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin-top: 28px;
  color: rgba(255, 247, 251, 0.88);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.secret-apology {
  display: grid;
  gap: 12px;
  max-width: 800px;
  margin-top: 30px;
  padding: 18px;
  color: rgba(255, 247, 251, 0.84);
  background: rgba(35, 8, 46, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  line-height: 1.62;
}

.secret-apology span {
  color: #ffd7e7;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.secret-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.secret-actions button {
  padding: 12px 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
    rgba(255, 122, 179, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(88, 5, 54, 0.26);
  font-weight: 900;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.secret-actions button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 18px 46px rgba(255, 122, 179, 0.34);
}

.secret-wish {
  min-height: 56px;
  padding: 14px 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  font-weight: 850;
  line-height: 1.35;
}

.secret-wish.pop {
  animation: secretPop 360ms ease both;
}

.secret-heart-meter {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 50%, rgba(255, 244, 169, 0.25), transparent 28%),
    linear-gradient(135deg, rgba(255, 136, 190, 0.32), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 28px 90px rgba(255, 91, 169, 0.22);
}

.secret-heart-meter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 38%, rgba(255, 255, 255, 0.28) 48%, transparent 58% 100%);
  transform: translateX(-100%);
  animation: secretMeterShine 3.6s ease-in-out infinite;
}

.secret-heart-meter span,
.secret-heart-meter strong,
.secret-heart-meter div,
.secret-heart-meter p {
  position: relative;
}

.secret-heart-meter span {
  color: #fff;
  font-weight: 950;
}

.secret-heart-meter div {
  height: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: inset 0 2px 10px rgba(40, 0, 35, 0.22);
}

.secret-heart-meter i {
  width: 0%;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #ff5f9f, #ffc1df, #fff2a8);
  border-radius: inherit;
  box-shadow: 0 0 26px rgba(255, 149, 199, 0.72);
  transition: width 520ms cubic-bezier(0.2, 0.9, 0.18, 1);
}

.secret-heart-meter strong {
  min-width: 84px;
  text-align: right;
  color: #fff;
  font-weight: 950;
}

.secret-heart-meter strong.pulse {
  animation: secret9999Pulse 520ms ease both;
}

.secret-heart-meter p {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(1.8rem, 7vw, 5rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  opacity: 0;
  transition: max-height 520ms ease, opacity 520ms ease, margin-top 520ms ease;
}

.secret-heart-meter p.show {
  max-height: 110px;
  margin-top: 12px;
  opacity: 1;
}

.secret-heart-meter.complete {
  animation: secretCompleteGlow 1.4s ease both;
}

.secret-signature {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.secret-signature span {
  color: #ffd7e7;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.secret-signature strong {
  font-size: clamp(1.5rem, 4vw, 3rem);
}

.secret-particle {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  color: #fff;
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  font-weight: 950;
  text-shadow: 0 8px 28px rgba(255, 62, 146, 0.76);
  animation: secretParticle 1400ms ease-out forwards;
}

.secret-love.wow-mode .secret-card {
  animation: secretWowCard 1600ms ease both;
}

.secret-love.wow-mode .secret-card::before {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.68), transparent 0 8%, rgba(255, 129, 194, 0.22) 18%, transparent 36%),
    linear-gradient(112deg, transparent 0 28%, rgba(255, 255, 255, 0.5) 43%, rgba(255, 242, 168, 0.36) 48%, transparent 62% 100%);
  animation: secretWowShine 1600ms ease both;
}

.secret-love.wow-mode .secret-card::after {
  border-color: rgba(255, 246, 188, 0.48);
  box-shadow:
    inset 0 0 46px rgba(255, 130, 194, 0.18),
    0 0 44px rgba(255, 227, 145, 0.2);
}

.secret-love.finale-active .secret-card {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 420ms ease, transform 420ms ease;
}

.secret-finale {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.2), transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(255, 76, 151, 0.6), transparent 32%),
    radial-gradient(circle at 16% 18%, rgba(255, 238, 168, 0.24), transparent 24%),
    radial-gradient(circle at 82% 80%, rgba(146, 94, 255, 0.32), transparent 25%),
    rgba(18, 0, 24, 0.82);
  backdrop-filter: blur(10px) saturate(1.25);
}

.secret-finale.show {
  pointer-events: auto;
  animation: secretFinaleFade 620ms ease both;
}

.secret-final-rings,
.secret-final-rings::before,
.secret-final-rings::after {
  position: absolute;
  inset: 50%;
  width: min(72vmin, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0.2);
}

.secret-final-rings {
  box-shadow:
    0 0 90px rgba(255, 126, 190, 0.34),
    inset 0 0 90px rgba(255, 255, 255, 0.08);
}

.secret-final-rings::before,
.secret-final-rings::after {
  content: "";
}

.secret-final-rings::before {
  width: 68%;
}

.secret-final-rings::after {
  width: 122%;
}

.secret-finale.show .secret-final-rings {
  animation: secretRings 3600ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.secret-final-panel {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(760px, calc(100vw - 32px));
  min-height: min(620px, calc(100vh - 48px));
  align-content: center;
  justify-items: center;
  padding: clamp(26px, 6vw, 68px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.32), transparent 28%),
    radial-gradient(circle at 18% 78%, rgba(255, 91, 169, 0.3), transparent 26%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: clamp(28px, 5vw, 54px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 42px 160px rgba(255, 112, 176, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(24px);
}

.secret-final-panel::before {
  content: "";
  position: absolute;
  inset: auto auto 18px 50%;
  width: min(420px, 70vw);
  height: 120px;
  background: radial-gradient(ellipse, rgba(255, 100, 171, 0.52), transparent 68%);
  transform: translateX(-50%);
  filter: blur(12px);
}

.secret-finale.show .secret-final-panel {
  animation: secretQuestionRise 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.secret-final-panel p,
.secret-final-panel h2,
.secret-final-panel span,
.secret-final-choice {
  position: relative;
}

.secret-final-panel p {
  color: #fff2a8;
  font-size: clamp(2.8rem, 10vw, 8rem);
  font-weight: 950;
  line-height: 0.9;
  text-shadow: 0 18px 54px rgba(255, 112, 176, 0.56);
}

.secret-final-panel h2 {
  max-width: 660px;
  color: #fff;
  font-size: clamp(2rem, 6vw, 5.4rem);
  line-height: 0.96;
  text-shadow: 0 18px 54px rgba(40, 0, 32, 0.48);
}

.secret-final-panel span {
  max-width: 620px;
  color: rgba(255, 247, 251, 0.88);
  font-size: clamp(1.1rem, 3vw, 2rem);
  font-weight: 900;
}

.secret-final-choice {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  margin-top: 8px;
  overflow: visible;
}

.secret-final-choice button {
  min-width: 128px;
  padding: 15px 24px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  box-shadow: 0 22px 52px rgba(40, 0, 32, 0.28);
  font-size: 1.05rem;
  font-weight: 950;
}

.secret-yes {
  background: linear-gradient(135deg, #ff4f9a, #ffb2d4);
}

.secret-no {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(var(--no-x, 0), var(--no-y, 0));
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.18, 1);
  will-change: transform;
}

.secret-final-words span {
  position: absolute;
  left: 50%;
  top: 50%;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 3vw, 2rem);
  font-weight: 950;
  text-shadow: 0 12px 34px rgba(255, 82, 154, 0.65);
  opacity: 0;
}

.secret-finale.show .secret-final-words span {
  animation: secretWordBurst 4600ms ease both infinite;
}

.secret-final-words span:nth-child(1) {
  --tx: -42vw;
  --ty: -28vh;
}

.secret-final-words span:nth-child(2) {
  --tx: 28vw;
  --ty: -34vh;
  animation-delay: 120ms;
}

.secret-final-words span:nth-child(3) {
  --tx: -34vw;
  --ty: 26vh;
  animation-delay: 220ms;
}

.secret-final-words span:nth-child(4) {
  --tx: 34vw;
  --ty: 28vh;
  animation-delay: 320ms;
}

.secret-final-words span:nth-child(5) {
  --tx: 0vw;
  --ty: -42vh;
  animation-delay: 420ms;
}

.secret-final-words span:nth-child(6) {
  --tx: 0vw;
  --ty: 38vh;
  animation-delay: 520ms;
}

.secret-finale-close {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 5vh, 54px);
  transform: translateX(-50%);
  padding: 12px 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  box-shadow: 0 20px 50px rgba(30, 0, 28, 0.32);
  font-weight: 950;
  backdrop-filter: blur(18px);
}

@keyframes secretRise {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes secretWowCard {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 36px 120px rgba(19, 1, 25, 0.55);
  }
  40% {
    transform: translateY(-5px) scale(1.014);
    box-shadow:
      0 42px 142px rgba(255, 99, 176, 0.46),
      0 0 78px rgba(255, 239, 153, 0.34),
      0 0 0 1px rgba(255, 249, 196, 0.46),
      inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }
  68% {
    transform: translateY(-2px) scale(1.006);
    box-shadow:
      0 38px 132px rgba(255, 168, 215, 0.34),
      0 0 52px rgba(255, 246, 188, 0.24),
      0 0 0 1px rgba(255, 255, 255, 0.3);
  }
}

@keyframes secretWowShine {
  0% {
    opacity: 0;
    transform: translateX(-64%) rotate(-2deg);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(58%) rotate(-2deg);
  }
}

@keyframes secretFinaleFade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes secretQuestionRise {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.94);
  }
  70% {
    opacity: 1;
    transform: translateY(-4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes secretRings {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.25) rotate(180deg);
  }
}

@keyframes secretWordBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
  16% {
    opacity: 1;
  }
  72% {
    opacity: 1;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.18);
  }
}

@keyframes secretMeterShine {
  0%,
  42% {
    transform: translateX(-100%);
  }
  70%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes secretCompleteGlow {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      0 28px 90px rgba(255, 91, 169, 0.22);
  }
  45% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      0 0 0 8px rgba(255, 255, 255, 0.14),
      0 42px 130px rgba(255, 190, 222, 0.5);
  }
}

@keyframes secret9999Pulse {
  0% {
    transform: scale(0.96);
  }
  65% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes secretPop {
  0% {
    transform: scale(0.96);
    opacity: 0.45;
  }
  70% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes secretParticle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72) rotate(-8deg);
  }
  14% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -150px) scale(1.35) rotate(12deg);
  }
}

@keyframes secretFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-26px) scale(1.7);
    opacity: 1;
  }
}

@keyframes secretOrbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes secretShine {
  0%,
  45% {
    transform: translateX(-70%);
  }
  70%,
  100% {
    transform: translateX(70%);
  }
}

@media print {
  .topbar,
  .sidebar,
  .quick-panel,
  .action-strip,
  .todo-form,
  .graph-actions,
  .loader,
  .modal-backdrop,
  .diagnostics {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .shell,
  .content {
    width: 100%;
    padding: 0;
  }

  .app-view,
  .workspace {
    display: block;
  }

  .panel,
  .metric {
    box-shadow: none;
    break-inside: avoid;
  }
}

@media (max-width: 980px) {
  .overview,
  .auth-panel,
  .app-view,
  .app-view.view-courses,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .app-tabs {
    position: static;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1280px);
    padding-top: 12px;
  }

  .overview-grid,
  .metrics,
  .form-grid,
  .tool-row,
  .hub-grid,
  .app-tabs,
  .quick-grid,
  .assistant-form,
  .todo-form {
    grid-template-columns: 1fr;
  }

  .quick-head {
    flex-direction: column;
  }

  .quick-tip {
    text-align: left;
  }

  .todo-form-actions,
  .graph-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .secret-love {
    padding: 14px;
  }

  .secret-card {
    border-radius: 24px;
    height: 94vh;
  }

  .secret-scroll {
    padding: 24px 20px 12px;
  }

  .secret-dock {
    border-radius: 0 0 24px 24px;
    padding: 12px;
  }

  .secret-actions {
    gap: 8px;
  }

  .secret-actions button {
    flex: 1 1 auto;
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .secret-wish {
    min-height: 0;
    padding: 11px 12px;
    font-size: 0.9rem;
  }

  .secret-signature {
    align-items: flex-start;
    flex-direction: column;
  }

  .secret-heart-meter {
    grid-template-columns: 1fr;
  }

  .secret-heart-meter strong {
    text-align: left;
  }
}
