:root {
  color-scheme: light;
  --ink: #18202f;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --canvas: #f4f6f2;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #d99b28;
  --rose: #b04452;
  --soft: #edf7f5;
  --shadow: 0 18px 50px rgba(24, 32, 47, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 280px),
    var(--canvas);
  color: var(--ink);
}

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

.auth-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.auth-gate[hidden],
#appShell[hidden] {
  display: none;
}

.auth-panel {
  width: min(460px, 100%);
  border: 1px solid rgba(216, 222, 232, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-panel h1 {
  margin-bottom: 8px;
}

.auth-panel p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 3vw, 40px) 14px;
}

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

.role-pill {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 850;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(24, 32, 47, 0.07);
  white-space: nowrap;
}

.user-button {
  display: grid;
  min-height: 40px;
  place-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.08;
}

h2 {
  font-size: 1.22rem;
  line-height: 1.18;
}

.day-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(24, 32, 47, 0.07);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 18px;
  padding: 0 clamp(16px, 3vw, 40px) 32px;
}

body[data-role="intern"] .review-panel,
body[data-role="manager"] .workspace {
  display: none;
}

body[data-role="intern"] .layout,
body[data-role="manager"] .layout {
  grid-template-columns: minmax(0, 1fr);
}

body[data-role="manager"] .review-panel {
  position: static;
  width: min(920px, 100%);
  justify-self: center;
}

.workspace,
.review-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 222, 232, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  display: none;
  padding: 20px;
}

.form-panel.is-active {
  display: block;
}

.panel-heading,
.review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.required-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 800;
}

.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd3df;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

.video-preview {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.video-preview[hidden] {
  display: none;
}

.video-preview img {
  display: block;
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
}

.video-preview p {
  margin: 0 0 6px;
  font-size: 0.93rem;
  font-weight: 850;
}

.video-preview a {
  color: var(--brand-strong);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.video-preview a:hover {
  text-decoration: underline;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 850;
  padding: 10px 14px;
}

.primary-button {
  border: 1px solid var(--brand-strong);
  background: var(--brand);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--brand-strong);
  outline: none;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: progress;
  opacity: 0.66;
}

.secondary-button {
  border: 1px solid #cbd3df;
  background: #fff;
  color: #344054;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--brand);
  color: var(--brand-strong);
  outline: none;
}

.compact {
  min-height: 40px;
  white-space: nowrap;
}

.review-panel {
  align-self: start;
  padding: 18px;
  position: sticky;
  top: 16px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.empty-state {
  border: 1px dashed #b7c0cc;
  border-radius: 8px;
  background: #fafafa;
  padding: 18px;
  text-align: center;
}

.empty-state p {
  margin: 0 0 4px;
  font-weight: 850;
}

.empty-state span {
  color: var(--muted);
  font-size: 0.9rem;
}

.submission-list {
  display: grid;
  gap: 10px;
}

.submission-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.submission-card[data-type="Confusion Diary"] {
  border-left-color: var(--rose);
}

.submission-card[data-type="Thumbnail Analysis"] {
  border-left-color: var(--brand);
}

.submission-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.submission-type {
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 0.74rem;
  font-weight: 850;
  padding: 5px 8px;
}

.submission-date {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.submission-card h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.submission-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.submission-card a {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand-strong);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.submission-card a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  transform: translateX(-50%);
  border-radius: 8px;
  background: #18202f;
  color: #fff;
  box-shadow: 0 18px 40px rgba(24, 32, 47, 0.28);
  font-weight: 800;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
}

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

  .review-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
  }

  .header-actions,
  .role-pill,
  .user-button {
    width: 100%;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .day-pill {
    width: 100%;
  }

  .layout {
    padding-inline: 12px;
  }

  .workspace,
  .review-panel {
    border-radius: 8px;
  }

  .form-panel {
    padding: 16px;
  }

  .panel-heading,
  .review-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .required-note {
    text-align: left;
  }

  .field-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions .secondary-button {
    order: 2;
  }

  .video-preview {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .video-preview img {
    width: 96px;
  }
}
