body {
  font-family: sans-serif;
  max-width: 600px;
  margin: 40px auto;
  padding: 0 20px;
}
#landingStartHint {
  font-size: 0.95em;
  color: #444;
  margin: 4px 0 16px;
}

#landingTopBar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#landingTopBar h1 {
  margin: 0;
}
#landingTopLinks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#teacherAccessLink {
  font-size: 0.85em;
  color: #333;
  text-decoration: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}
#teacherAccessLink:hover, #teacherAccessLink:focus-visible {
  background: #f5f5f5;
}

#teacherAccessLink[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
#teacherAccessLink[aria-disabled="true"]:hover {
  background: none;
}

.startPoint {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.35);
  animation: startPointGlow 2.6s ease-in-out infinite;
}
@keyframes startPointGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
  .startPoint {
    animation: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.35);
  }
}
#wordRow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
#preview {
  
  display: none;
  max-width: 76px;
  max-height: 76px;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}
#result {
  font-size: 1.2em;
}
#result.error {
  color: #b00020;
}
#prototypeNotice {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 0.9em;
  color: #444;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
}
#retryBtn,
#confirmWordBtn {
  display: none;
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 0.95em;
  cursor: pointer;
}
#analysisStatus {
  margin-top: 16px;
  font-size: 0.95em;
  color: #555;
}
#analysisStatus.error {
  color: #b00020;
}
#finalWordWrapper {
  display: none;
}
#gate {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#gateBox {
  max-width: 380px;
  width: 100%;
  margin: auto 0;
  text-align: center;
}
#gateAbout {
  margin-top: 16px;
  padding: 10px 12px;
  text-align: left;
  line-height: 1.4;
  color: #444;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
}
#gateAbout h3 {
  margin: 0 0 4px;
  font-size: 1em;
}
#gateBox #gateAbout p {
  margin: 0;
  font-size: 0.9em;
  color: #333;
}
#gateBox #gateAbout p + p {
  margin-top: 8px;
}
#gateBox #gateLegal {
  margin: 14px 0 0;
  font-size: 0.72em;
  line-height: 1.4;
  color: #777;
}
#gateBox h2 {
  margin: 0 0 8px;
  font-size: 1.3em;
}
#gateBox p {
  color: #555;
  font-size: 0.95em;
  margin: 0 0 20px;
}
#gateInput {
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  text-align: center;
  border: 1px solid #bbb;
  border-radius: 6px;
  box-sizing: border-box;
}
#gateBtn {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  font-size: 1em;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #333;
  background: #333;
  color: #fff;
}
#gateBtn:disabled {
  opacity: 0.6;
  cursor: default;
}
#gateError {
  margin-top: 12px;
  color: #b00020;
  font-size: 0.9em;
  min-height: 1.2em;
}
#privacyNotice {
  margin-top: 12px;
  padding: 6px 2px;
  font-size: 0.75em;
  color: #888;
}
.syllableDivisionNotice {
  max-width: 560px;
  margin: 10px auto 0;
  text-align: center;
}
.syllableDivisionNotice summary {
  display: inline-block;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 0.85em;
  font-weight: 600;
  color: #0c4a6e;
  background: #e0f2fe;
  border: 1px solid #1AA6E0;
  border-radius: 6px;
  list-style: none;
}
.syllableDivisionNotice summary::-webkit-details-marker {
  display: none;
}
.syllableDivisionNoticeBody {
  margin-top: 8px;
  padding: 12px 16px;
  font-size: 0.95em;
  font-weight: 600;
  line-height: 1.5;
  color: #0c4a6e;
  background: #e0f2fe;
  border: 2px solid #1AA6E0;
  border-radius: 8px;
  text-align: center;
}


#highlightDemoHeading {
  display: inline-block;
}
.landingDemoBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  vertical-align: middle;
  border: 1px solid #1d4ed8;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.landingDemoBadge:hover {
  background: #1638a8;
  border-color: #1638a8;
  color: #fff;
}

