:root {
  --ink: #14201d;
  --muted: #66736d;
  --line: #dce4dd;
  --panel: #ffffff;
  --paper: #f7f8f4;
  --green: #1d6f5f;
  --green-dark: #12483e;
  --coral: #cc5f45;
  --gold: #d99b2b;
  --sky: #e8f3f7;
  --shadow: 0 18px 50px rgba(20, 32, 29, 0.11);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--green);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  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;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}

.login-logo {
  width: min(220px, 70%);
  height: auto;
  display: block;
  margin-bottom: 28px;
}

.login-panel h1 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-form input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.login-message {
  color: #9d2b21;
}

.home-panel {
  width: min(680px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 56px);
}

.home-panel h1,
.eval-header h1,
.admin-topbar h1 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: 0;
}

.home-panel h1 {
  font-size: clamp(2.1rem, 7vw, 4.8rem);
}

.home-copy {
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.6;
}

.home-actions,
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-link,
.secondary-link,
.primary-button,
.ghost-button,
.copy-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-link,
.primary-button {
  background: var(--green);
  color: white;
}

.report-link {
  background: var(--coral);
}

.logout-link {
  color: #9d2b21;
}

.primary-link:hover,
.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.report-link:hover {
  background: #a94833;
}

.secondary-link,
.ghost-button {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

.secondary-link:hover,
.ghost-button:hover {
  border-color: var(--green);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.eval-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(232, 243, 247, 0.9), rgba(247, 248, 244, 0.95) 36%),
    var(--paper);
}

.eval-shell {
  min-height: 100vh;
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: clamp(18px, 4vw, 42px);
}

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

.eval-title-group {
  display: grid;
  gap: 16px;
}

.brand-logo {
  width: min(245px, 52vw);
  height: auto;
  display: block;
  opacity: 0.92;
}

.eval-header h1 {
  max-width: 720px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}

.course-meta span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(29, 111, 95, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.progress-wrap {
  height: 8px;
  background: rgba(20, 32, 29, 0.09);
  border-radius: 999px;
  margin: 26px 0 10px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 260ms ease;
}

.question-stage {
  display: grid;
  align-items: center;
  min-height: 440px;
  padding: 18px 0;
}

.question-card,
.completion-state {
  width: min(820px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(220, 228, 221, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 46px);
}

.question-kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.question-card h2,
.completion-state h2 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.privacy-note {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.answer-area {
  margin-top: clamp(24px, 5vw, 42px);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(84px, 1fr));
  gap: 10px;
}

.rating-button,
.choice-button {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.rating-button strong {
  display: block;
  font-size: 1.85rem;
}

.rating-button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.rating-button:hover,
.choice-button:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.rating-button[data-selected="true"],
.choice-button[data-selected="true"] {
  border-color: var(--green);
  background: var(--green);
  color: white;
  box-shadow: 0 12px 30px rgba(29, 111, 95, 0.22);
}

.rating-button[data-selected="true"] span {
  color: rgba(255, 255, 255, 0.82);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.choice-grid.two {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.choice-button {
  min-height: 76px;
  padding: 14px;
  font-weight: 800;
}

.long-answer {
  width: 100%;
  resize: vertical;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
  color: var(--ink);
  line-height: 1.55;
}

.long-answer:focus,
select:focus,
input:focus {
  outline: 3px solid rgba(29, 111, 95, 0.18);
  border-color: var(--green);
}

.check-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  max-width: 620px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.eval-footer {
  display: grid;
  grid-template-columns: minmax(92px, 150px) 1fr minmax(92px, 150px);
  align-items: center;
  gap: 14px;
  padding-top: 12px;
}

.step-count {
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.inline-error {
  margin: 18px 0 0;
  color: #9d2b21;
  font-weight: 800;
}

.completion-state {
  text-align: center;
}

.completion-state p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.admin-body {
  min-height: 100vh;
  background: var(--paper);
}

.admin-topbar,
.admin-layout {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding-left: clamp(16px, 3vw, 36px);
  padding-right: clamp(16px, 3vw, 36px);
}

.admin-topbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-topbar h1 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.admin-layout {
  display: grid;
  gap: 18px;
  padding-top: 22px;
  padding-bottom: 40px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 12px;
}

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

.stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.stat-tile strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1;
}

.admin-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(16px, 2vw, 22px);
}

.band-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.band-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.band-heading p,
.table-heading span {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.93rem;
}

.import-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.manual-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.75fr) minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(100px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
}

.file-field,
.manual-form label,
.filter-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.file-field input,
.manual-form input,
.filter-grid input,
.filter-grid select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--green-dark);
  font-weight: 800;
}

.created-link {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  background: #fbfcfa;
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.status-pill,
.rating-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.8rem;
  font-weight: 900;
}

.status-pill.pending {
  background: #fff3d8;
  color: #805515;
}

.status-pill.completed {
  background: #dff2ea;
  color: var(--green-dark);
}

.rating-chip {
  margin: 0 4px 4px 0;
  background: var(--sky);
  color: #245469;
}

.link-cell {
  white-space: nowrap;
}

.copy-button {
  min-height: 32px;
  margin-left: 8px;
  padding: 5px 9px;
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.comment-cell {
  max-width: 520px;
  min-width: 280px;
  line-height: 1.5;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 26px;
}

@media (max-width: 980px) {
  .eval-header,
  .admin-topbar,
  .band-heading {
    display: grid;
    justify-content: stretch;
  }

  .brand-logo {
    width: min(210px, 58vw);
  }

  .course-meta {
    justify-content: flex-start;
    max-width: none;
  }

  .rating-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .choice-grid,
  .choice-grid.two,
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .eval-shell {
    padding: 16px;
    padding-bottom: 118px;
  }

  .question-stage {
    min-height: 420px;
  }

  .rating-grid,
  .choice-grid,
  .choice-grid.two,
  .stat-grid,
  .filter-grid,
  .manual-form,
  .import-form {
    grid-template-columns: 1fr;
  }

  .rating-button {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    text-align: left;
  }

  .rating-button strong,
  .rating-button span {
    margin: 0;
  }

  .eval-footer {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 0;
    grid-template-columns: 1fr 1fr;
    z-index: 20;
    background: rgba(247, 248, 244, 0.96);
    border-top: 1px solid var(--line);
    padding: 10px 0 calc(12px + env(safe-area-inset-bottom));
  }

  .step-count {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .ghost-button {
    grid-column: 1;
    grid-row: 2;
  }

  .primary-button {
    grid-column: 2;
    grid-row: 2;
  }

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