:root {
  color-scheme: light;
  --bg: #f4efe8;
  --panel: #fffaf4;
  --text: #21313f;
  --muted: #66737f;
  --line: #d9ccc0;
  --accent: #205072;
  --accent-2: #3b7a57;
  --danger: #9a3d37;
  --shadow: 0 10px 30px rgba(33, 49, 63, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(32, 80, 114, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 122, 87, 0.08), transparent 24%),
    var(--bg);
  color: var(--text);
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto 48px;
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 6px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 2px;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
  outline: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  text-decoration: none;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(217, 204, 192, 0.9);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
}

.nav a[aria-current="page"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.hero, .panel {
  background: rgba(255, 250, 244, 0.88);
  border: 1px solid rgba(217, 204, 192, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.home-entry {
  display: grid;
  column-gap: 22px;
  row-gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.home-entry[hidden] {
  display: none;
}

.home-role-card {
  position: relative;
  min-width: 0;
  min-height: 190px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 30px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(161, 184, 202, 0.28);
  border-radius: 22px;
  box-shadow: 0 16px 42px rgba(39, 72, 99, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.home-role-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 22px 0 0 22px;
}

.home-role-student {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(235, 246, 255, 0.88));
}

.home-role-student::before {
  background: #4b87bd;
}

.home-role-teacher {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(237, 248, 241, 0.9));
}

.home-role-teacher::before {
  background: #5f9575;
}

.home-role-card:hover,
.home-role-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(74, 123, 157, 0.38);
  box-shadow: 0 20px 48px rgba(39, 72, 99, 0.15);
  outline: 3px solid rgba(75, 135, 189, 0.16);
  outline-offset: 3px;
}

.home-card-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 25px;
  line-height: 1;
}

.home-role-student .home-card-icon {
  color: #2f6f9f;
  background: rgba(75, 135, 189, 0.12);
}

.home-role-teacher .home-card-icon {
  color: #447b5b;
  background: rgba(95, 149, 117, 0.14);
}

.home-card-copy {
  min-width: 0;
}

.home-role-card h2 {
  font-size: 21px;
  line-height: 1.35;
}

.home-role-card p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.6;
}

.home-card-note {
  display: block;
  margin-top: 7px;
  color: #8a9aa6;
  font-size: 12px;
  line-height: 1.5;
}

.home-card-arrow {
  color: #6f8393;
  font-size: 22px;
  transition: transform 180ms ease;
}

.home-footer-note {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 18px 0 2px;
  color: #91a0aa;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.home-role-card:hover .home-card-arrow,
.home-role-card:focus-visible .home-card-arrow {
  transform: translateX(3px);
}

body.home-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 12%, rgba(91, 153, 207, 0.17), transparent 31%),
    radial-gradient(circle at 87% 22%, rgba(101, 166, 128, 0.14), transparent 29%),
    linear-gradient(145deg, #f8fbff 0%, #f2f7fb 52%, #f7fbf8 100%);
}

body.home-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(75, 118, 151, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 118, 151, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 76%);
}

.home-page .shell {
  position: relative;
  z-index: 1;
  width: min(940px, calc(100% - 40px));
  min-height: calc(100vh - 56px);
  align-content: center;
  gap: 34px;
  transform: translateY(-3vh);
}

.home-page .topbar,
.home-page .shell > .panel:not(.home-entry) {
  display: none;
}

