: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;
  margin-bottom: 20px;
}

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

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

.logo-link {
  display: inline-block;
}

.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;
}

@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;
  font-family: "Lexend", "Noto Sans JP", sans-serif;
  font-weight: 400;
}

@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;
}

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

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-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.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;
}

.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;
}

.code-modal-card {
  width: min(94vw, 780px);
}

.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);
}

.code-delivery-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(260px, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.issued-code-panel,
.gpts-link-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 3px solid var(--border);
  border-radius: 16px;
  background: #f3f8ff;
  box-shadow: 3px 3px 0 #000000;
}

.gpts-link-panel {
  background: #fff8d7;
}

.delivery-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.issued-code-text {
  width: 100%;
  padding: 14px 10px;
  border: 3px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  font-size: clamp(24px, 3.8vw, 34px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.gpts-qr {
  width: min(240px, 60vw);
  height: min(240px, 60vw);
  background: #ffffff;
}

.gpts-open-link {
  text-decoration: none;
}

.gpts-open-link:hover {
  text-decoration: none;
}

.share-mode-options {
  width: 100%;
  display: grid;
  gap: 10px;
}

.share-mode-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 3px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 3px 3px 0 #000000;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.share-mode-card:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #000000;
}

.share-mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.share-check {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 3px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.share-check::after {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 4px solid #000000;
  border-bottom: 4px solid #000000;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

.share-mode-card:has(input:checked) {
  background: #fff6bf;
}

.share-mode-card:has(input:checked) .share-check {
  background: var(--accent-2);
}

.share-mode-card:has(input:checked) .share-check::after {
  transform: rotate(-45deg) scale(1);
}

.share-mode-card strong,
.share-mode-card small {
  display: block;
}

.share-mode-card strong {
  font-size: 17px;
  line-height: 1.3;
}

.share-mode-card small {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 650;
  color: #444444;
}

.share-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.share-qr-wrap.hidden {
  display: none;
}

.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;
}

.simple-main {
  max-width: 920px;
  margin: 0 auto;
}

.policy-card h1,
.share-page-card h1 {
  margin: 10px 0 16px;
  font-size: 34px;
}

.policy-card h2 {
  margin: 22px 0 8px;
  font-size: 24px;
}

.policy-card p {
  margin: 0 0 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.75;
}

.policy-updated {
  margin-top: 24px !important;
  color: #555555;
}

.public-share-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.public-share-item {
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.public-share-item h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.public-share-item h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

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

.public-share-text {
  font-size: 18px;
  font-family: "Lexend", "Noto Sans JP", sans-serif;
  font-weight: 400;
  line-height: 1.65;
  padding: 0;
  border-radius: 0;
  background: transparent;
  word-break: break-word;
}

.student-english-text {
  font-family: "Lexend", "Noto Sans JP", sans-serif;
  font-weight: 400;
}

.ai-feedback-text,
.ai-feedback-text .ai-comment-block,
.ai-feedback-text .ai-comment-heading,
.ai-feedback-text .ai-list,
.ai-feedback-text p {
  font-family: "Lexend", "Noto Sans JP", sans-serif;
  font-weight: 400;
}

.analysis-output p,
.analysis-output .ai-list,
.analysis-output .ai-list li,
.analysis-output .ai-comment-block,
.analysis-output .ai-comment-heading,
.analysis-output .ai-underline {
  font-family: "Lexend", "Noto Sans JP", sans-serif;
  font-weight: 400;
}

.public-share-comment {
  color: #1e63c8;
}

.guide-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 34px 42px;
  display: flex;
  flex-direction: column;
  gap: 0;
  color: #000000;
  background: #ffffff;
  border: 4px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", "Noto Sans JP", sans-serif;
}

.guide-main .card,
.guide-role-card,
.guide-trigger-box {
  border: 0;
  box-shadow: none;
}

.guide-main .card {
  margin: 0;
  padding: 0;
  background: transparent;
}

.guide-main > section + section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #d7e2ff;
}

.guide-hero-card h1 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.18;
}

.guide-hero-card p,
.guide-step p {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.75;
  color: #000000;
}

.guide-flow-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.guide-flow-head {
  width: 100%;
}

.guide-flow-card h2 {
  margin: 10px 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.22;
}

.guide-flow-zoom {
  width: min(100%, 820px);
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  transition: none;
}

