:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --soft: #eef2f7;
  --brand: #2f56d9;
  --brand-dark: #2446b4;
  --danger: #b42318;
  --ok: #2f6f3e;
}

/* Ensure main and section elements don't constrain layout */
main#app.shell,
section#loginView {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
}

* { box-sizing: border-box; }
button, input, textarea, select {
  font: inherit;
}
button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 8px 11px;
  cursor: pointer;
}
button:hover { border-color: var(--brand); }
button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
button.primary:hover { background: var(--brand-dark); }
button.ghost { background: transparent; }
button.small { padding: 5px 8px; font-size: 12px; }
button.google {
  background: #fff;
  border-color: #dadce0;
  color: #343434;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button.google:hover {
  background: #f8f9fa;
  border-color: #d2d2d2;
}
button.google::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234285f4' d='M45.1 24.5c0-1.1-.1-2.2-.2-3.3H24v6.2h11.4c-.5 2.7-2.1 5-4.5 6.6v5.5h6.8c4-3.6 6.2-8.9 6.2-14.9z'/%3E%3Cpath fill='%2334a853' d='M24 46c5.5 0 10.4-1.8 14-4.9l-6.8-5.5c-1.9 1.3-4.2 2-6.6 2-5.1 0-9.5-3.4-10.9-8.1h-6.9v6.9C14.5 41.6 18.9 46 24 46z'/%3E%3Cpath fill='%23fbbc05' d='M13.1 28.6c-.4-1.2-.6-2.5-.6-3.8s.2-2.6.6-3.8V14.2h-6.9c-2 1.2-3.7 3-4.9 5.1l-.6 1.5c-.2.5-.2 1-.2 1.5s0 .9.2 1.4l.6 1.5c1.2 2.1 2.9 3.9 4.9 5.1l6.9-5.4z'/%3E%3Cpath fill='%23ea4335' d='M24 14.6c2.9 0 5.5 1 7.5 3l5.6-5.6C31.5 8.8 27.9 7 24 7c-5.1 0-9.5 3.4-11.4 8.1l-6.9 5.4c.4 1.2.6 2.5.6 3.8s.6 2.5.6 3.8l6.9 5.4c1.9 4.7 6.3 8.1 11.4 8.1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 9px;
}
textarea { resize: vertical; line-height: 1.5; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.micro {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.brand {
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 700;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(23, 32, 51, .08);
  display: grid;
  gap: 15px;
}
.login-panel h1 { margin: 0; font-size: 24px; }
.login-panel p { margin: 0 0 4px; color: var(--muted); line-height: 1.5; }
.error { color: var(--danger); min-height: 18px; }
.workspace {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 56px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.top-actions { display: flex; gap: 10px; align-items: center; }
.project-strip {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto 1fr;
  gap: 12px;
  align-items: end;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.project-meta { color: var(--muted); line-height: 1.4; }
.main-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  padding: 14px 18px 18px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
}
.list-panel { overflow: hidden; display: flex; flex-direction: column; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-head.inline { border-bottom: 0; padding: 0 0 12px; }
.panel-head h2 { margin: 0; font-size: 14px; }
.assessment-list, .skill-list, .question-list {
  overflow: auto;
  padding: 8px;
}
.item {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px;
  cursor: pointer;
  display: grid;
  gap: 3px;
}
.item:hover { background: var(--soft); }
.item.active {
  border-color: var(--brand);
  background: #eef3ff;
}
.item-title { font-weight: 650; }
.editor-panel { overflow: auto; }
.empty {
  min-height: 520px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.editor { min-height: 100%; }
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  background: #fafbfe;
  position: sticky;
  top: 0;
  z-index: 1;
}
.tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}
.tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.tab { display: none; padding: 18px; }
.tab.active { display: block; }
.editor-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.title-input { font-size: 22px; font-weight: 650; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.block { margin-top: 12px; }
.transcript { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.split {
  display: grid;
  grid-template-columns: minmax(260px, 34%) 1fr;
  gap: 16px;
}
.split.questions { grid-template-columns: minmax(260px, 40%) 1fr; }
.subeditor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 420px;
}
.subeditor h3 { margin: 0 0 12px; }
.subeditor .stack { display: grid; gap: 12px; }
.hint-list, .rubric-list { display: grid; gap: 7px; }
.chip-row { display: flex; gap: 7px; align-items: center; }
.chip-row input { flex: 1; }
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.grade-A { background: #e6f0ff; color: #174ea6; }
.grade-B { background: #e8f5df; color: #27600f; }
.grade-C { background: #fff0d9; color: #8a4f00; }
.question-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px auto auto auto auto;
  gap: 8px;
  margin-bottom: 14px;
}
.terminal {
  background: #111827;
  color: #d1d5db;
  min-height: 360px;
  border-radius: 8px;
  padding: 14px;
  white-space: pre-wrap;
  overflow: auto;
}
#saveBtn, #downloadInstructionsBtn {
  position: relative;
  z-index: 10;
}
.publish-wrapper {
  display: grid;
  gap: 18px;
}

.publish-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.settings-form {
  display: flex;
  gap: 24px;
  margin-top: 6px;
}
.settings-left, .settings-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.settings-form input[type="number"] {
  max-width: 150px;
}
.settings-form select {
  min-width: 120px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.validation { padding-left: 18px; color: var(--danger); }
.linkbox {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 6px;
  padding: 10px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #172033;
  color: white;
  border-radius: 7px;
  padding: 10px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s;
}
.toast.show { opacity: 1; }

@media (max-width: 980px) {
  .main-grid, .split, .split.questions, .publish-grid { grid-template-columns: 1fr; }
  .project-strip { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .question-toolbar { grid-template-columns: 1fr 1fr; }
  .settings-form { flex-direction: column; }
}

/* Premium Performance tab styling matching the my-assessments structure and layout */
.performance-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.stat-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.performance-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}
.performance-row {
  display: grid;
  /* Columns: Student/Email | Project ID / Task | Score | Play Button */
  grid-template-columns: 2fr 1.5fr 100px 90px;
  gap: 14px;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.1s ease;
}
.performance-row:hover:not(.performance-row-head) {
  background-color: var(--soft);
}
.performance-row:last-child {
  border-bottom: none;
}
.performance-row-head {
  background: #F9FAFB;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.col-student {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-assessment {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-score {
  font-weight: 700;
  color: var(--brand);
  font-size: 14px;
}
.col-action {
  text-align: right;
}
.performance-play-btn {
  background: var(--brand);
  color: #fff;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.performance-play-btn:hover {
  background: var(--brand-dark) !important;
}


