:root {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #292c32;
  background: #f5f4f1;
  font-synthesis: none;
  --wine: #781c28;
  --gold: #b78332;
  --line: #e2e0db;
  --muted: #6c727c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--wine);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 15px;
  background: #fff;
  color: #30323a;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
button:hover,
.button:hover {
  border-color: var(--gold);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary,
.button.primary {
  background: var(--wine);
  border-color: var(--wine);
  color: white;
}
button.danger {
  color: #a21626;
}
button.small,
.button.small {
  padding: 6px 9px;
  font-size: 13px;
}
input,
select,
textarea {
  border: 1px solid #cecdd1;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  min-width: 0;
  max-width: 100%;
  color: inherit;
}
input:not([type="checkbox"]):not([type="range"]),
textarea {
  width: 100%;
}
input[type="range"] {
  padding: 0;
  width: 100%;
  accent-color: var(--wine);
}
input[type="checkbox"] {
  accent-color: var(--wine);
}
label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
label.check {
  display: flex;
  align-items: flex-start;
  font-weight: 400;
  line-height: 1.5;
}
label.check input {
  margin-top: 5px;
}
label small,
.muted {
  color: var(--muted);
  font-weight: 400;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
  margin-bottom: 10px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 16px;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 4vw;
  gap: 15px;
}
.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  text-decoration: none;
  font-size: 32px;
  letter-spacing: -1.5px;
  font-weight: 850;
}
.brand span {
  font-size: 12px;
  letter-spacing: 1.1px;
  border-left: 1px solid #d9d3cf;
  padding-left: 16px;
  line-height: 1.6;
}
.brand small {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
#app {
  max-width: 1480px;
  margin: auto;
  padding: 32px 4vw 70px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.hero {
  margin-bottom: 26px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--wine);
  font-weight: 750;
  text-transform: uppercase;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 24px 0;
  overflow: auto;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 13px 18px;
  white-space: nowrap;
  color: var(--muted);
}
.tabs button.active {
  color: var(--wine);
  box-shadow: inset 0 -3px var(--wine);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.stat strong {
  font-size: 28px;
  display: block;
  margin-bottom: 3px;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  background: #faf9f6;
  color: var(--muted);
  white-space: nowrap;
}
td,
th {
  padding: 15px 16px;
  border-bottom: 1px solid #eeece8;
}
td .muted {
  font-size: 12px;
  margin-top: 4px;
}
td.actions {
  white-space: nowrap;
}
tr:last-child td {
  border: 0;
}
.badge {
  display: inline-block;
  border-radius: 6px;
  padding: 5px 8px;
  background: #eee;
  font-size: 12px;
  white-space: nowrap;
}
.badge.approved,
.badge.completed {
  color: #216945;
  background: #e9f5eb;
}
.badge.submitted,
.badge.running,
.badge.queued {
  color: #986307;
  background: #fff3d8;
}
.badge.rejected,
.badge.failed {
  color: #9b1c2a;
  background: #ffeaed;
}
.badge.draft {
  color: #546071;
  background: #eef1f5;
}
.filters {
  margin-bottom: 16px;
}
.filters input {
  max-width: 360px;
}
.empty {
  padding: 45px;
  text-align: center;
  color: var(--muted);
}
.note {
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.55;
  font-size: 14px;
  background: #f6f3ec;
  color: #665335;
}
.error {
  color: #972234;
  background: #fff0f1;
}
.success {
  color: #235e3c;
  background: #edf8ef;
}
.preview {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  display: block;
  background: #230d13;
  border-radius: 10px;
}
.preview.loading {
  opacity: 0.45;
}
.student-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
}
.crop-canvas {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4/5;
  display: block;
  margin: auto;
  background: #efece6;
  touch-action: none;
  cursor: grab;
  border-radius: 8px;
}
.controls {
  margin-top: 18px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  font-size: 14px;
  margin-bottom: 20px;
}
.facts dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.facts dd {
  margin: 0;
  font-weight: 650;
}
.login {
  max-width: 440px;
  margin: 50px auto;
}
.login .primary {
  width: 100%;
}
.help {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  max-width: 1040px;
  width: 92vw;
  max-height: 90vh;
  box-shadow: 0 24px 80px #0005;
}
dialog::backdrop {
  background: #14121b99;
}
#dialog-content {
  padding: 26px;
}
.close-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.close-row h2 {
  margin: 0;
}
.job {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.job:last-child {
  border: 0;
}
.job progress {
  width: 100%;
  height: 7px;
  accent-color: var(--wine);
  margin: 10px 0;
}
.group-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.group-list span {
  padding: 6px 9px;
  background: #f4f2ec;
  border-radius: 5px;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  max-width: min(90vw, 660px);
  padding: 15px 20px;
  border-radius: 10px;
  background: #282932;
  color: white;
  box-shadow: 0 5px 30px #0002;
  white-space: pre-line;
  max-height: 40vh;
  overflow: auto;
}
code {
  background: #eeece8;
  border-radius: 4px;
  padding: 2px 5px;
}
.link-output {
  word-break: break-all;
}
.filelabel input {
  font-size: 13px;
}
.separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.right {
  text-align: right;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #ca923e;
  outline-offset: 3px;
}
@media (max-width: 900px) {
  .student-grid {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .student-grid .editor {
    order: 2;
  }
  .hero h1 {
    font-size: 25px;
  }
  #app {
    padding: 24px 18px 60px;
  }
  .panel {
    padding: 20px;
  }
  .topbar {
    padding: 14px 18px;
  }
  .facts {
    grid-template-columns: 1fr 1fr;
  }
  .crop-canvas {
    max-width: 320px;
  }
}
@media (max-width: 500px) {
  .brand span {
    font-size: 10px;
  }
  .brand {
    font-size: 27px;
    gap: 10px;
  }
  .brand small {
    font-size: 10px;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 14px;
  }
  .tabs button {
    padding: 12px;
  }
  .close-row {
    align-items: flex-start;
  }
}

/* Student frame editor and saved social image. No slide preview in the student portal. */
.frame-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.frame-canvas,
.frame-image {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 2048/2047;
  object-fit: contain;
  background: #f4f1ed;
  display: block;
  margin: auto;
  border-radius: 10px;
}
.frame-image.loading {
  opacity: 0.5;
}
.frame-workspace .controls {
  margin-top: 0;
}
a.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
.review-portrait {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .frame-workspace {
    grid-template-columns: 1fr;
  }
  .frame-workspace .editor {
    order: 0;
  }
}
@media (max-width: 500px) {
  .review-portrait {
    grid-template-columns: 1fr;
  }
  .review-portrait .frame-image {
    max-width: 240px;
  }
}
