:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #146c5f;
  --accent-2: #284b8f;
  --danger: #b42318;
  --wait: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(980px, calc(100vw - 24px));
  margin: 24px auto 48px;
  display: grid;
  gap: 16px;
}

.shell.wide {
  width: min(1180px, calc(100vw - 24px));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.topbar,
.section-head,
.task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

h1 {
  font-size: 22px;
}

h2 {
  font-size: 18px;
}

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

.admin-link,
button,
.download {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.download.secondary {
  background: #fff;
  color: var(--accent);
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

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

.identity {
  margin: 18px 0;
}

.identity-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 16px;
}

.identity-status {
  color: rgba(238, 246, 255, 0.76);
  font-size: 13px;
}

.card-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.task {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #ecfdf3;
  color: var(--accent);
  font-size: 12px;
}

.badge.wait {
  background: #fffaeb;
  color: var(--wait);
}

.badge.end {
  background: #f2f4f7;
  color: var(--muted);
}

.runtime {
  margin: 0;
  color: var(--wait);
  font-size: 13px;
  font-weight: 650;
}

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

.quick-regenerate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  width: 100%;
}

.quick-words,
.requirement-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 34px;
  padding: 7px 10px;
}

.result-row,
.event-row {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.result-list {
  display: grid;
  gap: 8px;
}

.result-panel {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  overflow: hidden;
}

.result-panel summary {
  cursor: pointer;
  padding: 10px 116px 10px 12px;
  font-weight: 650;
  color: var(--text);
}

.result-tools {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 0;
}

.result-tools .download {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
}

.result-text {
  margin: 0;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #fff;
  color: var(--text);
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.step-requirement {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.requirement-history {
  margin-top: 8px;
}

.events {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.note-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.auth-panel {
  max-width: 520px;
  margin: 12vh auto 0;
}

.auth-form {
  margin-top: 18px;
}

@media (max-width: 680px) {
  .grid-two,
  .topbar,
  .section-head,
  .task-title {
    grid-template-columns: 1fr;
    display: grid;
  }

  .actions {
    display: grid;
  }
}

body.student-app {
  min-height: 100vh;
  background: #071936 url("/assets/bg-a-8k.webp") center center / cover fixed no-repeat;
  color: #f7fbff;
  overflow-x: hidden;
}

body.student-app::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 0;
  width: min(520px, 58vw);
  background: linear-gradient(90deg, rgba(5, 16, 39, 0.26), rgba(5, 16, 39, 0.1) 64%, rgba(5, 16, 39, 0));
  pointer-events: none;
}

.student-app .hero-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  padding: 22px 30px 34px;
  pointer-events: none;
}

.student-app .hero-icons {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.student-app .hero-icons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.student-app .hero-icons button,
.student-app .hero-icons a {
  min-width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(234, 244, 255, 0.38);
  background: rgba(11, 30, 64, 0.26);
  color: #fff;
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 14px 38px rgba(0, 15, 46, 0.26);
  text-decoration: none;
}

.student-app .student-shell {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100vw - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(108px, 15vh, 150px) 0 64px;
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.student-app .panel {
  border-color: rgba(242, 249, 255, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.01), rgba(60, 115, 190, 0.01) 44%, rgba(4, 18, 48, 0.01));
  color: #f8fbff;
  -webkit-backdrop-filter: blur(5px) saturate(1.28);
  backdrop-filter: blur(5px) saturate(1.28);
  box-shadow: 0 18px 46px rgba(0, 12, 38, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.student-app .panel {
  border-radius: 12px;
  padding: 20px;
}

.student-app .task,
.student-app .step-requirement,
.student-app .note-box,
.student-app .result-panel {
  border-color: rgba(230, 243, 255, 0.28);
  background: rgba(5, 22, 52, 0.58);
  color: #f8fbff;
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.student-app .create-panel .admin-link {
  display: none;
}

.student-app .tasks-panel {
  max-height: calc(100vh - 360px);
  overflow: auto;
}

.student-app h2,
.student-app h3 {
  color: #fff;
}

.student-app p,
.student-app .muted,
.student-app label,
.student-app .events,
.student-app .empty {
  color: rgba(238, 246, 255, 0.76);
}

.student-app input,
.student-app textarea,
.student-app select {
  border-color: rgba(231, 242, 255, 0.3);
  background: rgba(5, 22, 52, 0.5);
  color: #fff;
  border-radius: 10px;
  outline: none;
  -webkit-backdrop-filter: blur(12px) saturate(1.16);
  backdrop-filter: blur(12px) saturate(1.16);
}

.student-app input::placeholder,
.student-app textarea::placeholder {
  color: rgba(232, 242, 255, 0.58);
}

.student-app input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(235, 245, 255, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(21, 55, 111, 0.42);
  color: #fff;
}

.student-app button,
.student-app .download,
.student-app .admin-link {
  border-color: rgba(228, 241, 255, 0.28);
  background: rgba(21, 55, 111, 0.42);
  color: #fff;
  border-radius: 10px;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 26px rgba(0, 14, 42, 0.18);
}

.student-app button:hover,
.student-app .download:hover,
.student-app .admin-link:hover {
  background: rgba(44, 86, 154, 0.5);
}

.student-app button.secondary,
.student-app .download.secondary,
.student-app .chip.secondary {
  background: rgba(5, 22, 52, 0.5);
  color: #f9fcff;
}

.student-app button.danger {
  border-color: rgba(255, 196, 196, 0.45);
  background: rgba(155, 47, 50, 0.45);
}

.student-app .badge {
  background: rgba(83, 221, 183, 0.18);
  color: #9ff8df;
}

.student-app .badge.wait {
  background: rgba(255, 213, 112, 0.18);
  color: #ffe1a1;
}

.student-app .badge.end {
  background: rgba(255, 255, 255, 0.13);
  color: rgba(238, 246, 255, 0.74);
}

.student-app .runtime {
  color: #ffe0a3;
}

.student-app .result-row,
.student-app .event-row,
.student-app .result-text {
  border-color: rgba(231, 242, 255, 0.18);
}

.student-app .result-panel summary {
  color: #fff;
}

.student-app .result-text {
  background: rgba(4, 16, 38, 0.62);
  color: #f8fbff;
}

.student-app .empty {
  border-color: rgba(231, 242, 255, 0.24);
  background: rgba(12, 30, 62, 0.2);
}

@media (max-width: 900px) {
  .student-app .student-shell {
    grid-template-columns: 1fr;
    padding-top: 128px;
  }

  .student-app .tasks-panel {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .student-app .hero-header {
    padding: 16px 16px 28px;
  }

  .student-app .hero-icons button,
  .student-app .hero-icons a {
    min-width: 40px;
    height: 40px;
    font-size: 12px;
  }

  .student-app .student-shell {
    width: min(100vw - 24px, 560px);
    padding-bottom: 42px;
  }
}
