@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #0f8f61;
  --primary-dark: #086345;
  --primary-soft: #e8f7ef;
  --accent-red: #c91f32;
  --secondary: #0b7894;
  --ink: #18212f;
  --muted: #5f6d7a;
  --line: #dfe8e4;
  --paper: #ffffff;
  --wash: #f6faf8;
  --mint: #e4f8ed;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 12px 32px rgba(15, 74, 50, 0.08);
  --shadow-hover: 0 18px 42px rgba(15, 74, 50, 0.14);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f7fbf8 0%, #dff5ea 100%);
}

.login-panel {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-logo-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.brand-mark {
  display: block;
  object-fit: contain;
}

.brand-mark-nitr {
  width: 92px;
}

.brand-mark-ffdg {
  width: 210px;
  max-width: 100%;
}

.login-text-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #cfded6;
  font-size: 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #314033;
}

.field-help {
  display: block;
  margin: 6px 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

input,
textarea,
.Select-control {
  border-radius: var(--radius);
}

input,
textarea,
button,
.Select-control {
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 143, 97, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #8b98a5;
  opacity: 1;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 143, 97, 0.24);
  outline-offset: 2px;
}

.large-text-input {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid #cfded6;
  font-size: 15px;
}

.primary-button,
.ghost-button {
  min-height: 38px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  margin-top: 20px;
  color: white;
  background: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: 0 8px 18px rgba(15, 143, 97, 0.18);
}

.ghost-button {
  padding: 0 14px;
  color: var(--primary-dark);
  background: white;
  border: 1px solid var(--line);
}

.primary-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(8, 99, 69, 0.22);
}

.ghost-button:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: #bddfce;
  transform: translateY(-1px);
}

.form-message {
  margin-top: 12px;
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.upload-alert {
  padding: 10px 12px;
  border: 1px solid #f1b7b2;
  border-radius: var(--radius);
  background: #fff4f2;
  color: var(--danger);
  line-height: 1.45;
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 30px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(16, 41, 31, 0.04);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
}

.portal-title {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid #e6efe9;
  border-radius: 999px;
  background: #f8fcfa;
}

.topnav a {
  color: #334155;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.topnav a:hover,
.site-footer a:hover {
  color: var(--primary);
}

.topnav a:hover {
  background: #e7f6ee;
  transform: translateY(-1px);
}

.topnav .nav-cta,
.topnav .btn--primary {
  color: white;
  background: var(--primary);
}

.topnav .nav-cta:hover,
.topnav .btn--primary:hover {
  color: white;
  background: var(--primary-dark);
}

.session-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 210px;
}

.logout-button {
  min-height: 34px;
  padding: 0 13px;
  color: var(--primary-dark);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.logout-button:hover {
  color: white;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.topbar h1 {
  margin-bottom: 2px;
  font-size: 21px;
}

.topbar p,
.dataset-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.portal-main {
  padding: 24px 18px 32px;
  background: linear-gradient(180deg, #f7fbf8 0%, #ffffff 420px);
}

.workspace-switch {
  max-width: 1280px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid #e2eee7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 26px rgba(15, 74, 50, 0.06);
}

.workspace-switch-button {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  background: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 74, 50, 0.04);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.workspace-switch-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
}

.workspace-switch-button:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: #badfcf;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 74, 50, 0.12);
}

.workspace-switch-button:hover::after {
  transform: translateX(120%);
}

.workspace-switch-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: var(--primary);
  box-shadow: 0 12px 26px rgba(15, 143, 97, 0.24);
}

.workspace-switch-active:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #13a56f 0%, var(--primary-dark) 100%);
}

.workspace-switch-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.workspace-switch-note strong {
  color: var(--ink);
}