.home-page .hero {
  padding: 12px 24px 4px;
  text-align: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home-hero-content {
  display: grid;
  justify-items: center;
}

.home-tagline {
  justify-self: start;
  margin: 0 0 14px;
  color: #8a9aa5;
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.home-mark {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: #376f99;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(74, 123, 157, 0.18);
  border-radius: 17px;
  box-shadow: 0 10px 28px rgba(47, 94, 128, 0.1);
  font-size: 23px;
}

.home-page .hero h1 {
  margin-bottom: 12px;
  font-size: clamp(36px, 5vw, 50px);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #1e3445;
}

.home-page .hero .lead {
  max-width: none;
  color: #4f6575;
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  font-weight: 700;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.lead {
  color: var(--muted);
  line-height: 1.6;
  max-width: 70ch;
}

.notice {
  background: #f4f8ff;
  border: 1px solid #d7e3f6;
  color: #32506d;
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.7;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 14px;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: #5f7f69;
  background: transparent;
  border-radius: 10px;
  box-shadow: none;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #396949;
  background: rgba(95, 149, 117, 0.1);
  outline: none;
}

.password-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(95, 149, 117, 0.16);
}

.password-toggle-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 18px;
}

.eye-shape {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 14px;
  height: 14px;
  border: 1.8px solid currentColor;
  border-radius: 75% 16%;
  transform: rotate(45deg);
}

.eye-shape::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  content: '';
  transform: translate(-50%, -50%);
}

.eye-slash {
  position: absolute;
  top: 8px;
  left: 1px;
  width: 20px;
  height: 1.8px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(-42deg);
  transition: opacity 120ms ease;
}

.password-toggle.is-visible .eye-slash {
  opacity: 0;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 270px;
  line-height: 1.6;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

select:focus {
  border-color: rgba(32, 80, 114, 0.6);
  box-shadow: 0 0 0 3px rgba(32, 80, 114, 0.12);
}

input:focus, textarea:focus {
  border-color: rgba(32, 80, 114, 0.6);
  box-shadow: 0 0 0 3px rgba(32, 80, 114, 0.12);
}

.meta-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.confirm-list {
  display: block;
  width: 100%;
  gap: 12px;
  margin-top: 12px;
}

.check {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  width: 100% !important;
  max-width: none !important;
  justify-content: start;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.check input {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 4px;
}

.check span {
  display: block;
  min-width: 0;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.chip, .status {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: white;
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.submit-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 18px rgba(32, 80, 114, 0.18);
}

.secondary {
  background: #e8f0eb;
  color: #20422e;
}

.danger {
  background: #f4dfdc;
  color: var(--danger);
}

#teacherClearBtn {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(154, 61, 55, 0.28);
  font-weight: 600;
  box-shadow: none;
}

#teacherClearBtn:hover,
#teacherClearBtn:focus-visible {
  background: rgba(244, 223, 220, 0.55);
  border-color: rgba(154, 61, 55, 0.5);
  outline: none;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}

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

.output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  line-height: 1.7;
  min-height: 180px;
}

.feedback-grid {
  display: grid;
  gap: 12px;
}

.student-feedback-panel {
  padding: 24px;
}

.student-feedback-panel .feedback-grid {
  min-height: 240px;
}

.student-feedback-panel .feedback-card {
  padding: 20px;
}

.feedback-grid.empty {
  min-height: 140px;
}

.student-feedback-panel .feedback-grid.empty {
  min-height: 240px;
}

.feedback-empty {
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
}

.feedback-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(33, 49, 63, 0.05);
}

.feedback-title {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.4;
}

.feedback-body {
  color: var(--text);
  line-height: 1.75;
  white-space: normal;
}

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

.list.empty {
  color: var(--muted);
}

.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.item.selected {
  border-color: rgba(32, 80, 114, 0.42);
  background: #f5f9fc;
  box-shadow: inset 0 0 0 1px rgba(32, 80, 114, 0.12);
}

.item-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.item-title {
  font-weight: 700;
}

.item-meta {
  color: var(--muted);
  font-size: 13px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  background: #edf3f7;
  padding: 6px 10px;
  font-size: 12px;
  color: #345162;
}

.link-btn {
  padding: 8px 12px;
  background: #eef2f7;
  color: #27465b;
  border-radius: 10px;
  justify-self: start;
}

