:root {
  --bg: #1e5dff;
  --paper: #ffffff;
  --ink: #111111;
  --accent: #ff8a00;
  --accent-2: #ffe600;
  --border: #000000;
  --shadow: 4px 4px 0 #000000;
  --radius: 16px;
}

* { box-sizing: border-box; }

a { color: inherit; text-decoration: none; }

a:hover { text-decoration: underline; }

body {
  margin: 0;
  padding: 28px 20px 70px;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 50px;
}

@media (max-width: 640px) {
  .page {
    padding-left: 0;
  }
}

.hero {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: nowrap;
  margin-bottom: 20px;
}

.hero-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.logo-image {
  display: block;
  width: min(416px, calc(100vw - 120px));
  height: auto;
}

.logo-link {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
}

.page-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  background: var(--accent-2);
  border: 3px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.tagline {
  margin: 10px 0 0;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000000;
  font-size: 18px;
}

.site-footer {
  margin-top: 32px;
  text-align: left;
  color: #ffffff;
  font-size: 16px;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", Arial, sans-serif;
  font-weight: 400;
}

.teacher-shell {
  display: flex;
  align-items: flex-start;
}

.student-shell {
  display: flex;
  align-items: flex-start;
}

.student-main {
  flex: 1 1 auto;
  min-width: 0;
}

.hero {
  position: relative;
}

.sidebar-open {
  position: fixed;
  left: 12px;
  top: 12px;
  border: none;
  background: transparent;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 20px;
  box-shadow: none;
  z-index: 1100;
}
.sidebar-open.is-hidden {
  display: none;
}
.sidebar-open:hover,
.sidebar-open:active {
  transform: none;
  box-shadow: none;
  background: transparent;
}

@media (max-width: 640px) {
  .sidebar-open {
    left: 8px;
    top: 8px;
  }
  .hero {
    padding-top: 26px;
  }
  .logo-link {
    margin-top: 14px;
  }
}

.history-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  background: #111827;
  color: #e5e7eb;
  padding: 16px 14px;
  box-shadow: 4px 0 16px rgba(0,0,0,0.35);
  transform: translateX(-100%);
  transition: transform 200ms ease;
  z-index: 1000;
  overflow: auto;
}

.history-sidebar.is-open {
  transform: translateX(0);
}

.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 900;
}

.history-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

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

.history-title {
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
}

.history-toggle {
  border: none;
  background: transparent;
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: none;
  font-weight: 900;
  font-size: 18px;
}

.history-toggle:hover,
.history-toggle:active {
  transform: none;
  box-shadow: none;
  background: #1f2937;
}

.history-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.history-new {
  width: 100%;
  border: 1px solid #2f3542;
  background: #111827;
  color: #e5e7eb;
  font-weight: 900;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: none;
}

.history-new:hover,
.history-new:active {
  transform: none;
  box-shadow: none;
  background: #1f2937;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-empty {
  padding: 12px 8px;
  color: #ffffff !important;
  opacity: 1 !important;
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid #2f3542;
  background: #111827;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: none;
  color: #e5e7eb !important;
}

.history-item:hover,
.history-item:active {
  transform: none;
  box-shadow: none;
  background: #2a2b32;
  color: #e5e7eb !important;
}

.history-item.is-active {
  background: #343541;
  border-color: #4b5563;
  color: #e5e7eb !important;
}

.history-item-title {
  font-weight: 900;
  font-size: 14px;
  line-height: 1.3;
  color: #e5e7eb !important;
}

.history-note {
  margin-top: 12px;
  font-size: 12px;
  color: #ffffff !important;
  opacity: 1 !important;
}

.history-item * {
  color: #e5e7eb !important;
}