.workspace {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.workspace-page-hidden {
  display: none;
}

.filters,
.results {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.filters {
  align-self: start;
  position: sticky;
  top: 100px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.clean-slider {
  margin: 6px 2px 20px;
  padding: 6px 8px 16px;
}

.clean-slider .rc-slider-mark {
  top: 23px;
  font-size: 11px;
  color: #64748b;
}

.clean-slider .rc-slider-mark-text {
  min-width: 34px;
  white-space: nowrap;
}

.clean-slider.year-slider .rc-slider-mark-text {
  transform: translateX(-50%) rotate(-28deg) !important;
  transform-origin: top center;
}

.clean-slider .rc-slider-track {
  background-color: var(--primary);
}

.clean-slider .rc-slider-handle {
  border-color: var(--primary);
  opacity: 1;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.filter-header h2 {
  margin-bottom: 0;
}

.filter-header p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.mapping-upload-panel {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid #d9e7df;
  border-radius: var(--radius);
  background: #f8fcfa;
}

.mapping-upload {
  padding: 12px;
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.mapping-gate-panel {
  width: min(560px, 100%);
}

.mapping-gate-upload {
  margin-top: 16px;
  padding: 28px;
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  background: #f7fbf8;
  color: var(--primary-dark);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.mapping-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #d9e7df;
  border-radius: var(--radius);
  background: #f8fcfa;
  color: #314033;
  font-size: 13px;
  line-height: 1.45;
}

.mapping-gate-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mapping-preview {
  margin: 14px 0 2px;
  padding: 12px;
  border: 1px solid #d9e7df;
  border-radius: var(--radius);
  background: #ffffff;
}

.mapping-preview h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.mapping-preview p {
  margin-bottom: 10px;
  font-size: 12px;
}

.mapping-preview-panel {
  width: min(720px, 100%);
}

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

.mapping-status {
  margin-top: 8px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.results {
  min-width: 0;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfefd 100%);
}

.assignment-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
}

.assignment-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.assignment-page-header h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.assignment-page-header p {
  margin-bottom: 0;
  font-size: 13px;
}

.inline-help-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.inline-help-button:hover {
  color: var(--primary);
}

.task-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.task-intro div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.task-intro span {
  display: block;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.task-intro strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ecfaef 0%, #f8fcfa 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

.metrics div:hover {
  border-color: #c9e6d6;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 74, 50, 0.08);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.tab-content {
  padding-top: 14px;
}

.portal-tabs {
  border-bottom: 1px solid var(--line);
}

.portal-tabs .tab {
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  background: transparent !important;
  color: #465663;
  font-weight: 800;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.portal-tabs .tab:hover {
  color: var(--primary-dark);
  background: #f8fcfa !important;
}

.portal-tabs .tab-selected {
  color: var(--primary-dark) !important;
  border-bottom-color: var(--primary) !important;
  background: #ffffff !important;
}

.portal-tabs .assignment-tab {
  margin-left: 10px;
  border-left: 1px solid var(--line) !important;
}

.tab-panel-hidden {
  display: none;
}

.food-picker {
  max-height: 260px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.food-picker label {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 36px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #ffffff;
  color: #314033;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.16s var(--ease);
}

.food-picker label:hover {
  border-color: #cfe7da;
  background: #f7fbf8;
  transform: translateY(-1px);
}

.food-picker input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

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

.table-note {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #d9e7df;
  border-radius: var(--radius);
  background: #f8fcfa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.assignment-workspace {
  display: grid;
  gap: 16px;
}

.assignment-modal-host {
  display: contents;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.assignment-column {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.assignment-panel {
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 74, 50, 0.04);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.assignment-panel:hover {
  border-color: #cfe7da;
  box-shadow: 0 14px 30px rgba(15, 74, 50, 0.08);
}

.assignment-context {
  overflow: visible;
  position: relative;
  z-index: 5;
}

.assignment-workspace .Select-menu-outer {
  z-index: 1000;
}

.assignment-panel h3 {
  margin-bottom: 8px;
}

.assignment-panel p {
  margin-bottom: 12px;
  font-size: 13px;
}

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

.assignment-context {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 18px;
}

.context-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 14px;
}

.compact-button {
  width: auto;
  min-width: 150px;
  margin-top: 14px;
  padding: 0 16px;
}

.code-area {
  width: 100%;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #cfded6;
  border-radius: var(--radius);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  resize: vertical;
}

.notebook-code-area {
  min-height: 132px;
}

.filter-instructions {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #d9e7df;
  border-radius: var(--radius);
  background: #f8fcfa;
  color: var(--muted);
  font-size: 13px;
}

.filter-instructions code {
  display: block;
  white-space: normal;
  color: #153d2d;
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

.gpt-helper-callout {
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #d9e7df;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fcfa 0%, #ffffff 100%);
  box-shadow: inset 3px 0 0 var(--primary);
}

.gpt-helper-callout strong {
  color: #153d2d;
  font-size: 13px;
}

.gpt-helper-callout p {
  margin: 0;
  font-size: 12px;
}

.gpt-helper-link,
.help-link-row a {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.gpt-helper-link:hover,
.help-link-row a:hover {
  text-decoration: underline;
}

.assignment-output {
  margin-top: 14px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.assignment-output pre {
  white-space: pre-wrap;
  padding: 12px;
  border: 1px solid #d9e7df;
  border-radius: var(--radius);
  background: #f8fcfa;
  font-size: 13px;
}

.assignment-output .dash-table-container {
  max-width: 100%;
}

.assignment-output .dash-spreadsheet-container,
.assignment-output .dash-spreadsheet-inner {
  max-width: 100%;
}

.upload-box {
  padding: 22px;
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  background: #f7fbf8;
  color: var(--primary-dark);
  font-weight: 800;
  text-align: center;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.upload-box:hover,
.mapping-gate-upload:hover {
  background: #eef9f3;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 74, 50, 0.08);
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 24, 18, 0.55);
}

.modal-hidden {
  display: none;
}

.modal-panel {
  width: min(860px, 100%);
  max-height: min(780px, 88vh);
  overflow: hidden;
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-close {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
}

.modal-body {
  max-height: calc(min(780px, 88vh) - 72px);
  overflow-y: auto;
  padding: 20px 24px 26px;
}

.modal-body h3 {
  margin: 18px 0 8px;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body ul {
  margin: 8px 0 0 20px;
  padding: 0;
  color: var(--muted);
}

.modal-body li {
  margin: 6px 0;
}

.site-footer {
  color: rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(180deg, rgba(16, 41, 31, 0.96) 0%, rgba(7, 31, 22, 1) 100%);
  padding: 46px 28px 28px;
  border-top: 4px solid var(--primary);
}

.footer-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: 32px;
  align-items: start;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-logo {
  display: block;
  object-fit: contain;
}

.footer-logo-nitr {
  width: 88px;
  background: white;
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.footer-logo-ffdg {
  width: 190px;
  max-width: 100%;
  background: white;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.footer-brand p {
  max-width: 300px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.site-footer h3 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.site-footer a {
  display: block;
  width: fit-content;
  margin: 9px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}

.site-footer a:hover {
  color: #87e3b5;
  transform: translateX(2px);
}

.footer-bottom {
  max-width: 1180px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}

.footer-bottom p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  width: 48px;
  height: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: #09ad7a;
  box-shadow: 0 16px 34px rgba(8, 99, 69, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.back-to-top::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-top: 2.4px solid #ffffff;
  border-left: 2.4px solid #ffffff;
  border-radius: 1px;
  transform: rotate(45deg);
}

.back-to-top-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px);
  background: var(--primary-dark);
  box-shadow: 0 20px 42px rgba(8, 99, 69, 0.34);
}

@media (max-width: 900px) {
  .workspace {
    display: block;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .topnav {
    flex-wrap: wrap;
    justify-content: flex-start;
    border-radius: var(--radius);
    gap: 6px;
  }

  .dataset-status {
    margin-top: 10px;
  }

  .session-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    position: static;
    margin-bottom: 16px;
  }

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

  .task-intro {
    grid-template-columns: 1fr;
  }

  .portal-tabs .assignment-tab {
    margin-left: 0;
    border-left: 0 !important;
  }

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

  .assignment-grid,
  .batch-controls,
  .assignment-context,
  .context-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar-brand {
    min-width: 0;
  }

  .portal-title {
    padding-left: 10px;
  }

  .nav-logo {
    width: 50px;
    height: 50px;
  }

  .metrics,
  .footer-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
