:root {
  --bg: #f6f0e8;
  --bg-2: #fdf9f2;
  --ink: #1f1c1a;
  --ink-soft: #3f3a35;
  --accent: #e36f4c;
  --accent-2: #2f7f6d;
  --card: #fffdf8;
  --border: #1f1c1a;
  --shadow: #1f1c1a;
  --muted: #d9d0c4;
  --radius: 22px;
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Golos Text", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(800px 400px at 80% 10%, rgba(227, 111, 76, 0.22), transparent 60%),
    radial-gradient(600px 400px at 5% 80%, rgba(47, 127, 109, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 70%);
  min-height: 100vh;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background-image: radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
}

body::after {
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.04), transparent 60%);
  opacity: 0.6;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 6px 6px 0 var(--accent-2);
}

.nav-toggle-icon {
  width: 18px;
  height: 12px;
  position: relative;
  display: inline-block;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.nav-toggle-icon::before {
  top: 0;
}

.nav-toggle-icon::after {
  bottom: 0;
  box-shadow: 0 -5px 0 var(--ink);
}

.nav-open .nav-toggle {
  background: var(--ink);
  color: var(--bg-2);
  border-color: var(--ink);
}

.nav-open .nav-toggle-icon::before,
.nav-open .nav-toggle-icon::after {
  background: var(--bg-2);
  box-shadow: 0 -5px 0 var(--bg-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg-2);
  display: grid;
  place-items: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 18px;
}

.brand-title {
  font-weight: 700;
  font-family: var(--font-display);
  margin: 0;
  font-size: 20px;
}

.brand-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.site-nav {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--bg-2);
  box-shadow: 4px 4px 0 var(--shadow);
}

.site-header--simple .site-nav {
  display: none;
}

.site-header--simple .site-actions {
  display: none;
}

.nav-logout {
  margin: 0;
  display: inline-flex;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}


.nav-link:hover {
  border-color: var(--ink);
  background: rgba(31, 28, 26, 0.06);
}

.nav-link--active {
  background: var(--ink);
  color: var(--bg-2);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--accent);
}

.nav-link--active:hover {
  background: var(--ink);
  color: var(--bg-2);
  border-color: var(--ink);
}

.site-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.auth-page {
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.auth-hero {
  align-items: stretch;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: auto;
}

.auth-card:hover,
.auth-card:focus-within {
  transform: none;
  box-shadow: 10px 10px 0 var(--shadow);
}

.auth-form .card-actions {
  justify-content: flex-start;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0;
}

.card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-2);
  margin: 0;
}

.auth-note {
  border-radius: 16px;
  border: 1px dashed var(--ink);
  padding: 14px 16px;
  background: var(--bg-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-note-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  padding: 32px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 14px 14px 0 var(--shadow);
  position: relative;
}

.hero-compact {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.6fr);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  margin: 0 0 8px;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.05;
  margin: 0 0 12px;
}

.hero-text {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 20px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions--stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: start;
  justify-content: start;
}

.hero-actions--stack > * {
  width: 100%;
  margin: 0;
}

.hero-actions--stack form,
.hero-actions--stack a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-actions--stack form .btn {
  width: 100%;
}

.hero-actions--stack .btn {
  height: 44px;
  padding: 0 18px;
  line-height: 1;
}

.sync-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.session-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.session-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #8c7d6e;
  box-shadow: 0 0 0 2px var(--ink);
  display: inline-block;
  flex-shrink: 0;
}

.session-indicator[data-status="ok"] .session-dot {
  background: var(--accent-2);
}

.session-indicator[data-status="missing"] .session-dot,
.session-indicator[data-status="expired"] .session-dot {
  background: var(--accent);
}

.session-indicator[data-status="error"] .session-dot {
  background: #a12d2d;
}

.session-indicator[data-status="unknown"] .session-dot {
  background: #8c7d6e;
}

.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--ink-soft);
}