.landingDemoHole {
  position: fixed;
  pointer-events: none;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 33, 56, 0.55);
  z-index: 9800;
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.landingDemoPop {
  position: fixed;
  z-index: 9801;
  max-width: 300px;
  background: #fff;
  border: 2px solid #1d4ed8;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  padding: 14px 34px 14px 16px;
}
.landingDemoPopTitle {
  font-weight: 700;
  font-size: 1.02em;
  margin-bottom: 6px;
  color: #1d4ed8;
}
.landingDemoPopBody {
  font-size: 0.95em;
  line-height: 1.5;
  color: #333;
  margin: 0;
}
.landingDemoPopClose {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 4px;
}
.landingDemoPopClose:hover {
  color: #1d4ed8;
}
#highlightDemo {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}
#highlightDemo h2 {
  font-size: 1.05em;
  margin: 0 0 6px;
}
#highlightDemo .hint {
  font-size: 0.85em;
  color: #666;
  margin: 0 0 12px;
}
#readingArea {
  min-height: 120px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.7;
  color: #222;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
#readingArea:focus {
  border-color: #999;
}

#readingArea:empty::before {
  content: attr(data-placeholder);
  color: #999;
}
#selectionBar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
#selectionLabel {
  font-size: 0.9em;
  color: #666;
}
#analyzeSelectionBtn {
  padding: 8px 16px;
  font-size: 0.95em;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #333;
  background: #333;
  color: #fff;
}
#analyzeSelectionBtn:disabled {
  opacity: 0.45;
  cursor: default;
}
.pron-attribution-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  padding: 16px 20px;
  background: #f6fbff;
  border: 1px solid #d3e6f3;
  border-radius: 16px;
  text-align: left;
}
.pron-attribution-card img {
  height: 64px;
  width: auto;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  flex-shrink: 0;
}
.pron-attribution-card p {
  margin: 0;
  max-width: 560px;
  font-size: 13px;
  line-height: 1.6;
  color: #444;
  text-align: center;
}
.site-footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
  font-size: 0.85em;
  color: #777;
}


#preSoundTask {
  margin: 16px 0;
}
#preSoundPrompt {
  margin: 0 0 8px;
  font-size: 1.05em;
  font-weight: 600;
}
#preSoundControls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#preSoundControls button {
  padding: 8px 16px;
  font-size: 0.95em;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #333;
  background: #333;
  color: #fff;
}
#preSoundSkipBtn {
  background: #fff;
  color: #333;
}
#preSoundInput {
  width: 5em;
  padding: 8px;
  font-size: 1em;
  border-radius: 6px;
  border: 1px solid #bbb;
}
#preSoundResult {
  margin: 16px 0;
  font-size: 0.95em;
  color: #444;
}


#investigateWordCallout {
  max-width: 560px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  font-size: 0.95em;
  line-height: 1.5;
  color: #0c4a6e;
  background: #e0f2fe;
  border: 1px solid #1AA6E0;
  border-left-width: 5px;
  border-radius: 8px;
  text-align: left;
  box-sizing: border-box;
}
#investigateWordLead {
  color: #0c4a6e;
  font-weight: 700;
}
@media (max-width: 480px) {
  #investigateWordCallout { padding: 10px 12px; font-size: 0.9em; }
}