.teacher-main {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 0;
  margin-top: -25px;
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  padding: 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.teacher-share-button {
  background: var(--accent-2);
  min-width: 50px;
  min-height: 50px;
}

.teacher-share-button img {
  display: block;
  width: 29px;
  height: 29px;
}

@media (max-width: 900px) {
  .teacher-shell {
    flex-direction: column;
  }
  .student-shell {
    flex-direction: column;
  }
}

.site-footer * {
  text-shadow: none;
  font-family: inherit;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-links a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 400;
}

.footer-links-left,
.footer-links-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-sep {
  color: #ffffff;
  opacity: 0.7;
  font-weight: 400;
}

.footer-sep-main {
  margin: 0 6px;
}

.footer-note {
  font-size: 14px;
  font-weight: 400;
}

.footer-disclaimer {
  margin: 6px 0 8px;
  font-size: 10px;
  font-weight: 400;
  text-align: left;
}

.card {
  background: var(--paper);
  border: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

.student-entry {
  text-align: center;
}

.student-entry .row {
  justify-content: center;
}

.student-entry input {
  text-align: center;
}

.student-entry-actions {
  margin-top: 14px;
}

.legal-doc h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", Arial, sans-serif;
  font-weight: 500;
}

.legal-doc h3 {
  margin: 16px 0 6px;
  font-size: 20px;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", Arial, sans-serif;
  font-weight: 500;
}

.legal-doc p {
  margin: 0 0 10px;
  line-height: 1.7;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", Arial, sans-serif;
  font-weight: 400;
}

.legal-doc ul {
  margin: 0 0 10px 22px;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", Arial, sans-serif;
  font-weight: 400;
}

.legal-doc li {
  margin: 4px 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", Arial, sans-serif;
  font-weight: 400;
}

.legal-doc {
  text-shadow: none;
  font-weight: 400;
}
.label-badge {
  display: inline-block;
  padding: 6px 14px;
  margin: 12px 0 8px;
  background: var(--accent-2);
  border: 3px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.note-text {
  margin-left: auto;
  text-align: right;
  font-size: 16px;
  font-weight: 600;
}

.label-tag {
  display: inline-block;
  padding: 6px 10px;
  background: #fff7a6;
  border: 3px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
}

.settings-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-button {
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 800;
  min-width: 0;
  border: none;
  border-radius: 8px;
  background: #efefef;
  box-shadow: none;
}

.option-button.is-active {
  background: #444444;
  color: #ffffff;
}

.option-button:hover,
.option-button:active {
  transform: none;
  box-shadow: none;
}

.topic-box-wrap {
  position: relative;
}

.topic-box-wrap.is-loading .topic-box {
  background: #e0e0e0;
}

.topic-loading {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: none;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #333333;
  pointer-events: none;
  z-index: 2;
}

.topic-box-wrap.is-loading .topic-loading {
  display: inline-flex;
}

.topic-loading::after {
  content: "...";
  display: inline-block;
  width: 0;
  overflow: hidden;
  animation: topic-dots 1.2s steps(4, end) infinite;
}

@keyframes topic-dots {
  to { width: 1.2em; }
}

.help-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}

.help-label {
  font-size: 16px;
  font-weight: 500;
  color: #757575;
}

/* Toggle (お助けモード) */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle__input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__input:checked + .toggle__slider {
  background: #1F5DFF;
}

.toggle__input:checked + .toggle__slider::before {
  transform: translateX(16px);
}

.toggle__input:focus-visible + .toggle__slider {
  outline: 2px solid;
}

.toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}

.toggle__slider::before {
  border-radius: 50%;
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  transition: 0.3s;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
}


.topic-gen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  min-width: 0;
}

.topic-gen-btn:hover,
.topic-gen-btn:active {
  box-shadow: none;
  transform: none;
}

.topic-gen-btn img {
  display: block;
  width: 38px;
  height: 38px;
}

.settings-panel.is-locked,
.topic-box-wrap.is-locked {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.2);
}

.advanced-settings {
  margin-top: 16px;
}

.advanced-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  list-style: none;
}

.advanced-summary::-webkit-details-marker {
  display: none;
}

.advanced-icon {
  display: block;
  width: 25px;
  height: 25px;
  transition: transform 0.2s ease;
}

.advanced-icon.is-spinning {
  animation: advanced-spin 0.3s linear 1;
}

@keyframes advanced-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


.advanced-body {
  margin-top: 10px;
  padding: 12px 0 0;
}