.guide-flow-zoom:hover,
.guide-flow-zoom:active {
  transform: none;
  box-shadow: none;
}

.guide-flow-zoom:focus {
  outline: none;
}

.guide-flow-zoom:focus-visible {
  outline: 3px solid #ff8a00;
  outline-offset: 6px;
}

.guide-flow-image {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #1e5dff;
}

.guide-flow-description {
  max-width: 780px;
  margin: 0 auto;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.75;
  color: #000000;
  text-align: left;
}

.guide-role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
}

.guide-role-card {
  background: #f8fbff;
  border: 2px solid #d7e2ff;
  border-radius: 12px;
  padding: 18px;
  text-align: left;
}

.guide-role-card h2 {
  margin: 8px 0 10px;
  font-size: 25px;
  line-height: 1.3;
}

.guide-role-card h3 {
  margin: 10px 0 8px;
  font-size: 21px;
  line-height: 1.35;
}

.guide-role-card p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  color: #000000;
}

.guide-role-card ul,
.guide-trigger-list {
  margin: 0;
  padding-left: 22px;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.75;
  color: #000000;
}

.guide-role-card li,
.guide-trigger-list li {
  margin-bottom: 8px;
}

.guide-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px 10px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--accent-2);
  font-weight: 800;
}

.guide-trigger-box {
  grid-column: 1 / -1;
  background: #f8fbff;
  border: 2px solid #d7e2ff;
  border-radius: 12px;
  padding: 18px;
}

.guide-trigger-box h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.35;
}

.guide-trigger-box p {
  margin: 0 0 12px;
}

.guide-trigger-list code {
  background: #fff7c8;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 2px 8px;
  font-weight: 800;
  color: #1f2937;
}

.guide-flow-list,
.guide-plain-list {
  margin: 0;
  padding-left: 24px;
  text-align: left;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.75;
  color: #000000;
}

.guide-flow-list {
  width: min(100%, 820px);
}

.guide-flow-list li,
.guide-plain-list li {
  margin-bottom: 10px;
}

.guide-flow-list strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.guide-flow-list span {
  display: block;
}

.guide-small-note {
  font-size: 14px;
  color: #374151;
}

.guide-inline-link {
  color: #0b55d9;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.guide-inline-link:hover {
  color: #063a9b;
}

.guide-step {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px 18px;
  align-items: start;
}

.guide-step-number {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 3px 0 rgba(17, 24, 39, 0.2);
  font-size: 23px;
  font-weight: 850;
}

.guide-step-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.28;
}

.guide-shot {
  grid-column: 1 / -1;
  width: min(100%, 820px);
  height: auto;
  display: block;
  justify-self: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 0 rgba(17, 24, 39, 0.16);
  background: #ffffff;
}

.guide-note {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff8d7;
  border: 2px solid #d9a400;
  border-radius: 12px;
  box-shadow: none;
  padding: 14px 16px;
  color: #3f3300;
}

.guide-note-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #9a7600;
  border-radius: 50%;
  background: #ffffff;
  color: #6f5400;
  font-weight: 900;
}

.guide-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 850;
}

.guide-note p {
  margin: 0;
  font-size: 16px;
  font-weight: 550;
  line-height: 1.7;
  color: #3f3300;
}

.guide-main > section:not(:first-child) {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #d7e2ff;
}

.guide-image-modal[hidden] {
  display: none;
}

.guide-image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
}

.guide-image-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  box-shadow: none;
  cursor: zoom-out;
}

.guide-image-modal-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1280px);
  max-height: 92vh;
  padding: 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  overflow: auto;
}

.guide-image-modal-panel img {
  width: 100%;
  height: auto;
  display: block;
}

.guide-image-modal-close {
  position: sticky;
  top: 0;
  left: 100%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px auto;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .guide-main {
    padding: 24px 18px 32px;
  }
  .guide-main > section + section {
    margin-top: 24px;
    padding-top: 24px;
  }
  .spotlight-grid,
  .public-share-columns,
  .guide-role-grid,
  .guide-flow-card {
    grid-template-columns: 1fr;
  }
  .spotlight-modal {
    padding: 18px;
  }
  .guide-step {
    grid-template-columns: 1fr;
  }
  .code-delivery-grid {
    grid-template-columns: 1fr;
  }
}

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