#investigateWordCallout .dictPrimerLink {
  background: none; border: 0; padding: 0; margin-top: 6px; font: inherit;
  font-weight: 600; color: #0a7fb5; text-decoration: underline; cursor: pointer;
}
#investigateWordCallout .dictPrimerLink[hidden], .dictPrimerCard[hidden] { display: none; }
.dictPrimerCard { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e3ecf4; }
.dictPrimerTitle { color: #1c355e; font-weight: 700; margin-bottom: 8px; }
.dictPrimerEntry { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 10px; }
.dictPrimerVal { font-size: 1.15em; color: #1c355e; white-space: nowrap; }
.dictPrimerHw { font-weight: 700; }
.dictPrimerFl { font-style: italic; }
.dictPrimerLabel {
  white-space: nowrap; font-size: .68em; letter-spacing: .06em; color: #6b7f96; font-weight: 600;
  border-top: 2px solid #c9d8e6; padding-top: 2px;
}
.dictPrimerPoints { margin: 0; padding-left: 18px; }
.dictPrimerPoints li { margin-bottom: 6px; }
@media (max-width: 480px) {
  .dictPrimerEntry { gap: 8px 14px; }
  .dictPrimerVal { font-size: 1em; }
}


@keyframes wordMeaningPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes wordMeaningShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.wordMeaningPop { animation: wordMeaningPop 0.35s ease-out; }
.wordMeaningShake { animation: wordMeaningShake 0.3s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) {
  .wordMeaningPop, .wordMeaningShake { animation: none; }
}


#conversionPanel, #tutorConversionPanel {
  box-sizing: border-box;
  max-width: 600px;
  margin: 18px auto 0;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--atlas-line, #d3e6f3);
  border-left: 4px solid var(--atlas-cyan, #33ccff);
  border-radius: 12px;
  font-family: var(--atlas-font, "Poppins", system-ui, sans-serif);
  color: var(--atlas-navy, #1c355e);
  text-align: left;
}
#conversionPanel .conversionTitle, #tutorConversionPanel .conversionTitle {
  font-weight: 800; font-size: 1em; margin: 0 0 10px;
}
#conversionPanel .conversionSteps, #tutorConversionPanel .conversionSteps {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; align-items: center;
}
#conversionPanel .conversionLabel, #tutorConversionPanel .conversionLabel {
  margin: 0; font-size: 0.82em; font-weight: 600; color: var(--atlas-muted, #5a7088);
  text-transform: uppercase; letter-spacing: 0.04em;
}
#conversionPanel .conversionValue, #tutorConversionPanel .conversionValue {
  margin: 0; font-weight: 600; overflow-wrap: anywhere;
  font-family: "Noto Sans", "Segoe UI", system-ui, sans-serif; 
}
#conversionPanel .conversionUnits, #tutorConversionPanel .conversionUnits { display: flex; flex-wrap: wrap; gap: 6px; }
#conversionPanel .conversionUnit, #tutorConversionPanel .conversionUnit {
  padding: 2px 10px; border-radius: 999px; background: var(--atlas-soft, #f6fbff);
  border: 1px solid var(--atlas-line, #d3e6f3); font-weight: 700;
}
#conversionPanel .conversionNote, #tutorConversionPanel .conversionNote {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--atlas-line, #d3e6f3);
  font-size: 0.8em; color: var(--atlas-muted, #5a7088);
}
@media (max-width: 480px) {
  #conversionPanel .conversionSteps, #tutorConversionPanel .conversionSteps { grid-template-columns: 1fr; gap: 2px; }
  #conversionPanel .conversionLabel, #tutorConversionPanel .conversionLabel { margin-top: 6px; }
}


.tutorBackupBadge {
  display: inline-block; margin-right: 12px; padding: 3px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--atlas-line, #d3e6f3); border-left: 4px solid var(--atlas-cyan, #33ccff);
  font-family: var(--atlas-font, "Poppins", system-ui, sans-serif); font-size: 0.8em; font-weight: 700;
  color: var(--atlas-navy, #1c355e); vertical-align: middle;
}
.ipaChip {
  display: block; width: max-content; margin: 4px auto 0; padding: 1px 8px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--tile-color, var(--atlas-cyan, #33ccff));
  color: var(--tile-color, var(--atlas-navy, #1c355e));
  font-family: "Noto Sans", "Segoe UI", system-ui, sans-serif; font-size: 0.72em; font-weight: 600; line-height: 1.5;
  letter-spacing: 0.02em; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  td.just-filled .ipaChip { animation: ipaChipPop 0.45s cubic-bezier(.2, 1.6, .4, 1) both; }
}
@keyframes ipaChipPop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}


.tutorWordBoard {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  margin: 8px 0 16px; padding: 14px 22px;
  background: #fff; border: 2px solid #cfd6dd; border-radius: 10px;
  font-size: 44px; font-weight: 700; letter-spacing: 1px; line-height: 1.2;
}
.tutorWordBoardLetters { padding: 0 3px; border-radius: 6px; }
.tutorWordBoardLit { background: #ffe58a; box-shadow: 0 0 0 2px #e0b800 inset; }
.tutorPronunciationNote {
  margin: 4px 0 8px; padding: 10px 14px; max-width: 640px;
  background: #eef5fb; border-left: 4px solid #5a8fc2; border-radius: 6px;
  font-size: 16px;
}