.advanced-body .muted {
  margin-bottom: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.custom-input {
  margin-top: 6px;
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.5;
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  resize: vertical;
}

.auto-grow {
  overflow: hidden;
  resize: none;
}

.topic-box {
  min-height: 100px;
  padding-right: 64px;
}

@media (max-width: 640px) {
  .topic-box {
    min-height: 140px;
  }
}

input,
select {
  min-width: 220px;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 20px;
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

pre {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 4px solid var(--border);
  box-shadow: var(--shadow);
  white-space: pre-wrap;
  font-family: inherit;
  font-weight: 800;
  font-size: 19px;
}

.ai-output {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 4px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.6;
  word-break: break-word;
}

.ai-output p {
  margin: 0 0 10px;
}

.ai-output p:last-child {
  margin-bottom: 0;
}

.ai-output h2,
.ai-output h3,
.ai-output h4 {
  margin: 8px 0 6px;
  font-weight: 900;
}

.ai-output h2 { font-size: 28px; }
.ai-output h3 { font-size: 24px; }
.ai-output h4 { font-size: 22px; }

.ai-output .ai-underline {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.ai-output .ai-gap {
  height: 10px;
}

.ai-output .ai-list {
  margin: 0 0 10px 22px;
  padding: 0;
  list-style: disc;
}

.ai-output .ai-list li {
  margin: 4px 0;
}

.ai-output.ai-comment,
.ai-output .ai-comment-heading,
.ai-output .ai-comment-block {
  color: #1e63c8;
}

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

.report-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-msg {
  font-size: 12px;
  color: #4B4B4B;
  white-space: nowrap;
}

.recent-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #333333;
  white-space: nowrap;
}

.recent-filter input {
  min-width: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 4px;
  box-shadow: none;
}

button.report-refresh {
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.report-refresh:hover,
.report-refresh:active {
  transform: none;
  box-shadow: none;
}

.refresh-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.report-refresh.is-spinning .refresh-icon {
  animation: refresh-spin 0.7s linear;
}

@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.report-tabs {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.tab-button {
  font-size: 16px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #efefef;
  color: #000000;
  box-shadow: none;
}

.tab-button.active {
  background: #444444;
  color: #ffffff;
}

.tab-button:hover,
.tab-button:active {
  transform: none;
  box-shadow: none;
}

.tab-panel {
  margin-top: 6px;
}

.drafts-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drafts-item {
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e5e5;
}

.drafts-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.drafts-item-head {
  font-weight: 800;
  margin-bottom: 10px;
}

.drafts-item-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.drafts-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.drafts-label {
  font-weight: 800;
  margin-bottom: 6px;
  min-height: 22px;
}

.drafts-text {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: none;
  box-shadow: none;
  font-weight: 800;
  font-size: 19px;
  line-height: 1.6;
  word-break: break-word;
}

.drafts-text p {
  margin: 0 0 10px;
}

.drafts-text p:last-child {
  margin-bottom: 0;
}

.drafts-comment {
  color: #1e63c8;
}

.drafts-comment .ai-underline {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.drafts-comment .ai-list {
  margin: 0 0 10px 22px;
  padding: 0;
  list-style: disc;
}

.drafts-comment .ai-list li {
  margin: 4px 0;
}

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

.finals-list .drafts-text {
  border: none;
  box-shadow: none;
}

.finals-list .ai-output,
#finalsBox .ai-output {
  border: none;
  box-shadow: none;
}

.final-comment .ai-output {
  color: #1e63c8;
}

.copy-button {
  border: 3px solid currentColor;
  background: transparent;
  color: #000000;
  border-radius: 999px;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.copy-button:hover {
  transform: translate(1px, 1px);
}

.copy-button--light {
  color: #ffffff;
  box-shadow: 3px 3px 0 #000000;
}

.copy-button--dark {
  color: #000000;
}

.copy-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.copy-button--light .copy-icon {
  filter: invert(1);
}

.mini-button {
  border: 2px solid var(--border);
  background: #ffffff;
  color: #000000;
  border-radius: 999px;
  padding: 7px 12px;
  min-height: 34px;
  box-shadow: 2px 2px 0 #000000;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.mini-button:hover,
.mini-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000000;
}

.mini-button:disabled,
.mini-button[aria-disabled="true"] {
  color: #666666;
  background: #eeeeee;
  cursor: not-allowed;
  opacity: 0.75;
}

.mini-button:disabled:hover,
.mini-button:disabled:active,
.mini-button[aria-disabled="true"]:hover,
.mini-button[aria-disabled="true"]:active {
  transform: none;
  box-shadow: 2px 2px 0 #000000;
}

.prompt-box {
  margin-top: 8px;
}

button {
  cursor: pointer;
  border: 4px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: #000000;
  font-family: inherit;
  font-weight: 900;
  font-size: 20px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translate(1px, 1px);
}

button:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 #000000;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.cta-button {
  font-size: 24px;
  padding: 18px 34px;
  min-width: 240px;
}

.secondary-button {
  background: var(--accent-2);
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.row.center {
  justify-content: center;
}

.settings-row {
  align-items: flex-start;
}

.action-row {
  margin-top: 18px;
}

.center-text {
  text-align: center;
  margin-top: 8px;
}

.muted {
  color: #222222;
}

.error {
  color: #d30000;
}

.small {
  font-size: 16px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

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

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

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

.panel {
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.step-panel {
  position: relative;
  overflow: hidden;
}

.step-panel::after {
  content: attr(data-step);
  position: absolute;
  right: 12px;
  bottom: -18px;
  font-size: clamp(88px, 12vw, 160px);
  font-weight: 900;
  color: #b7e6ff;
  opacity: 0.6;
  line-height: 1;
  z-index: 0;
  pointer-events: none;
}

.step-panel > * {
  position: relative;
  z-index: 1;
}

.final-comment {
  margin-top: 14px;
}

.tam-survey {
  margin-top: 14px;
}

.survey-intro {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
}

.survey-questions {
  display: grid;
  gap: 12px;
}

.survey-question {
  border: 2px solid #d8d8d8;
  border-radius: 12px;
  padding: 10px;
  margin: 0;
}

.survey-question legend {
  padding: 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.survey-scale {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.survey-scale label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
}

.survey-scale input {
  min-width: 0;
  width: 18px;
  height: 18px;
  box-shadow: none;
}

.survey-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: #333333;
}

.survey-scale-labels span:last-child {
  text-align: right;
}

.survey-free-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 700;
}

.survey-free-text textarea {
  min-height: 90px;
  font-size: 16px;
  font-weight: 500;
  box-shadow: none;
  border-width: 3px;
  margin-bottom: 0;
}

.tam-survey .panel-actions {
  margin-top: 4px;
  align-items: center;
}

.panel-actions {
  justify-content: flex-end;
}

.panel-actions .muted {
  margin-right: auto;
}

.panel-title {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  background: var(--accent-2);
  border: 3px solid var(--border);
  border-radius: 999px;
  font-size: 17px;
}

.hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-card {
  position: relative;
  width: min(92vw, 560px);
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  border: 4px solid var(--border);
  box-shadow: 6px 6px 0 #000000;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  border: 4px solid var(--border);
  background: var(--accent-2);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 #000000;
}

.modal-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-qr {
  width: min(320px, 80vw);
  height: min(320px, 80vw);
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.modal-url-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.modal-url {
  width: min(100%, 420px);
}

.teacher-share-warning {
  width: min(100%, 420px);
  padding: 10px 12px;
  border: 3px solid #d30000;
  border-radius: 12px;
  background: #fff3f3;
  color: #d30000;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.spotlight-modal {
  position: fixed;
  inset: 0;
  display: none;
  background: #111111;
  color: #ffffff;
  z-index: 2000;
  padding: 28px;
}

.spotlight-modal.open {
  display: block;
}

.spotlight-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.spotlight-close {
  position: fixed;
  right: 22px;
  top: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  background: var(--accent-2);
  color: #000000;
  z-index: 2010;
}

.spotlight-student {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 900;
  padding-right: 64px;
}

.spotlight-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.spotlight-grid section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spotlight-grid h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 38px);
}

.spotlight-text {
  flex: 1 1 auto;
  overflow: auto;
  background: #ffffff;
  color: #000000;
  border: 5px solid #000000;
  border-radius: 14px;
  padding: 20px;
  font-size: clamp(24px, 3vw, 44px);
  line-height: 1.55;
  word-break: break-word;
}

.spotlight-comment {
  color: #1e63c8;
}

@media (max-width: 760px) {
  .spotlight-grid {
    grid-template-columns: 1fr;
  }
  .spotlight-modal {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