.meta-value {
  font-weight: 600;
}

.hero-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.hero-help {
  border-radius: 16px;
  border: 1px dashed var(--ink);
  background: rgba(255, 253, 248, 0.8);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.hero-help p {
  margin: 0 0 8px;
}

.hero-help p:last-child {
  margin-bottom: 0;
}

.hero-help strong {
  color: var(--ink);
  font-weight: 600;
}

.danger-card {
  border-color: #7a2d2d;
  box-shadow: 10px 10px 0 rgba(122, 45, 45, 0.35);
}

.danger-toggle {
  align-self: flex-start;
  border-color: #7a2d2d;
  color: #7a2d2d;
  font-weight: 700;
}

.reset-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.danger-submit {
  background: #7a2d2d;
  border-color: #7a2d2d;
  color: var(--bg-2);
}

.danger-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: nowrap;
  margin-bottom: 8px;
  min-width: 0;
}

.breadcrumbs {
  display: block;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.4;
  min-width: 0;
  width: 100%;
}

.breadcrumbs a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs-sep {
  color: var(--ink-soft);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  background: var(--bg-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--accent);
}

.btn-moodle {
  position: relative;
  border-color: var(--ink);
  background: var(--bg-2);
  box-shadow: none;
  font-weight: 600;
}

.btn-moodle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--ink);
  display: inline-block;
  margin-right: 8px;
}

.stat {
  background: var(--ink);
  color: var(--bg-2);
  padding: 18px;
  border-radius: 18px;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--accent);
}

.stat-value {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.stat-label {
  margin: 4px 0 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.8;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#automation {
  scroll-margin-top: 120px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
  margin: 0 0 6px;
}

.section-header p {
  margin: 0;
  color: var(--ink-soft);
}

.course-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.course-grid--single {
  grid-template-columns: 1fr;
}

.assignment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sync-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--card);
  box-shadow: 6px 6px 0 var(--shadow);
}

.sync-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--card);
  margin-top: 18px;
  box-shadow: 6px 6px 0 var(--shadow);
}

.sync-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

#sync-state,
#course-sync-state {
  white-space: pre-line;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--ink);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.progress-fill.indeterminate {
  width: 100%;
  background: linear-gradient(90deg, rgba(227, 111, 76, 0.4), rgba(47, 127, 109, 0.9), rgba(227, 111, 76, 0.4));
  background-size: 200% 100%;
  animation: progressShift 1.2s linear infinite;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--ink-soft);
  gap: 12px;
  flex-wrap: wrap;
}

.sync-card {
  min-height: 140px;
}

.status-pill {
  min-width: 84px;
  justify-content: center;
  text-align: center;
}

.needs-pill {
  background: var(--ink);
  color: var(--bg-2);
  text-transform: none;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.needs-label {
  font-weight: 600;
}

.needs-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.error-text {
  color: #a12d2d;
}

.card {
  background: var(--card);
  border-radius: 18px;
  border: 2px solid var(--ink);
  padding: 20px;
  box-shadow: 10px 10px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 160px;
  animation: riseIn 0.6s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 12px 12px 0 var(--accent-2);
}

.card:focus-within {
  transform: translateY(-3px);
  box-shadow: 12px 12px 0 var(--accent-2);
}

.course-card--settings {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.course-card--settings > * {
  position: relative;
  z-index: 1;
}

.course-card--settings.course-card--saving {
  opacity: 0.7;
}

.course-card--settings.course-card--error {
  border-color: #a12d2d;
  box-shadow: 10px 10px 0 rgba(161, 45, 45, 0.45);
}

.course-card--settings.course-card--hidden {
  background: #f1eadf;
  color: var(--ink-soft);
}

.course-card--settings.course-card--hidden::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(31, 28, 26, 0.12),
    rgba(31, 28, 26, 0.12) 8px,
    transparent 8px,
    transparent 16px
  );
  opacity: 0.35;
  pointer-events: none;
}

