:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --ink: #172018;
  --muted: #5c685d;
  --line: #cbd7c9;
  --panel: #ffffff;
  --accent: #1f7a5b;
  --accent-2: #2456a6;
  --warning: #b8751c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.page-wide {
  width: min(1280px, 100%);
}

.hero {
  min-height: calc(100vh - 48px);
  display: grid;
  align-content: center;
  gap: 28px;
}

h1 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

p {
  margin: 0 0 14px;
}

.eyebrow,
.muted,
.small,
td span {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.small {
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

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

.narrow {
  max-width: 460px;
  margin: 10vh auto 0;
}

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

.topbar {
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.topbar a,
.button,
button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.topbar a,
.button.secondary {
  background: #e7ede6;
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.topbar .profile-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px 6px 6px;
}

.profile-link img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.student-tabbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 247, 242, 0.96);
  backdrop-filter: blur(10px);
}

.student-tabbar button {
  min-height: 44px;
  background: #e7ede6;
  color: var(--ink);
}

.student-tabbar button.active {
  background: var(--accent);
  color: white;
}

.student-tabs {
  touch-action: pan-y;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

label {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
}

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

th {
  background: #e7ede6;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef3ee;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.review-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  background: #ffd45a;
  color: #473100;
  font-size: 0.9rem;
  font-weight: 900;
  vertical-align: middle;
}

.build-state {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faf5;
}

.build-state span {
  color: var(--muted);
  font-weight: 700;
}

.robot-panel {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf5;
}

.story-panel,
.message-board {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.story-panel h2,
.message-board h2 {
  margin: 0;
  font-size: 1.05rem;
}

.story-panel p,
.student-message p {
  margin: 0;
}

.story-robots {
  font-weight: 700;
}

.student-message {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.student-message.unread {
  border-color: rgba(31, 122, 91, 0.35);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.12);
}

.student-message strong,
.student-message span {
  display: block;
}

.student-message span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.robot-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.robot-head img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 8px;
  background: #e7ede6;
}

.robot-current {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.robot-current > strong {
  font-size: 0.92rem;
}

.robot-current .task-progress {
  margin-top: 2px;
}

.robot-battery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.robot-battery {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.robot-battery span,
.robot-battery small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.robot-current span,
.robot-actions .task-state {
  color: var(--muted);
  font-size: 0.86rem;
}

.task-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7dc;
}

.task-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #69a33d);
}

.robot-actions {
  display: grid;
  gap: 10px;
}

.robot-actions form {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.task-details,
.task-meta,
.task-resource-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.task-details {
  justify-content: flex-start;
}

.task-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.task-duration,
.task-resource-row {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.task-resource-row > span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.resource-chip {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  min-height: 24px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef3ee;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.resource-chip.missing {
  background: #f8d8ce;
}

.task-state {
  padding: 3px 6px;
  border-radius: 999px;
  background: #eef3ee;
  font-weight: 700;
}

.task-state.warning {
  background: #f8d8ce;
  color: #7f311f;
}

.print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.qr-card {
  break-inside: avoid;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.qr-card img {
  width: 180px;
  height: 180px;
}

.island {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 20px;
  align-items: stretch;
}

.island-map {
  min-height: 460px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)),
    url("/assets/island-pirate-map.png") center / cover no-repeat;
}

.isle,
.ship,
.gate {
  position: absolute;
  display: block;
  border: 2px solid rgba(23, 32, 24, 0.22);
  box-shadow: 0 2px 8px rgba(23, 32, 24, 0.18);
}

.isle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f3e3a5;
}

.isle.home {
  left: 14%;
  top: 22%;
}

.gate {
  left: 48%;
  top: 47%;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #ffffff;
}

.island-map.locked .gate {
  background: #f8d8ce;
}

.island-map.can-leave .gate {
  background: #d9f0df;
}

.island-map.locked .route {
  opacity: 0.35;
}

.ship {
  right: 10%;
  top: 12%;
  width: 42px;
  height: 30px;
  border-radius: 8px;
  background: #ffffff;
}

.route {
  position: absolute;
  left: 31%;
  top: 36%;
  width: 34%;
  border-top: 4px dashed rgba(36, 86, 166, 0.55);
  transform: rotate(17deg);
}

.task-list {
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.task-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.progress-box {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.progress-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.avatar-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.avatar-summary img {
  width: 92px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf7;
}

.avatar-editor {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.avatar-editor button {
  grid-column: 2;
  justify-self: start;
  margin-top: 2px;
}

.avatar-cost {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.teacher-avatar {
  width: 46px;
  height: 46px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.avatar-preview {
  position: sticky;
  top: 16px;
}

.avatar-preview img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf7;
}

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

.avatar-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.avatar-control span,
.avatar-control legend {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.avatar-control select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 11px;
  font: inherit;
}

.avatar-control-options {
  border: 0;
  padding: 0;
  margin: 0;
}

.avatar-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}

.avatar-option {
  display: grid;
  margin: 0;
  cursor: pointer;
}

.avatar-option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.avatar-option span {
  min-height: 106px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px 5px 7px;
  color: var(--ink);
  text-align: center;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.avatar-option img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #f8faf7;
}

.avatar-option strong {
  max-width: 100%;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.avatar-option input:checked + span {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.18);
}

.avatar-option input:focus-visible + span {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.avatar-option:hover span {
  transform: translateY(-1px);
}

.avatar-control-colors {
  border: 0;
  padding: 0;
  margin: 0;
}

.avatar-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.avatar-swatch {
  display: grid;
  cursor: pointer;
}

.avatar-swatch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.avatar-swatch span {
  width: 32px;
  height: 32px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
}

.avatar-swatch input:checked + span {
  box-shadow: 0 0 0 3px rgba(31, 122, 91, 0.26);
}

.avatar-swatch input:focus-visible + span {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 18px;
}

.resource-card {
  min-height: 82px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfb;
}

.resource-label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.resource-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #eef3ee;
  font-size: 1rem;
}

.resource-card strong {
  font-size: 1.5rem;
  line-height: 1;
}

.resource-card small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.resource-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5dc;
}

.resource-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
}

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

.document-panel {
  margin-top: 20px;
}

.tab-panel > .document-panel {
  margin-top: 0;
}

.ol-panel {
  display: grid;
  gap: 16px;
}

.ol-panel h1 {
  margin-bottom: 0;
}




.template-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.template-card {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.template-thumb {
  display: block;
  min-height: 230px;
  border-radius: 6px;
  background: #edf3ec;
  padding: 10px;
  text-decoration: none;
}

.template-thumb img {
  width: 100%;
  aspect-ratio: 0.72;
  display: block;
  object-fit: cover;
  object-position: top center;
  border: 1px solid #d9dfd7;
  border-radius: 4px;
  background: white;
  box-shadow: 0 5px 14px rgba(23, 32, 24, 0.08);
}

.template-page {
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 4px;
  border: 1px solid #d9dfd7;
  background: #ffffff;
  padding: 14px 12px;
  color: #29332a;
  font-size: 0.62rem;
  line-height: 1.25;
  box-shadow: 0 5px 14px rgba(23, 32, 24, 0.08);
  overflow: hidden;
}

.template-page span {
  display: block;
  min-height: 0.75rem;
  border-bottom: 1px solid rgba(23, 32, 24, 0.07);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-card-body {
  display: grid;
  gap: 2px;
}

.template-card-body span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.template-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.template-actions form {
  margin: 0;
}

.template-actions .button {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 8px 10px;
  text-align: center;
}

.template-actions button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
}

.template-choice {
  margin: 4px 0 18px;
}

.selected-template {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  padding: 14px;
}

.selected-template h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.selected-template.compact {
  grid-template-columns: 1fr;
  gap: 8px;
}

.selected-template.compact h3 {
  margin-bottom: 4px;
}

.selected-template-preview .template-thumb {
  min-height: 0;
  padding: 8px;
}

.template-change {
  margin-top: 12px;
}

.template-change summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 700;
}

.template-preview-panel {
  max-width: 840px;
  margin: 0 auto;
}

.template-image-preview {
  display: grid;
  justify-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #edf3ec;
}

.template-image-preview img {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  box-shadow: 0 8px 20px rgba(23, 32, 24, 0.12);
}

.template-preview-links {
  margin: 10px 0 0;
  text-align: center;
  font-weight: 700;
}

.template-preview-page {
  min-height: 800px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  padding: 34px;
  box-shadow: 0 8px 20px rgba(23, 32, 24, 0.08);
}

.template-preview-page p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.link-card {
  display: grid;
  gap: 4px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.link-card span,
.link-card small {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.link-card strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.upload-box {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.file-drop {
  min-height: 86px;
  justify-content: center;
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8faf7;
}

.document-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.document-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.document-list span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.document-actions form {
  margin: 0;
}

.internship-document-upload {
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr) minmax(240px, 1.2fr) auto;
}

.collapsible-section {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-left: 6px solid #64748b;
  border-radius: 8px;
  background: #ffffff;
  overflow: clip;
}

.collapsible-section > summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  background: #f8fafc;
}

.collapsible-section > summary::-webkit-details-marker,
.application-card > summary::-webkit-details-marker {
  display: none;
}

.collapsible-section > summary::after,
.application-card > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.collapsible-section[open] > summary::after,
.application-card[open] > summary::after {
  content: "−";
}

.collapsible-section > summary strong {
  display: block;
  font-size: 1.02rem;
}

.collapsible-section > summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.collapsible-body {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.template-disclosure {
  border-left-color: #64748b;
}

.internship-documents {
  border-left-color: #0f766e;
}

.file-disclosure {
  border-left-color: #c2410c;
}

.application-section {
  margin: 22px 0;
  border-left-color: #2563eb;
}

.application-create {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.application-list {
  display: grid;
  gap: 14px;
}

.application-card {
  --application-color: #2563eb;
  --application-bg: #eff6ff;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--application-color) 26%, var(--line));
  border-left: 6px solid var(--application-color);
  border-radius: 8px;
  background: var(--application-bg);
}

.application-card:nth-child(6n + 1) {
  --application-color: #2563eb;
  --application-bg: #eff6ff;
}

.application-card:nth-child(6n + 2) {
  --application-color: #0f766e;
  --application-bg: #f0fdfa;
}

.application-card:nth-child(6n + 3) {
  --application-color: #7c3aed;
  --application-bg: #f5f3ff;
}

.application-card:nth-child(6n + 4) {
  --application-color: #c2410c;
  --application-bg: #fff7ed;
}

.application-card:nth-child(6n + 5) {
  --application-color: #be123c;
  --application-bg: #fff1f2;
}

.application-card:nth-child(6n + 6) {
  --application-color: #047857;
  --application-bg: #ecfdf5;
}

.application-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  list-style: none;
}

.application-card h3 {
  margin: 2px 0 4px;
}

.application-toggle {
  color: var(--application-color);
  font-size: 0.86rem;
  font-weight: 800;
}

.application-card[open] .application-toggle {
  display: none;
}

.application-card-body {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

.application-card-actions {
  display: flex;
  justify-content: flex-end;
}

.application-block {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--application-color, #64748b) 24%, var(--line));
  border-left: 5px solid var(--application-color, #64748b);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.application-block h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.application-block-create {
  border-left-color: #64748b;
  background: #f8fafc;
}

.application-block-status {
  border-left-color: var(--application-color);
}

.application-block-send {
  border-left-color: var(--application-color);
}

.application-block-contact {
  border-left-color: var(--application-color);
}

.application-block-positive {
  border-left-color: var(--application-color);
}

.application-block-rejection {
  border-left-color: var(--application-color);
}

.application-checklist {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.application-checklist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.application-checklist li.done {
  border-color: rgba(34, 197, 94, 0.35);
  background: #f0fdf4;
}

.application-checklist span,
.application-checklist time {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.application-evidence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.application-evidence-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--application-color, #64748b) 24%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.application-evidence-preview {
  display: grid;
  place-items: center;
  width: 74px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  color: var(--application-color, var(--accent-2));
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.application-evidence-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.application-evidence-card strong,
.application-evidence-card span,
.application-evidence-card a {
  display: block;
}

.application-evidence-card span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-evidence-card a {
  margin-top: 2px;
  font-size: 0.84rem;
  font-weight: 800;
}

.application-actions,
.application-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.application-actions form,
.upload-box.compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: end;
  margin: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.summary-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.summary-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.summary-grid strong {
  font-size: 1.3rem;
}

.application-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 320px;
}

.application-summary span {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.application-summary strong {
  color: var(--ink);
  font-size: 0.92rem;
}



.scan-panel {
  display: grid;
  gap: 14px;
}

.scan-panel video,
.scan-panel canvas {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  object-fit: cover;
}

.scan-panel video.scan-hit {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 125, 91, 0.18);
}

.scan-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.scan-detected-list,
.scan-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-detected-list li,
.scan-result-list li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.scan-status {
  min-height: 28px;
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}

.week-form {
  margin: 0 0 14px;
}

.week-control {
  display: grid;
  grid-template-columns: auto minmax(170px, 220px) auto auto;
  gap: 10px;
  align-items: end;
}

.week-control label {
  margin: 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding-inline: 12px;
  font-size: 1.3rem;
  line-height: 1;
}







.notice-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice-list li {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) minmax(90px, 0.8fr) minmax(120px, 1fr) minmax(130px, 1fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ed;
}

.notice-list.compact li {
  grid-template-columns: minmax(140px, 1.2fr) minmax(180px, 1.4fr) minmax(140px, 1fr);
}

details.subsection summary {
  cursor: pointer;
  font-weight: 800;
}

.teacher-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 18px;
  margin: 20px 0;
}

.teacher-code-card {
  display: grid;
  grid-template-columns: 184px 1fr;
  gap: 24px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.teacher-code-card img {
  width: 184px;
  height: 184px;
  image-rendering: crisp-edges;
}

.teacher-code-card h2 {
  font-size: 1.8rem;
  margin: 4px 0 10px;
}

.teacher-code-card p {
  font-size: 1rem;
}

@media (max-width: 640px) {
  .notice-list li {
    grid-template-columns: 1fr;
  }

  .teacher-code-grid {
    grid-template-columns: 1fr;
  }

  .teacher-code-card {
    grid-template-columns: 140px 1fr;
    gap: 14px;
  }

  .teacher-code-card img {
    width: 140px;
    height: 140px;
  }
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.label-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38mm, 1fr));
  gap: 4mm;
}

.ol-label {
  width: 38mm;
  min-height: 21mm;
  display: grid;
  grid-template-columns: 23mm 1fr;
  gap: 1mm;
  align-items: center;
  break-inside: avoid;
  page-break-inside: avoid;
  padding: 0;
  border: 1px dashed #9ca3af;
  background: white;
  color: #111;
  font-size: 8.5pt;
  line-height: 1.2;
  position: relative;
}

.ol-label img {
  width: 22mm;
  height: 22mm;
  image-rendering: crisp-edges;
}

.ol-label strong,
.ol-label span {
  display: block;
}

.ol-label strong {
  font-size: 11pt;
}

.ol-label span {
  font-size: 10pt;
  font-weight: 700;
}

.label-print-form {
  grid-column: 1 / -1;
}

.label-print-form button {
  width: 100%;
  padding: 4px 6px;
  min-height: 0;
  font-size: 11px;
}



.section-head.compact {
  align-items: center;
  margin-bottom: 10px;
}

.section-head.compact h2 {
  margin: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

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

.resource-chip.compact {
  min-width: 58px;
  justify-content: center;
}

.subsection {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.company-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 0.8fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin: 16px 0;
}

.company-form {
  display: grid;
  gap: 12px;
}

.company-merge-panel {
  margin-top: 18px;
}

.bulk-merge-form {
  margin-top: 14px;
}

.bulk-merge-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.bulk-merge-bar.bottom {
  margin-top: 12px;
}

.merge-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 72px auto;
  gap: 6px;
  margin: 8px 0;
}

.compact-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.9rem;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
  margin-top: 26px;
}

.checkbox-row input {
  width: auto;
}

@media (max-width: 760px) {
  .page {
    padding: 16px;
  }

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

  .section-head,
  .week-control,
  .document-list li,
  .upload-box,
  .internship-document-upload,
  .application-create,
  .application-card-head,
  .application-checklist li,
  .company-filter-form,
  .merge-form,
  .bulk-merge-bar,
  .robot-actions form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .notice-list li,
  .notice-list.compact li {
    grid-template-columns: 1fr;
  }

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

  .island-map {
    min-height: 320px;
  }

  .avatar-editor,
  .avatar-editor button,
  .avatar-cost,
  .avatar-controls {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .avatar-preview {
    position: static;
    max-width: 220px;
  }
}

@media print {
  @page {
    size: 38mm 21mm;
    margin: 0;
  }

  .topbar,
  .toolbar,
  .print-toolbar {
    display: none;
  }

  body {
    background: white;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .label-sheet {
    display: block;
  }

  .ol-label {
    width: 38mm;
    height: 21mm;
    border: 0;
    page-break-after: always;
  }

  .label-print-form {
    display: none;
  }
}

/* Completed OL worksheets: numbers grouped by subject, with an accessible legend. */
.ol-sheet-list, .ol-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.ol-legend { margin: 16px 0; }
.ol-sheet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 5px 10px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ol-mathe { color: #174ea6; background: #e8f0fe; }
.ol-deutsch { color: #9c3212; background: #fff0e6; }
.ol-englisch { color: #166534; background: #e7f6eb; }

/* Print history belongs to the screen, not the physical sticker. */
.label-print-status { grid-column: 1 / -1; padding: 5px; font-size: 11px; line-height: 1.35; border-radius: 4px; }
.label-print-status small { display: block; font-size: 10px; font-weight: normal; }
.label-print-status.is-printed { background: #dcfce7; color: #14532d; }
.label-print-status.is-unrecorded { background: #f3f4f6; color: #4b5563; }
.label-history-note { color: #4b5563; font-size: 14px; }
@media print { .label-print-status, .label-history-note { display: none !important; } }

.student-ol-week { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 16px; }
.student-ol-week > span { min-width: 140px; text-align: center; font-size: 14px; }
.student-ol-week small { display: block; color: #64748b; font-size: 12px; }
.student-ol-week > a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 20px; }

/* Highlight students with a confirmed offer in the teacher dashboard. */
tr.student-has-offer > td { background-color: #ecf8ee; }

.teacher-comment-cell { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 160px; max-width: 360px; }

/* Internship management and mobile company portal. */
.internship-table { overflow-x: auto; }
.internship-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; margin-bottom: 12px; }
.internship-notice { padding: 12px; border-radius: 8px; background: #fff7d6; color: #6b4c00; }
.internship-cancelled { opacity: .65; }
.internship-assessment fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.internship-assessment label, .internship-portal label { display: block; margin: 12px 0; }
.internship-assessment select, .internship-assessment input, .internship-assessment textarea { width: 100%; }
.internship-assessment button { margin: 8px 8px 8px 0; }
.internship-protocol { border-top: 1px solid var(--line); padding: 12px 0; }
.internship-protocol p, .internship-mail pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.internship-mail { border: 1px solid var(--line); padding: 16px; margin: 16px 0; border-radius: 8px; }
.internship-mail pre { font: inherit; }
.assessment-save-status { min-height: 1.5em; }
.internship-assessment input[type="checkbox"] { width: auto; }
.internship-assessment .checkbox-row { display: flex; gap: 8px; align-items: center; }

.internship-student-cell { vertical-align: top; }

.internship-contact-status { display: block; width: fit-content; margin-top: 6px; padding: 4px 7px; border-radius: 5px; font-size: 12px; }
.internship-contact-status.is-missing { background: #fff0c2; color: #714900; font-weight: 700; }
.internship-contact-status.is-complete { color: #28633b; }

tr.student-without-internship > td { background-color: #fde8e8; }

.internship-gap { margin-top: 8px; color: #8b1d1d; font-size: 12px; }
.internship-gap a { display: block; margin-top: 4px; color: #8b1d1d; }

/* Rolling OL history; retain readable text as subject backgrounds fade. */
.ol-history { min-width: 0; max-width: 100%; }
.ol-history-controls { display: flex; align-items: center; gap: .65rem; margin: .7rem 0; }
.ol-history-controls span { flex: 1; font-size: .85rem; color: #526174; }
.ol-history-controls button { padding: .35rem .75rem; }
.ol-history-scroll { overflow-x: auto; max-width: 100%; border: 1px solid #dce3eb; border-radius: .5rem; }
.ol-history-table { position: relative; width: 100%; table-layout: auto; border-collapse: separate; border-spacing: 0; margin: 0; }
.ol-history-table .ol-history-week { min-width: 240px; width: 260px; max-width: 300px; vertical-align: top; padding: .75rem; border-right: 1px solid #e4e9ef; }
.ol-history-week strong, .ol-history-week small, .ol-history-week > span { display: block; }
.ol-history-week[data-current] { background: #e6eef8; }
.ol-history-student { position: sticky; left: 0; z-index: 1; background: #fff; min-width: 155px; max-width: 200px; border-right: 1px solid #cbd5e1; }
.ol-history-student small { display: block; color: #526174; }
.ol-history-count { margin-top: .5rem; color: #526174; }
.ol-history .ol-sheet { white-space: normal; overflow-wrap: anywhere; color: #172334; background: color-mix(in srgb, var(--ol-subject-color) var(--ol-strength), white); }
.ol-history .ol-mathe { --ol-subject-color: #75b7fb; }
.ol-history .ol-deutsch { --ol-subject-color: #f2af64; }
.ol-history .ol-englisch { --ol-subject-color: #69cd91; }
.ol-title-form { grid-column: 1 / -1; min-width: 0; padding: .3rem; }
.ol-title-form label { font-size: .75rem; }
.ol-title-form input { box-sizing: border-box; width: 100%; min-width: 0; padding: .35rem; font-size: .8rem; }
.ol-title-form button { padding: .3rem; font-size: .75rem; margin-top: .25rem; }
@media print { .ol-title-form, .ol-history-controls { display: none !important; } }