@media (max-width: 860px) {
  .form-grid, .teacher-grid, .span-2 {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .shell {
    width: min(100%, calc(100% - 20px));
    margin: 16px auto 28px;
  }

  .hero, .panel {
    padding: 16px;
  }

  .home-entry {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .home-page .shell {
    width: min(100%, calc(100% - 28px));
    min-height: calc(100vh - 44px);
    align-content: start;
    gap: 24px;
    padding-top: 18px;
    transform: none;
  }

  .home-page .hero {
    padding: 8px 8px 0;
  }

  .home-tagline {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .home-role-card {
    min-height: 142px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 22px 20px;
    border-radius: 19px;
  }

  .home-page .hero h1 {
    font-size: clamp(31px, 9vw, 39px);
  }

  .home-page .hero .lead {
    font-size: 16px;
  }

  .home-mark {
    width: 46px;
    height: 46px;
    margin-bottom: 15px;
    border-radius: 15px;
  }

  .home-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 22px;
  }

  h1 {
    font-size: 24px;
  }

  .section-head, .item-top {
    align-items: flex-start;
    flex-direction: column;
  }

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

  textarea {
    min-height: 220px;
  }

  .confirm-list {
    gap: 10px;
  }

  .check {
    column-gap: 10px;
    font-size: 13px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

  input, textarea, select, button {
    border-radius: 10px;
  }
}

@media (max-width: 430px) {
  .home-page .shell {
    width: calc(100% - 24px);
    margin: 12px auto 22px;
    gap: 20px;
    padding-top: 0;
  }

  .home-entry {
    gap: 14px;
  }

  .home-footer-note {
    margin-top: 16px;
  }

  .home-role-card {
    min-height: 132px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 19px 16px;
  }

  .home-card-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .home-role-card h2 {
    font-size: 19px;
  }

  .home-role-card p,
  .home-footer-note {
    font-size: 13px;
  }

  .home-card-note {
    margin-top: 5px;
    font-size: 11px;
  }

  .home-card-arrow {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-role-card,
  .home-card-arrow {
    transition: none;
  }
}

/* Student and teacher pages: shared classroom tool visual language. */
body[data-page="student"]:not(.home-page),
body[data-page="teacher"] {
  min-height: 100vh;
  overflow-x: hidden;
}

body[data-page="student"]:not(.home-page) {
  background:
    radial-gradient(circle at 12% 8%, rgba(91, 153, 207, 0.16), transparent 29%),
    radial-gradient(circle at 90% 22%, rgba(126, 184, 218, 0.12), transparent 25%),
    linear-gradient(145deg, #f8fbff 0%, #f1f7fc 58%, #f7fbff 100%);
}

body[data-page="teacher"] {
  background:
    radial-gradient(circle at 13% 9%, rgba(105, 166, 128, 0.16), transparent 29%),
    radial-gradient(circle at 88% 22%, rgba(132, 189, 151, 0.12), transparent 25%),
    linear-gradient(145deg, #f8fcf9 0%, #f1f8f3 58%, #f8fcf9 100%);
}

body[data-page="student"]:not(.home-page)::before,
body[data-page="teacher"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(74, 118, 151, 0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 118, 151, 0.027) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.54), transparent 72%);
}

body[data-page="student"]:not(.home-page) .shell,
body[data-page="teacher"] .shell {
  position: relative;
  z-index: 1;
  gap: 20px;
}

body[data-page="student"]:not(.home-page) .topbar,
body[data-page="teacher"] .topbar {
  padding: 2px 4px;
}

body[data-page="student"]:not(.home-page) .back-link,
body[data-page="teacher"] .back-link {
  padding: 8px 4px;
  color: #627889;
}

body[data-page="teacher"] .back-link {
  color: #5f7869;
}

body[data-page="student"]:not(.home-page) .hero,
body[data-page="teacher"] .hero {
  padding: 24px 28px;
  border: 1px solid rgba(163, 190, 207, 0.32);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 36px rgba(43, 82, 111, 0.09);
  backdrop-filter: blur(10px);
}

body[data-page="teacher"] .hero {
  border-color: rgba(150, 190, 164, 0.36);
  box-shadow: 0 14px 36px rgba(57, 99, 72, 0.09);
}

.page-hero-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-hero-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #3475a5;
  background: rgba(75, 135, 189, 0.12);
  font-size: 23px;
  line-height: 1;
}

body[data-page="teacher"] .page-hero-icon {
  color: #4d8061;
  background: rgba(95, 149, 117, 0.14);
}

body[data-page="student"]:not(.home-page) .hero h1,
body[data-page="teacher"] .hero h1 {
  margin: 0;
  color: #20394d;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

body[data-page="teacher"] .hero h1 {
  color: #254332;
}

.page-hero-note {
  margin-top: 5px;
  color: #708591;
  font-size: 14px;
  line-height: 1.6;
}

body[data-page="teacher"] .page-hero-note {
  color: #708477;
}

body[data-page="student"]:not(.home-page) .panel,
body[data-page="teacher"] .panel {
  padding: 24px;
  border: 1px solid rgba(163, 190, 207, 0.32);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(43, 82, 111, 0.08);
  backdrop-filter: blur(8px);
}

body[data-page="teacher"] .panel {
  border-color: rgba(150, 190, 164, 0.36);
  box-shadow: 0 14px 36px rgba(57, 99, 72, 0.08);
}

body[data-page="student"]:not(.home-page) input,
body[data-page="student"]:not(.home-page) textarea,
body[data-page="student"]:not(.home-page) select {
  border-color: rgba(126, 166, 193, 0.42);
  background: rgba(255, 255, 255, 0.94);
}

body[data-page="teacher"] input,
body[data-page="teacher"] textarea,
body[data-page="teacher"] select {
  border-color: rgba(129, 169, 143, 0.42);
  background: rgba(255, 255, 255, 0.94);
}

body[data-page="student"]:not(.home-page) input:focus,
body[data-page="student"]:not(.home-page) textarea:focus,
body[data-page="student"]:not(.home-page) select:focus {
  border-color: rgba(51, 117, 165, 0.7);
  box-shadow: 0 0 0 3px rgba(75, 135, 189, 0.13);
}

body[data-page="teacher"] input:focus,
body[data-page="teacher"] textarea:focus,
body[data-page="teacher"] select:focus {
  border-color: rgba(77, 128, 97, 0.7);
  box-shadow: 0 0 0 3px rgba(95, 149, 117, 0.14);
}

body[data-page="student"]:not(.home-page) .primary {
  background: #3475a5;
  box-shadow: 0 9px 20px rgba(52, 117, 165, 0.2);
}

body[data-page="teacher"] .primary {
  background: #4d8061;
  box-shadow: 0 9px 20px rgba(77, 128, 97, 0.2);
}

body[data-page="teacher"] .secondary {
  background: rgba(95, 149, 117, 0.12);
  color: #396949;
}

body[data-page="student"]:not(.home-page) .chip,
body[data-page="student"]:not(.home-page) .status,
body[data-page="teacher"] .status {
  border-color: rgba(151, 182, 201, 0.42);
  background: rgba(255, 255, 255, 0.88);
}

body[data-page="teacher"] .status {
  border-color: rgba(151, 184, 161, 0.45);
}

body[data-page="student"]:not(.home-page) .student-feedback-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(239, 248, 255, 0.88));
}

body[data-page="student"]:not(.home-page) .student-feedback-panel .section-head {
  margin-bottom: 16px;
}

body[data-page="student"]:not(.home-page) #historyBtn {
  color: #356e97;
  background: rgba(75, 135, 189, 0.1);
  border: 1px solid rgba(75, 135, 189, 0.22);
  box-shadow: none;
}

body[data-page="student"]:not(.home-page) #historyBtn:hover,
body[data-page="student"]:not(.home-page) #historyBtn:focus-visible {
  color: #275c84;
  background: rgba(75, 135, 189, 0.16);
  border-color: rgba(75, 135, 189, 0.38);
  outline: none;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .list {
  gap: 14px;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .item {
  padding: 18px;
  border-color: rgba(145, 181, 205, 0.38);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(43, 82, 111, 0.05);
}

body[data-page="student"]:not(.home-page) #studentHistorySection .item-top {
  align-items: flex-start;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .item-title {
  color: #20394d;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .item-meta {
  margin-top: 4px;
  color: #708591;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .link-btn {
  color: #356e97;
  background: rgba(75, 135, 189, 0.1);
  border: 1px solid rgba(75, 135, 189, 0.2);
}

body[data-page="student"]:not(.home-page) #studentHistorySection .link-btn:hover,
body[data-page="student"]:not(.home-page) #studentHistorySection .link-btn:focus-visible {
  color: #275c84;
  background: rgba(75, 135, 189, 0.16);
  border-color: rgba(75, 135, 189, 0.38);
  outline: none;
}

body[data-page="student"]:not(.home-page) #studentHistorySection [id^="historyFeedback-"] {
  min-width: 0;
  margin-top: 4px;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .feedback-grid {
  min-height: 0;
  gap: 12px;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .feedback-card {
  padding: 18px;
}

body[data-page="student"]:not(.home-page) #studentHistorySection .feedback-body {
  line-height: 1.82;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-page="student"]:not(.home-page) .feedback-grid {
  gap: 16px;
}

body[data-page="student"]:not(.home-page) .feedback-card,
body[data-page="student"]:not(.home-page) .feedback-empty {
  padding: 22px;
  border-color: rgba(145, 181, 205, 0.38);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

body[data-page="student"]:not(.home-page) .feedback-title {
  color: #294e69;
  font-size: 17px;
}

body[data-page="student"]:not(.home-page) .feedback-body {
  font-size: 15px;
  line-height: 1.9;
}

body[data-page="teacher"] .teacher-submissions-panel {
  border-top: 4px solid rgba(95, 149, 117, 0.62);
}

body[data-page="teacher"] .teacher-detail-panel {
  border-top: 4px solid rgba(76, 132, 112, 0.45);
}

body[data-page="teacher"] .teacher-summary-panel {
  border-top: 4px solid rgba(65, 116, 83, 0.7);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(239, 248, 241, 0.9));
}

body[data-page="teacher"] .item,
body[data-page="teacher"] .output {
  border-color: rgba(142, 181, 155, 0.38);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

body[data-page="teacher"] .item.selected {
  border-color: rgba(77, 128, 97, 0.5);
  background: #f1f8f3;
  box-shadow: inset 0 0 0 1px rgba(77, 128, 97, 0.12);
}

body[data-page="teacher"] .tag {
  color: #426a50;
  background: #eaf4ec;
}

body[data-page="teacher"] .link-btn {
  color: #376548;
  background: #e9f3eb;
}

@media (max-width: 860px) {
  body[data-page="student"]:not(.home-page) .shell,
  body[data-page="teacher"] .shell {
    width: min(100%, calc(100% - 24px));
    margin: 12px auto 24px;
    gap: 14px;
  }

  body[data-page="student"]:not(.home-page) .hero,
  body[data-page="teacher"] .hero,
  body[data-page="student"]:not(.home-page) .panel,
  body[data-page="teacher"] .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .page-hero-content {
    align-items: flex-start;
    gap: 12px;
  }

  .page-hero-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 20px;
  }

  body[data-page="student"]:not(.home-page) .hero h1,
  body[data-page="teacher"] .hero h1 {
    font-size: 25px;
  }

  .page-hero-note {
    font-size: 13px;
  }

  body[data-page="student"]:not(.home-page) .student-feedback-panel .feedback-grid {
    min-height: 220px;
  }

  body[data-page="student"]:not(.home-page) .feedback-card,
  body[data-page="student"]:not(.home-page) .feedback-empty {
    padding: 18px;
  }

  body[data-page="student"]:not(.home-page) .feedback-body {
    font-size: 14px;
    line-height: 1.82;
  }

  body[data-page="student"]:not(.home-page) #studentHistorySection .item {
    padding: 16px;
  }

  body[data-page="student"]:not(.home-page) #studentHistorySection .link-btn {
    width: 100%;
    text-align: center;
  }

  body[data-page="student"]:not(.home-page) #studentHistorySection .feedback-card {
    padding: 16px;
  }

  body[data-page="teacher"] .item,
  body[data-page="teacher"] .output {
    padding: 14px;
    border-radius: 14px;
  }

  body[data-page="teacher"] .teacher-summary-panel .section-head .secondary {
    width: 100%;
  }
}