.course-card--settings.course-card--hidden h3 {
  color: var(--ink-soft);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.course-select {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.course-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.course-checkbox-ui {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: var(--bg-2);
  box-shadow: 2px 2px 0 var(--shadow);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.course-checkbox:checked + .course-checkbox-ui {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--accent-2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.card-meta {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.card-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.card-actions-link {
  margin-left: auto;
}

.settings-card {
  gap: 18px;
}

.model-form {
  gap: 20px;
}

.model-add {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.model-default-toggle {
  align-self: flex-start;
}

.model-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.model-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1.4fr) minmax(140px, 0.6fr) minmax(120px, 0.4fr);
  gap: 16px;
  align-items: end;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--bg-2);
  box-shadow: 4px 4px 0 var(--shadow);
}

.model-row .form-field {
  margin: 0;
}

.model-cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 900px) {
  .model-row {
    grid-template-columns: 1fr;
  }
}

.session-card {
  gap: 16px;
}

.session-meta {
  margin-bottom: 6px;
}

.session-form .card-actions {
  justify-content: flex-start;
}

.session-grid {
  grid-template-columns: minmax(280px, 1fr);
  align-items: start;
}

@media (max-width: 900px) {
  .session-grid {
    grid-template-columns: 1fr;
  }
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-toggle {
  gap: 12px;
}

.form-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.form-input,
.form-textarea {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: "Golos Text", sans-serif;
  box-shadow: 4px 4px 0 var(--shadow);
}

.form-textarea {
  min-height: 180px;
  resize: vertical;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toggle-text {
  font-weight: 500;
}

.toggle-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.form-row .form-input {
  flex: 1 1 240px;
  height: 46px;
}

.form-row input[type="file"].form-input {
  padding: 8px 14px;
}

.submission-text {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--ink);
  background: var(--bg-2);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.submission-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.submission-links a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.submission-link {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.submission-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.submission-label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.inline-edit {
  position: relative;
  gap: 12px;
}

.inline-edit-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-edit-column {
  flex-direction: column;
  align-items: flex-start;
}

.inline-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  min-width: 110px;
}

.inline-score {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-score-max {
  font-size: 14px;
  color: var(--ink-soft);
}

.inline-input {
  width: 96px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--ink);
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}

.inline-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--ink);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
}

.inline-edit--saved .inline-input,
.inline-edit--saved .inline-textarea {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(47, 127, 109, 0.18);
  background: rgba(47, 127, 109, 0.06);
}

.inline-edit--locked {
  opacity: 0.7;
}

.inline-edit--locked .inline-input,
.inline-edit--locked .inline-textarea {
  border-style: dashed;
  background: var(--bg);
}

.inline-edit--locked .inline-status {
  color: var(--accent);
  font-weight: 600;
}

.inline-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--ink-soft);
}

.inline-status--error {
  color: #c3512d;
}

.link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}

.link:hover {
  text-decoration: underline;
}

.link.ghost {
  color: var(--ink-soft);
  font-weight: 500;
}

.file-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px dashed var(--ink);
  background: var(--bg-2);
}

.file-item form {
  margin: 0;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  border: 1px dashed var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.log-title {
  font-weight: 600;
}

.log-date {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.log-message {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.log-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-soft);
}

.log-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.log-items {
  color: var(--ink);
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-card {
  padding: 14px 16px;
  min-height: auto;
}

.user-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.user-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.user-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f9b6b;
  box-shadow: 0 0 0 3px rgba(47, 155, 107, 0.18);
}

.user-open {
  margin-left: auto;
}

.role-pill {
  background: rgba(31, 28, 26, 0.06);
  color: var(--ink);
  border: 1px dashed var(--ink);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.role-pill--admin {
  background: var(--ink);
  color: var(--bg-2);
  border-color: var(--ink);
  border-style: solid;
}

.role-pill--manager {
  background: rgba(244, 127, 70, 0.16);
  color: var(--accent);
  border-color: var(--accent);
}

.course-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.course-access-card {
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  background: var(--card);
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-access-card:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 0 var(--accent-2);
}

.course-access-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  margin-top: 2px;
}

.course-access-title {
  font-weight: 600;
  color: var(--ink);
  grid-column: 1;
}

.course-access-meta {
  font-size: 12px;
  color: var(--ink-soft);
  grid-column: 1;
}

.origin-badge {
  background: rgba(31, 28, 26, 0.06);
  border: 1px dashed var(--ink);
  color: var(--ink);
}

.origin-badge.origin-auto {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-2);
}

.origin-badge.origin-manual {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.auto-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed var(--ink);
  background: var(--bg-2);
}

.auto-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auto-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.auto-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.debug-panel {
  margin-top: 12px;
  border: 1px dashed var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--bg-2);
}

.debug-panel summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

.debug-panel[open] summary {
  margin-bottom: 12px;
}

.raw-prompt {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: var(--bg-2);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill.role-pill {
  background: rgba(31, 28, 26, 0.08);
  color: var(--ink);
  border: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill.role-pill--admin {
  background: var(--ink);
  color: var(--bg-2);
}

.pill.role-pill--manager {
  background: rgba(244, 127, 70, 0.18);
  color: var(--accent);
}

.pill.auto-pill {
  background: rgba(47, 127, 109, 0.12);
  color: var(--accent-2);
  border: 1px dashed var(--accent-2);
  padding: 4px 8px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.pill.auto-pill [data-role="auto-value"] {
  margin-left: 4px;
}

.pill.auto-pill--course {
  font-size: 11px;
}

.pill.status-pending {
  background: #8c7d6e;
}

.pill.status-processing {
  background: #2b6cb0;
}

.pill.status-done {
  background: var(--accent-2);
}

.pill.status-failed {
  background: #a12d2d;
}

.btn {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid var(--ink);
  background: var(--bg-2);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn[disabled]:hover {
  box-shadow: none;
  transform: none;
}

.btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.is-disabled:hover {
  box-shadow: none;
  transform: none;
}

.form-locked {
  cursor: not-allowed;
}

.form-locked .btn {
  box-shadow: none;
  transform: none;
}

.btn.btn-mini {
  padding: 6px 12px;
  font-size: 12px;
  border-width: 1px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn.primary {
  background: var(--accent);
  color: var(--bg-2);
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
  border-style: dashed;
}

.banner {
  padding: 14px 18px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  font-weight: 600;
}

.banner.success {
  background: rgba(47, 127, 109, 0.2);
}

.banner.warning {
  background: rgba(227, 111, 76, 0.18);
}

.empty-state {
  border-radius: 18px;
  border: 2px dashed var(--ink);
  padding: 24px;
  background: rgba(255, 253, 248, 0.8);
}

.empty-state p {
  margin: 0 0 6px;
}

.site-footer {
  margin-top: 40px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@media (max-width: 1100px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-toggle {
    display: inline-flex;
    align-self: flex-start;
  }

  .site-nav {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--ink);
    border-radius: 18px;
    background: var(--bg-2);
    box-shadow: 4px 4px 0 var(--shadow);
  }

  .site-nav .nav-link {
    width: 100%;
    text-align: center;
  }

  .nav-logout {
    width: 100%;
  }

  .nav-open .site-nav {
    display: flex;
  }
}

@media (max-width: 900px) {
  .hero,
  .hero-compact {
    grid-template-columns: 1fr;
  }

  .hero-top {
    padding-right: 0;
  }

  .card-actions {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 720px) {
  .brand {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .brand-copy {
    min-width: 0;
  }

  .nav-link {
    font-size: 12px;
  }

  .nav-logout {
    width: 100%;
  }

  .user-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-open {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .site-nav .nav-link {
    text-align: center;
  }

  .nav-toggle {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
