:root {
  --ink: #18372f;
  --muted: #61736e;
  --green: #126851;
  --soft: #eaf5ef;
  --line: #dce7e1;
  --paper: #fff;
  --bg: #f5f8f5;
  --gold: #f3bc50;
  --red: #b23d36;
  --blue: #356fa7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  transition:
    background 0.15s,
    transform 0.15s;
}
a {
  color: var(--green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #e6ab31;
  outline-offset: 3px;
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -1px;
  line-height: 1.2;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
p {
  margin-bottom: 12px;
}
small,
.muted {
  color: var(--muted);
}
.skip {
  position: fixed;
  top: -100px;
  background: white;
  padding: 14px;
  z-index: 100;
}
.skip:focus {
  top: 0;
}
.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 20px;
}
.boot img {
  width: 160px;
  margin: auto;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 242px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}
.brand {
  display: block;
  padding: 0 10px 28px;
}
.brand img {
  width: 142px;
  height: 56px;
  object-fit: contain;
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2px;
}
.nav {
  display: grid;
  gap: 5px;
  flex-shrink: 0;
}
.nav a {
  padding: 12px 15px;
  color: var(--muted);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 650;
  font-size: 14px;
}
.nav a:hover {
  background: var(--bg);
  text-decoration: none;
}
.nav a.active {
  background: var(--soft);
  color: var(--green);
}
.nav .glyph {
  font-size: 20px;
  width: 25px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.workspace {
  margin-left: 242px;
}
.topbar {
  height: 87px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: #fff;
  gap: 20px;
}
.topbar p {
  margin: 0;
  font-size: 13px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}
.page {
  padding: 32px 40px 70px;
  max-width: 1450px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}
.page-head h1 {
  margin-bottom: 8px;
}
.eyebrow {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}
.hero {
  background: var(--green);
  color: white;
  border-radius: 24px;
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  margin-bottom: 27px;
}
.hero h1 {
  max-width: 660px;
}
.hero p {
  color: #d5eae1;
  max-width: 650px;
}
.hero .eyebrow {
  color: #e7c984;
}
.hero:after {
  content: "✦";
  position: absolute;
  right: 24px;
  bottom: -68px;
  font-size: 225px;
  color: #ffffff0b;
  pointer-events: none;
}
.hero .btn {
  background: #f5c865;
  color: #25402d;
  border-color: #f5c865;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  min-height: 44px;
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.btn:hover {
  background: #0b5742;
  text-decoration: none;
}
.btn.secondary {
  background: white;
  color: var(--green);
  border-color: var(--line);
}
.btn.secondary:hover {
  background: var(--soft);
}
.btn.danger {
  color: var(--red);
  background: #fff3f2;
  border-color: #efd4d1;
}
.btn.small {
  font-size: 12px;
  padding: 7px 11px;
  min-height: 34px;
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 6px;
  font-weight: 650;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
}
.stack {
  display: grid;
  gap: 18px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 23px;
  min-width: 0;
}
.card-link {
  display: block;
  color: inherit;
}
.card-link:hover {
  text-decoration: none;
  border-color: #95b8a7;
  box-shadow: 0 6px 24px #234c3510;
}
.card .icon {
  width: 52px;
  height: 52px;
  background: var(--soft);
  color: var(--green);
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  margin-bottom: 20px;
}
.course .icon {
  background: #edf0fb;
}
.course:nth-child(3n + 2) .icon {
  background: #fff0dc;
}
.course:nth-child(3n + 3) .icon {
  background: #f3ebf7;
}
.card-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 16px;
}
.section-title h2 {
  margin: 0;
}
.tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  margin: 0 5px 7px 0;
}
.tag.orange {
  background: #fff2d9;
  color: #875c11;
}
.tag.red {
  background: #fff0ed;
  color: var(--red);
}
.row {
  display: flex;
  align-items: center;
  gap: 13px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e6eee8;
  color: var(--green);
  font-weight: 800;
  overflow: hidden;
}
.avatar.large {
  width: 90px;
  height: 90px;
  font-size: 28px;
  border: 4px solid white;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stat strong {
  font-size: 31px;
  display: block;
  line-height: 1.3;
}
.stat small {
  font-size: 12px;
}
.empty {
  text-align: center;
  padding: 48px 20px;
  background: white;
  border: 1px dashed #bdcec4;
  border-radius: 18px;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
}
.empty .symbol {
  font-size: 35px;
  margin-bottom: 12px;
}
.notice {
  padding: 14px 17px;
  border-radius: 12px;
  background: #edf3fa;
  color: #3d5e7b;
  font-size: 13px;
  margin: 12px 0;
}
.notice.error {
  background: #fff0ed;
  color: #aa3e36;
}
.notice.success {
  background: var(--soft);
  color: var(--green);
}
.fields {
  display: grid;
  gap: 16px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfdcd5;
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  min-height: 46px;
}
textarea {
  resize: vertical;
  min-height: 108px;
}
input[type="file"] {
  font-size: 13px;
  padding: 9px;
}
input[type="radio"],
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  accent-color: var(--green);
}
.field-hint {
  font-size: 12px;
  margin: 5px 0 0;
  color: var(--muted);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.password {
  display: flex;
  position: relative;
}
.password input {
  padding-right: 65px;
}
.password button {
  position: absolute;
  right: 8px;
  top: 7px;
  border: 0;
  background: #f0f5f1;
  padding: 6px;
  color: var(--green);
  border-radius: 6px;
}
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-story {
  background: var(--green);
  padding: 8vw 7vw;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-story img {
  width: 90px;
  background: white;
  border-radius: 20px;
  padding: 10px;
  margin-bottom: 38px;
}
.auth-story h1 {
  font-size: clamp(38px, 4vw, 60px);
  line-height: 1.12;
}
.auth-story p {
  color: #d7eee2;
  max-width: 390px;
}
.auth-story .rings {
  font-size: 140px;
  line-height: 1;
  color: #70b596;
  margin-top: 30px;
  letter-spacing: 12px;
}
.auth-form {
  padding: 60px;
  display: grid;
  place-items: center;
}
.auth-inner {
  width: 100%;
  max-width: 430px;
}
.auth-inner h2 {
  font-size: 30px;
  margin-bottom: 7px;
}
.auth-inner .btn {
  width: 100%;
  margin-top: 4px;
}
.auth-recovery-link {
  display: table;
  min-height: 44px;
  padding: 12px 0;
  font-weight: 700;
}
.recovery-help {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  background: #eaf3ef;
  font-size: 14px;
}
.recovery-help p {
  margin: 8px 0 12px;
}
.account-security {
  max-width: 640px;
}
.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
}
.auth-logo {
  width: 135px;
  margin-bottom: 30px;
}
.auth-home {
  display: table;
  margin-bottom: 24px;
  padding: 10px 0;
  min-height: 44px;
  font-size: 14px;
  font-weight: 650;
}
.auth-tabs {
  display: flex;
  background: #e9f0eb;
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 25px;
}
.auth-tabs a {
  width: 50%;
  border: 0;
  background: none;
  padding: 10px;
  border-radius: 9px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}
.auth-tabs a.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 6px #18372f0d;
}
.list {
  display: grid;
  gap: 12px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
}
.list-item:hover {
  text-decoration: none;
  background: #fcfdfb;
}
.list-item h3 {
  margin: 0 0 4px;
}
.list-item p {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
}
.step {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}
.progress {
  width: 100%;
  height: 8px;
  appearance: none;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #e8eee9;
  display: block;
  margin: 14px 0;
}
.progress::-webkit-progress-bar {
  background: #e8eee9;
}
.progress::-webkit-progress-value {
  background: #42a57a;
}
.progress::-moz-progress-bar {
  background: #42a57a;
}
.skill {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.skill p {
  margin: 5px 0 0;
}
.video {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: 16px;
  background: #162b23;
  display: block;
}
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 25px;
}
.lesson-content {
  font-size: 16px;
  line-height: 1.85;
  white-space: pre-line;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 10px;
  margin-top: 10px;
  cursor: pointer;
  font-weight: 500;
}
.quiz-option:has(input:checked) {
  background: var(--soft);
  border-color: #74a58d;
}
.result-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--green);
}
.post {
  max-width: 800px;
  width: 100%;
  margin: 0 auto 20px;
}
.post .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 19px 0;
  font-size: 15px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.media-grid:has(:only-child) {
  grid-template-columns: 1fr;
}
.media-grid img,
.media-grid video {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  background: #f0f3ef;
  border-radius: 12px;
}
.media-error {
  font-size: 12px;
  color: var(--muted);
  padding: 15px;
}
.reaction {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 6px 9px;
  min-height: 34px;
  font-size: 13px;
}
.reaction.active {
  background: var(--soft);
  border-color: #92bca6;
}
.comments {
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 15px;
}
.comment {
  padding: 11px 0;
  font-size: 14px;
  display: flex;
  gap: 10px;
}
.comment p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}
.composer textarea {
  border: 0;
  background: var(--bg);
}
.file-preview {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  word-break: break-word;
}
.profile-cover {
  height: 190px;
  background: #cce0d0;
  border-radius: 21px 21px 0 0;
  overflow: hidden;
}
.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-head {
  margin-top: -44px;
  position: relative;
  padding: 0 28px 25px;
}
.profile-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  margin-bottom: 25px;
}
.profile-head h1 {
  margin: 10px 0 3px;
}
.profile-head .row {
  align-items: flex-end;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  font-size: 14px;
}
.info-grid strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-layout {
  display: grid;
  grid-template-columns: 295px minmax(0, 1fr);
  height: calc(100vh - 190px);
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.room-list {
  overflow: auto;
  border-right: 1px solid var(--line);
  padding: 10px;
}
.room-link {
  display: block;
  padding: 14px;
  border-radius: 11px;
  color: inherit;
  margin-bottom: 3px;
}
.room-link:hover,
.room-link.active {
  background: var(--soft);
  text-decoration: none;
}
.room-link p {
  font-size: 12px;
  margin: 6px 0 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.chat-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.chat-header h3 {
  margin: 0;
}
.messages {
  overflow: auto;
  flex: 1;
  padding: 22px;
  background: #f7faf7;
}
.message {
  max-width: 83%;
  margin: 0 0 16px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.message.mine {
  margin-left: auto;
  flex-direction: row-reverse;
}
.bubble {
  background: white;
  border: 1px solid var(--line);
  border-radius: 0 13px 13px;
  padding: 10px 14px;
  min-width: 85px;
  overflow-wrap: anywhere;
}
.mine .bubble {
  background: #e1f1e5;
  border-color: #d0e7d5;
  border-radius: 13px 0 13px 13px;
}
.bubble .body {
  white-space: pre-wrap;
  margin: 4px 0;
  font-size: 14px;
}
.bubble small {
  font-size: 10px;
}
.bubble .media-grid {
  max-width: 350px;
}
.chat-compose {
  padding: 14px;
  border-top: 1px solid var(--line);
}
.chat-compose textarea {
  min-height: 55px;
  max-height: 130px;
}
.chat-compose input[type="file"] {
  max-width: 220px;
  font-size: 11px;
}
.chat-compose .row {
  margin-top: 8px;
}
.feed-layout {
  max-width: 850px;
  margin: auto;
}
.unread {
  border-left: 4px solid var(--green);
  background: #f7fff8;
}
dialog {
  border: 0;
  border-radius: 20px;
  padding: 28px;
  width: min(620px, calc(100% - 28px));
  max-height: 90vh;
  color: var(--ink);
  box-shadow: 0 25px 80px #17382c44;
}
dialog::backdrop {
  background: #142a2366;
}
dialog .close {
  margin-left: auto;
}
.dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #18372f;
  color: #fff;
  padding: 13px 22px;
  border-radius: 13px;
  box-shadow: 0 4px 20px #0002;
  z-index: 100;
  max-width: 90%;
  display: none;
}
#toast.show {
  display: block;
}
.loading {
  min-height: 250px;
  display: grid;
  place-content: center;
  color: var(--muted);
  text-align: center;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e1eae3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 15px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}
.data-table th,
.data-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
}
.table-wrap {
  overflow: auto;
}
.money {
  font-weight: 800;
  font-size: 27px;
  color: var(--green);
}
.searchbar {
  display: flex;
  gap: 10px;
  max-width: 550px;
  margin-bottom: 24px;
}
.searchbar input {
  flex: 1;
  min-width: 0;
}
.searchbar select {
  flex: 0 0 170px;
  width: 170px;
}
.mobile-menu {
  display: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.feature-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0 24px;
}
.line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
}
.privacy-line {
  display: grid;
  grid-template-columns: 1fr 160px;
  align-items: center;
  gap: 10px;
}
.more-wrap {
  text-align: center;
  margin: 20px 0;
}
.flex-end {
  justify-content: flex-end;
}
.space-top {
  margin-top: 20px;
}
.nowrap {
  white-space: nowrap;
}
.attendance-photo {
  max-width: 220px;
}
.calendar-date {
  background: var(--soft);
  color: var(--green);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  font-weight: 700;
}
.calendar-date strong {
  display: block;
  font-size: 25px;
}
.teacher-photo {
  width: 86px;
  height: 86px;
}
.leader-rank {
  font-size: 23px;
  font-weight: 800;
  width: 40px;
  text-align: center;
  color: #c49332;
}
@media (min-width: 1600px) {
  .page {
    padding-top: 42px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 210px;
    padding: 25px 13px;
  }
  .workspace {
    margin-left: 210px;
  }
  .page {
    padding: 28px 25px 60px;
  }
  .topbar {
    padding: 0 25px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .grid.four {
    grid-template-columns: repeat(2, 1fr);
  }
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .lesson-aside {
    order: -1;
  }
  .chat-layout {
    grid-template-columns: 240px 1fr;
  }
  .auth-form {
    padding: 35px;
  }
}
@media (max-width: 850px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    width: 185px;
  }
  .workspace {
    margin-left: 185px;
  }
  .sidebar .nav a {
    padding: 11px 9px;
    font-size: 13px;
  }
  .brand {
    padding-left: 4px;
  }
  .brand img {
    width: 125px;
  }
  .auth-story {
    padding: 45px 30px;
  }
  .auth-form {
    padding: 35px 25px;
  }
  .auth-story h1 {
    font-size: 40px;
  }
  .chat-layout {
    grid-template-columns: 190px 1fr;
  }
  .page-head {
    align-items: flex-start;
  }
}
@media (max-width: 650px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 235px;
    box-shadow: 5px 0 25px #18372f26;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .workspace {
    margin-left: 0;
  }
  .mobile-menu {
    display: block;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 20px;
    color: var(--green);
  }
  .topbar {
    height: 72px;
    padding: 0 18px;
  }
  .topbar .welcome {
    display: none;
  }
  .topbar-actions {
    gap: 12px;
  }
  .topbar-actions .user-name {
    display: none;
  }
  .page {
    padding: 24px 17px 50px;
  }
  .hero {
    padding: 27px 23px;
    border-radius: 19px;
  }
  .hero h1 {
    font-size: 30px;
  }
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }
  .grid.four {
    gap: 10px;
  }
  .card {
    padding: 20px;
  }
  .grid.programs {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .programs .card {
    padding: 17px;
  }
  .programs .card h3 {
    font-size: 15px;
  }
  .programs .card .icon {
    margin-bottom: 12px;
  }
  .programs .card-foot {
    font-size: 11px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-story {
    display: none;
  }
  .auth-form {
    min-height: 100vh;
    padding: 30px 24px;
  }
  .page-head {
    display: block;
  }
  .page-head .btn {
    margin-top: 10px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .chat-layout {
    height: calc(100dvh - 150px);
    min-height: 450px;
    display: block;
  }
  .room-list {
    height: 100%;
    border: 0;
  }
  .chat-panel {
    height: 100%;
  }
  .chat-layout.has-room .room-list {
    display: none;
  }
  .chat-layout:not(.has-room) .chat-panel {
    display: none;
  }
  .message {
    max-width: 95%;
  }
  .messages {
    padding: 15px;
  }
  .chat-compose input[type="file"] {
    max-width: 160px;
  }
  .profile-head {
    padding: 0 19px 20px;
  }
  .profile-cover {
    height: 140px;
  }
  .profile-head .row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .media-grid {
    gap: 5px;
  }
  .privacy-line {
    grid-template-columns: 1fr 130px;
  }
  .section-title h2 {
    font-size: 20px;
  }
  .btn {
    padding: 10px 14px;
  }
  .topbar .muted {
    font-size: 12px;
  }
  .chat-back {
    display: inline-flex;
  }
  .card .table-wrap {
    margin-left: -10px;
    margin-right: -10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}
/* Browser equivalents of native conversations, attachment picker and settings. */
.filter-tabs { display:flex; flex-wrap:wrap; gap:9px; margin:0 0 20px; }
.media-open { display:block; width:100%; min-width:0; margin:0; padding:0; border:0; background:transparent; cursor:zoom-in; border-radius:12px; overflow:hidden; }
.media-open img { display:block; width:100%; max-height:420px; object-fit:cover; }
.media-open:focus-visible { outline:3px solid var(--green); outline-offset:3px; }
.upload-preview { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.upload-preview:empty { display:none; }
.upload-item { width:150px; min-width:0; padding:8px; border:1px solid var(--line); border-radius:12px; background:var(--bg); }
.upload-item img,.upload-item video { width:100%; height:105px; object-fit:contain; border-radius:8px; background:#e5ece8; }
.upload-item small { display:block; overflow-wrap:anywhere; font-size:11px; margin:5px 0; }
#media-dialog { width:min(1100px,96vw); max-width:96vw; padding:16px; }
#media-dialog .dialog-head { gap:10px; }
#media-dialog h2 { font-size:18px; }
.lightbox-stage { overflow:auto; max-height:75dvh; background:#10231e; border-radius:12px; }
.lightbox-stage img { display:block; max-width:100%; max-height:75dvh; margin:auto; object-fit:contain; }
.lightbox-stage.zoomed img { max-width:none; max-height:none; width:auto; min-width:100%; }
.chat-status-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 16px; border-bottom:1px solid var(--line); font-size:12px; }
.chat-status-row .error { color:var(--red); }
.chat-layout { height:calc(100dvh - 285px); min-height:580px; }
.chat-compose { flex-shrink:0; max-height:46dvh; overflow:auto; }
.chat-compose textarea { width:100%; }
.chat-compose .upload-item { width:120px; }
.chat-compose .upload-item img,.chat-compose .upload-item video { height:75px; }
.message-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.message-footer .text-btn { min-width:36px; min-height:32px; padding:4px; }
.messages { overscroll-behavior:contain; overflow-anchor:none; }
.bubble { max-width:100%; }
.new-message-hint { align-self:center; margin:6px; padding:7px 16px; border-radius:30px; background:var(--green); color:#fff; border:0; cursor:pointer; }
.new-message-hint[hidden] { display:none; }
.class-chat { height:calc(100dvh - 210px); min-height:500px; border:1px solid var(--line); border-radius:16px; background:#fff; overflow:hidden; }
.family-messages { max-height:42dvh; overflow:auto; overscroll-behavior:contain; padding:4px; }
form[data-busy] { cursor:progress; }
@media(max-width:680px) {
  .searchbar { flex-wrap:wrap; }
  .searchbar input { flex:1 1 100%; }
  .searchbar select { flex:1 1 170px; min-width:0; width:auto; }
  .chat-layout { height:calc(100dvh - 250px); min-height:480px; }
  .filter-tabs .btn { font-size:13px; padding:9px 12px; }
  .chat-compose .row { flex-wrap:wrap; }
  .chat-compose input[type=file] { max-width:100%; width:100%; }
  .chat-compose .upload-preview { width:100%; }
  .chat-status-row { font-size:11px; padding:7px 12px; }
  .class-chat { height:calc(100dvh - 190px); min-height:450px; }
  #media-dialog { padding:10px; }
  #media-dialog .dialog-head { flex-wrap:wrap; }
}
/* Preserve the HTML hidden contract even when component classes set display. */
[hidden] { display:none !important; }

/* Japanese learning: warm paper, navy type and teal interaction states. */
.kana-page,
.japanese-program {
  --ink: #17354b;
  --muted: #54656d;
  --green: #137c73;
  --soft: #edf6f2;
  --line: #dce5e1;
  color: var(--ink);
}
.page:has(.kana-page),
.page:has(.japanese-program) { background: #f8f7f3; }
.kana-page button:disabled { cursor: not-allowed; opacity: .48; }
.kana-page .btn { border-radius: 12px; min-height: 46px; }
.kana-page .btn:not(.secondary):hover { background: #0d665f; }
.kana-page .text-btn { min-height: 44px; }
.kana-page .card { border-radius: 22px; box-shadow: 0 4px 18px #17354b03; }
.kana-page .form-error:empty { display: none; }
.kana-page .eyebrow { letter-spacing: 1.7px; font-size: 10px; }
.kana-page h1,
.kana-page h2,
.kana-page h3 { color: var(--ink); }
.kana-page h2 { font-size: 23px; line-height: 1.3; }
.kana-page h3 { font-size: 16px; }
.kana-breadcrumb { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 20px; font-size: 13px; }
.kana-breadcrumb a { font-weight: 700; color: var(--ink); }
.kana-breadcrumb > span { color: var(--muted); }
.kana-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px 30px; background: #17354b; border-radius: 24px; overflow: hidden; }
.kana-hero h1 { color: #fff; font-size: clamp(28px, 3vw, 36px); margin-bottom: 9px; letter-spacing: -.8px; }
.kana-hero .eyebrow { color: #c5d7c9; }
.kana-hero p { color: #c7d5dc; margin: 0; font-size: 14px; }
.kana-stats { display: flex; flex-shrink: 0; margin: 0; padding: 0; }
.kana-stats > div { display: flex; flex-direction: column-reverse; gap: 3px; padding: 0 22px; border-left: 1px solid #ffffff26; }
.kana-stats > div:last-child { padding-right: 0; }
.kana-stats dt { color: #c7d5dc; font-size: 11px; white-space: nowrap; }
.kana-stats dd { color: #fff; font-size: 28px; line-height: 1.25; margin: 0; font-weight: 750; letter-spacing: -.5px; }
.kana-stats dd small { color: #aebfc8; font-size: 15px; font-weight: 400; }
.kana-observer { margin-top: 16px; }
.kana-tabs { display: flex; gap: 8px; padding: 5px; margin: 22px 0; background: #eaece7; border-radius: 15px; }
.kana-tabs > button { flex: 1; border: 0; border-radius: 11px; min-height: 46px; padding: 10px 16px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; }
.kana-tabs > button[aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 2px 5px #17354b0c; }
.kana-tabs > button:hover { color: var(--ink); background: #ffffff80; }
.kana-scripts { display: flex; gap: 12px; }
.kana-script { display: flex; align-items: center; flex: 1; min-width: 0; gap: 14px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; color: var(--ink); text-align: left; }
.kana-script > strong { display: grid; place-items: center; font-size: 35px; line-height: 1.2; font-weight: 500; width: 42px; }
.kana-script > span:not(.kana-selection) { font-size: 15px; font-weight: 750; }
.kana-script small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 1px; }
.kana-script.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.kana-selection { margin-left: auto; width: 18px; height: 18px; border: 1px solid #cad8d1; border-radius: 50%; text-align: center; line-height: 16px; font-size: 12px; }
.kana-script.selected .kana-selection { background: #137c73; border-color: #137c73; color: #fff; }
.kana-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.kana-section-heading h2,
.kana-section-heading h3 { margin-bottom: 5px; }
.kana-section-heading p { font-size: 13px; margin: 0; }
.kana-section-heading > .text-btn,
.kana-section-heading > .btn { flex-shrink: 0; font-size: 12px; }
.kana-chart-card { margin-top: 18px; }
.kana-categories { display: inline-flex; gap: 5px; padding: 4px; border-radius: 12px; background: #f3f4f0; }
.kana-categories .btn { border: none; min-height: 44px; font-size: 12px; padding: 7px 17px; border-radius: 9px; background: transparent; color: var(--muted); }
.kana-categories .btn[aria-pressed="true"] { background: #fff; color: #137c73; box-shadow: 0 1px 4px #17354b0c; }
/* More than four categories (the trainer adds the class): one row that scrolls sideways instead of squeezing the buttons. */
.kana-categories.scroll { display: flex; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.kana-categories.scroll .btn { flex: 0 0 auto; padding: 7px 14px; white-space: nowrap; }
.kana-groups { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; padding: 16px 8px 20px; margin-inline: -8px; scroll-padding-inline: 8px; scrollbar-width: thin; }
.kana-groups .btn { flex-shrink: 0; min-height: 44px; padding: 7px 14px; font-size: 12px; border-radius: 10px; }
.kana-groups .btn[aria-pressed="true"] { background: #17354b; border-color: #17354b; color: #fff; }
.kana-groups .btn.secondary { background: #fff; color: #54656d; border-color: #e1e7e2; }
.kana-tip { padding: 12px 15px; color: #5e7268; font-size: 13px; background: #f4f6ed; border-radius: 12px; }
.kana-tip [lang] { white-space: nowrap; }
.kana-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.kana-chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.kana-chart-heading h3 { margin: 0; }
.kana-chart-heading h3 span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 6px; white-space: nowrap; }
.kana-chart-heading .text-btn { font-size: 11px; }
.kana-row-label { margin: 18px 0 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.kana-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.kana-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 116px; padding: 12px 4px; border: 1px solid #e0e6e1; background: #fdfdfb; border-radius: 14px; color: var(--ink); }
.kana-tile strong { font-size: clamp(28px, 3vw, 39px); font-weight: 500; line-height: 1.4; white-space: nowrap; }
.kana-tile span { font-size: 14px; }
.kana-tile small { font-size: max(10px, .65rem); color: #5b6b66; margin-top: 5px; }
.kana-tile.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.kana-tile.mastered small { color: #137c73; }
.kana-tile:hover { border-color: #137c73; background: #f1f7f3; }
.kana-chart-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 0 0; margin-top: 20px; border-top: 1px solid var(--line); }
.kana-chart-action strong { font-size: 13px; }
.kana-chart-action p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.kana-chart-action .btn { font-size: 12px; }
.kana-detail { padding: 24px; background: #f5f5ee; border: 1px solid #e7e7dd; border-radius: 18px; text-align: center; scroll-margin-top: 20px; }
.kana-detail h2 { font-size: 25px; }
.kana-detail h2 span { font-size: 19px; color: var(--muted); font-weight: 400; }
.kana-detail p { font-size: 13px; color: #54656d; }
.kana-detail .kana-detail-note { margin-top: 17px; margin-bottom: 6px; }
.kana-detail .field-hint { font-size: 11px; }
.kana-detail audio { width: 100%; max-width: 100%; height: 40px; margin: 0 0 8px; }
.kana-stroke { display: block; width: 174px; height: 174px; max-width: 100%; margin: 8px auto 16px; border: 1px solid #e0e3d9; border-radius: 10px; background: #fdfdf8; }
.kana-detail > .btn { font-size: 12px; width: 100%; }
.kana-neighbours { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 17px; font-size: 11px; color: var(--muted); }
.kana-neighbours .btn { font-size: 11px; padding: 7px 10px; min-height: 44px; }
.kana-empty-glyph { display: grid; place-items: center; width: 110px; height: 110px; margin: 10px auto 24px; border-radius: 22px; border: 1px solid #e2e3d8; color: #b0bbae; font-size: 70px; font-weight: 300; transform: rotate(-5deg); background: #fafaf4; }
.kana-detail:has(.kana-empty-glyph) h2 { font-size: 18px; }
.kana-detail-hint { color: #5b6b66; display: block; font-size: 10px; letter-spacing: 1px; margin-top: 24px; }
.kana-practice .kana-section-heading { margin-bottom: 18px; }
.kana-practice-scope { display: flex; gap: 18px; margin-bottom: 14px; align-items: stretch; }
.kana-practice-scope .kana-scripts { flex: 1.7; min-width: 0; }
.kana-practice-scope .kana-script { padding: 10px 12px; gap: 8px; }
.kana-practice-scope .kana-script > strong { font-size: 28px; width: 30px; }
.kana-practice-scope .kana-script small { display: none; }
.kana-practice-group { flex: 1; min-width: 150px; }
.kana-practice-group label { margin: 0 0 5px; font-size: 10px; text-transform: uppercase; font-weight: 750; letter-spacing: .8px; color: var(--muted); }
.kana-practice-group select { margin: 0; padding: 9px 12px; min-height: 44px; border-color: var(--line); border-radius: 10px; color: var(--ink); font-size: 13px; background: #fff; }
.kana-stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.kana-stage-heading h3 { margin: 0; font-size: 14px; }
.kana-stage-heading h3 span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 8px; }
.kana-stage-heading .text-btn { font-size: 12px; }
.kana-stage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kana-stage { position: relative; display: flex; align-items: center; gap: 12px; padding: 17px 15px; margin: 0; border: 1px solid #e1e6e2; border-radius: 14px; cursor: pointer; background: #fff; }
.kana-stage.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.kana-stage input { width: 17px; height: 17px; margin: 0; accent-color: #137c73; flex-shrink: 0; order: 4; margin-left: auto; }
.kana-stage-number { display: grid; place-items: center; flex-shrink: 0; width: 31px; height: 34px; border-radius: 9px; color: #566761; background: #f2f4f1; font-size: 12px; font-weight: 750; }
.kana-stage.selected .kana-stage-number { color: #fff; background: #137c73; }
.kana-stage-copy { display: flex; flex-direction: column; gap: 4px; }
.kana-stage-copy strong { font-size: 13px; font-weight: 750; line-height: 1.35; }
.kana-stage-copy small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.35; }
.kana-stage-example { margin-left: auto; padding-left: 4px; color: #5b6b66; font-size: 14px; font-weight: 500; white-space: nowrap; }
.kana-start-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line); }
.kana-start-row strong { font-size: 13px; }
.kana-start-row p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.kana-start-row .btn { min-width: 200px; }
.kana-more-practice { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 23px 4px; }
.kana-more-practice h3 { font-size: 13px; margin-bottom: 3px; }
.kana-more-practice p { font-size: 11px; margin: 0; }
.kana-more-practice .feature-links { margin: 0; gap: 8px; }
.kana-more-practice .btn,
.kana-more-practice .text-btn { font-size: 11px; }
.kana-upcoming { border-top: 1px solid #dfe3dc; padding: 19px 4px 0; }
.kana-upcoming > div { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.kana-upcoming h3 { font-size: 13px; margin: 0; color: var(--muted); }
.kana-upcoming > div > span { padding: 2px 8px; border: 1px solid #dfe3dc; border-radius: 20px; font-size: 10px; color: var(--muted); }
.kana-upcoming ol { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 0; list-style: none; }
.kana-upcoming li { display: flex; align-items: center; gap: 7px; color: #5b6b66; font-size: 11px; }
.kana-upcoming li span { color: #5b6b66; border: 1px solid #dde2d9; border-radius: 50%; display: grid; place-items: center; height: 22px; width: 22px; font-size: 10px; }
.kana-guide { padding: 22px; background: #f7f8f3; border: 1px solid var(--line); border-radius: 16px; }
.kana-guide h3 { line-height: 1.6; margin: 0 0 18px; }
.kana-review-actions { margin-top: 24px; }
.kana-review-actions h3 { font-size: 14px; }
.kana-review-actions .feature-links { margin: 10px 0 0; }
.kana-progress-explainer { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.kana-progress-explainer summary { cursor: pointer; color: var(--ink); }
.kana-progress-explainer p { margin: 10px 0 0; }
.kana-count { border-radius: 20px; padding: 3px 9px; background: #f3f5ef; color: var(--muted); font-size: 11px; }
.kana-progress-skill { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.kana-progress-skill strong { font-size: 13px; }
.kana-progress-skill p { color: var(--muted); margin: 7px 0; font-size: 11px; }
.kana-progress-skill .btn { margin-top: 8px; font-size: 11px; }
.kana-progress-bar { display: block; appearance: none; height: 5px; width: 100%; border: 0; background: #e8eeea; color: #137c73; border-radius: 5px; overflow: hidden; margin: 12px 0; }
.kana-progress-bar::-webkit-progress-bar { background: #e8eeea; }
.kana-progress-bar::-webkit-progress-value { background: #137c73; border-radius: 5px; }
.kana-progress-bar::-moz-progress-bar { background: #137c73; border-radius: 5px; }
.kana-empty-state { text-align: center; padding: 38px 25px; grid-column: 1 / -1; }
.kana-empty-state > span { font-size: 36px; color: #93aaa0; display: block; margin-bottom: 12px; }
.kana-empty-state p { color: var(--muted); font-size: 13px; margin: 0; }
.kana-weak-list { padding: 24px 4px 0; font-size: 13px; }
.kana-loading { padding: 30px 4px; color: var(--muted); }
.kana-history-list { display: grid; gap: 12px; }
.kana-history-item { display: flex; align-items: center; gap: 20px; }
.kana-history-score { flex-shrink: 0; display: flex; align-items: baseline; justify-content: center; min-width: 68px; padding: 14px 8px; border-radius: 14px; background: #edf6f2; color: #137c73; font-size: 26px; font-weight: 750; }
.kana-history-score small { font-size: 12px; color: inherit; }
.kana-history-item h3 { font-size: 14px; }
.kana-history-item p { font-size: 12px; color: var(--muted); margin: 0; }
.kana-history-item .btn { margin-left: auto; flex-shrink: 0; font-size: 12px; }
.kana-history-answer p { font-size: 13px; }
.kana-history-answer.review { border-left: 3px solid #c6995a; }
.kana-pagination { display: flex; justify-content: center; align-items: center; gap: 22px; padding-top: 22px; font-size: 12px; color: var(--muted); }
.kana-pagination .btn { font-size: 12px; }
.kana-quiz { max-width: 790px; margin: 0 auto; padding: 27px 34px; scroll-margin-top: 20px; }
.kana-quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.kana-quiz-top .eyebrow { margin: 0; }
.kana-quiz-top .text-btn { font-size: 12px; color: var(--muted); }
.kana-session-stages { display: flex; gap: 7px; margin: 0 0 24px; padding: 0; list-style: none; }
.kana-session-stages > li { display: flex; flex: 1; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; background: #f3f5f1; font-size: 12px; font-weight: 750; color: #5b6b66; }
.kana-session-stages small { font-size: 11px; color: inherit; font-weight: 400; }
.kana-session-stages > .active { color: #fff; background: #17354b; }
.kana-session-stages > .done { color: #137c73; background: #edf6f2; }
.kana-quiz-progress { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .5px; }
.kana-quiz .kana-progress-bar { margin: 9px 0 25px; }
.kana-quiz > h2 { margin-bottom: 7px; text-align: center; }
.kana-quiz > p.muted { text-align: center; font-size: 13px; }
.kana-question { display: grid; place-items: center; font-size: 84px; line-height: 1.3; min-height: 166px; text-align: center; margin: 20px 0; padding: 17px; border: 1px solid #e8e9df; border-radius: 18px; background: #f7f7f0; font-weight: 500; }
.kana-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kana-option { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 13px 18px; border: 1px solid #dce5e1; border-radius: 13px; cursor: pointer; font-size: 24px; margin: 0; }
.kana-option:has(input:checked) { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.kana-option input { width: 19px; height: 19px; accent-color: #137c73; margin: 0; }
.kana-option > span { white-space: nowrap; }   /* a contracted sound such as びょ stays on one line */
.kana-option > small { margin-left: auto; font-size: 10px; border: 1px solid #e0e5e1; border-radius: 5px; padding: 1px 5px; font-weight: 400; }
.kana-typing { max-width: 420px; margin: 0 auto; font-size: 12px; color: var(--muted); }
.kana-typing input { min-height: 64px; text-align: center; font-size: 26px; color: var(--ink); border-color: var(--line); border-radius: 13px; margin-top: 7px; }
.kana-typing input::placeholder { font-size: 16px; color: #697873; }
.kana-listen { display: flex; flex-direction: column; align-items: center; background: #f7f7f0; padding: 25px; margin: 20px 0; border-radius: 18px; }
.kana-listen > span { color: #137c73; font-size: 34px; margin-bottom: 15px; }
.kana-listen audio { width: 100%; max-width: 350px; }
.kana-quiz-bottom { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
.kana-quiz-bottom > span { color: var(--muted); font-size: 11px; }
.kana-quiz-bottom .btn { min-width: 175px; }
.kana-match-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0 10px; text-align: center; color: var(--muted); letter-spacing: 1px; font-size: 10px; font-weight: 700; }
.kana-match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.kana-match-column { display: grid; gap: 10px; }
.kana-match-tile { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; }
.kana-match-tile strong { font-size: 24px; font-weight: 600; }
.kana-match-glyph strong { font-size: 30px; font-weight: 500; }
.kana-match-tile > small { margin-left: auto; font-size: 11px; color: var(--muted); }
.kana-pair-number { display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: #f1f4ef; color: #566761; font-size: 11px; font-weight: 700; }
.kana-match-tile.paired { background: #edf6f2; border-color: #c3dcd0; }
.kana-match-tile.paired .kana-pair-number { background: #d7eade; color: #137c73; }
.kana-match-tile.active { box-shadow: inset 0 0 0 1px #137c73; border-color: #137c73; background: #f1f8f5; }
.kana-match-tile:disabled { opacity: .7; }
.kana-match-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.kana-match-footer p { margin: 0; color: var(--muted); font-size: 11px; }
.kana-match-footer .text-btn { font-size: 11px; }
.kana-result { max-width: 790px; margin: 0 auto; text-align: center; padding: 36px; }
.kana-result-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 17px; border-radius: 50%; color: #137c73; background: #e7f3eb; font-size: 26px; }
.kana-result h1 { font-size: 28px; }
.kana-score { color: #137c73; font-size: 70px; font-weight: 750; letter-spacing: -3px; line-height: 1.25; margin-bottom: 10px; }
.kana-score > span { color: var(--muted); font-size: 23px; font-weight: 400; letter-spacing: -.5px; }
.kana-result > p { color: var(--muted); font-size: 14px; }
.kana-result-stages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 20px 0; font-size: 12px; }
.kana-result-stages p { margin: 0; }
.kana-feedback { margin: 22px 0; text-align: left; gap: 10px; }
.kana-feedback-item { display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 17px; }
.kana-feedback-item > span { color: #137c73; font-size: 12px; }
.kana-feedback-item.review > span { color: #7a5517; }
.kana-feedback-item strong { font-size: 20px; }
.kana-feedback-item small { font-size: 12px; }
.kana-footer { margin-top: 35px; padding-top: 20px; border-top: 1px solid #e2e5dc; color: #5f6f68; font-size: 12px; }
.kana-footer > p { margin-bottom: 7px; }
.kana-credits summary { cursor: pointer; width: fit-content; }
.kana-credits p { margin: 9px 0; max-width: 850px; }
/* Japanese program entry shares the kana color and spacing system. */
.japanese-program .page-head { margin-bottom: 22px; }
.japanese-program .page-head h1 { color: #17354b; }
.japanese-entry { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 30px; padding: 32px 36px; margin-bottom: 22px; border-radius: 25px; background: #17354b; color: #fff; }
.japanese-entry .eyebrow { color: #c5d7c9; font-size: 10px; }
.japanese-entry h2 { color: #fff; font-size: clamp(25px, 2.5vw, 32px); max-width: 530px; line-height: 1.3; letter-spacing: -.6px; }
.japanese-entry p { color: #c7d5dc; font-size: 14px; max-width: 530px; }
.japanese-entry .btn { background: #e5eedf; color: #17354b; border-color: #e5eedf; margin-top: 8px; }
.japanese-entry .btn:hover { background: #f3f6ef; }
.japanese-entry-glyphs { position: relative; height: 166px; }
.japanese-entry-glyphs span { position: absolute; display: grid; place-items: center; width: 120px; height: 134px; border-radius: 20px; font-size: 76px; line-height: 1; background: #f5f2e5; color: #17354b; transform: rotate(-9deg); left: 5px; top: 8px; box-shadow: 0 8px 15px #061b2226; }
.japanese-entry-glyphs span + span { left: 100px; top: 29px; background: #d8e9db; transform: rotate(9deg); }
.japanese-entry-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: #afc4cb; font-size: 10px; margin-top: 20px; }
.japanese-program > .feature-links { padding: 3px 0 6px; }
.japanese-program > .feature-links a { background: #fff; font-size: 12px; }
@media (max-width: 1150px) {
  .kana-hero { gap: 22px; padding: 25px; }
  .kana-stats > div { padding: 0 13px; }
  .kana-stats dd { font-size: 24px; }
  .kana-hero h1 { font-size: 28px; }
  .kana-stage-example { display: none; }
  .kana-layout { grid-template-columns: minmax(0, 1.2fr) minmax(235px, 1fr); gap: 18px; }
  .kana-grid { gap: 5px; }
  .kana-tile { min-height: 102px; }
  .kana-tile strong { font-size: 29px; }
  .kana-detail { padding: 19px; }
}
@media (max-width: 900px) {
  .kana-hero { flex-direction: column; align-items: stretch; gap: 22px; }
  .kana-stats > div { flex: 1; padding: 0 18px; }
  .kana-stats > div:first-child { padding-left: 0; border: 0; }
  .kana-layout { grid-template-columns: 1fr; }
  .kana-tile strong { font-size: 38px; }
  .kana-detail:has(.kana-empty-glyph) { display: none; }
  .kana-practice-scope { flex-wrap: wrap; }
  .kana-practice-scope .kana-scripts { flex-basis: 100%; }
  .kana-practice-group { display: flex; align-items: center; gap: 15px; }
  .kana-practice-group label { flex-shrink: 0; margin: 0; }
  .kana-practice-group select { flex: 1; }
  .kana-session-stages small { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .kana-session-stages > li { justify-content: center; position: relative; }
  .kana-quiz { padding: 24px; }
  .kana-match-tile { padding: 10px; gap: 8px; }
  .kana-match-tile > small { font-size: 11px; }
  .japanese-entry { grid-template-columns: minmax(0,1fr) 160px; padding: 28px; }
  .japanese-entry-glyphs { transform: scale(.8); transform-origin: left center; }
}
@media (max-width: 700px) {
  .kana-breadcrumb { margin-bottom: 16px; font-size: 11px; }
  .kana-hero { padding: 23px; border-radius: 20px; }
  .kana-hero h1 { font-size: 28px; }
  .kana-hero p { font-size: 12px; }
  .kana-stats dd { font-size: 25px; }
  .kana-stats dt { font-size: 10px; }
  .kana-stats > div { padding: 0 14px; }
  .kana-tabs { margin: 17px 0; gap: 2px; }
  .kana-tabs > button { font-size: 12px; padding: 10px 8px; }
  .kana-page .card { padding: 20px; border-radius: 18px; }
  .kana-scripts { gap: 10px; }
  .kana-script { padding: 13px; gap: 7px; border-radius: 14px; }
  .kana-script > strong { font-size: 30px; width: 33px; }
  .kana-script > span:not(.kana-selection) { font-size: 13px; }
  .kana-script small { font-size: 10px; }
  .kana-selection { width: 15px; height: 15px; line-height: 13px; font-size: 10px; }
  .kana-section-heading { gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
  .kana-section-heading > .text-btn { padding: 0; min-height: 44px; }
  .kana-section-heading p { font-size: 12px; }
  .kana-page h2 { font-size: 21px; }
  .kana-categories { display: flex; }
  .kana-categories .btn { flex: 1; min-width: 0; padding: 7px 4px; font-size: 11px; line-height: 1.25; min-height: 44px; }
  .kana-groups { padding: 14px 20px 16px 8px; margin-right: -20px; }
  .kana-groups .btn { min-height: 44px; }
  .kana-chart-heading h3 { font-size: 14px; }
  .kana-chart-heading h3 span { font-size: 10px; margin-left: 3px; }
  .kana-grid { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
  .kana-tile { min-height: 95px; border-radius: 11px; padding: 9px 2px; }
  .kana-tile strong { font-size: 28px; }
  .kana-tile span { font-size: 12px; }
  .kana-tile small { font-size: 10px; }
  .kana-chart-card:has([data-kana-category="contracted"][aria-pressed="true"], [data-kana-category="foreign"][aria-pressed="true"]) .kana-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .kana-chart-card:has([data-kana-category="contracted"][aria-pressed="true"], [data-kana-category="foreign"][aria-pressed="true"]) .kana-tile strong { font-size: 32px; }
  .kana-chart-action { margin-top: 17px; }
  .kana-chart-action .btn { flex: 1; min-width: 140px; }
  .kana-detail { padding: 22px; }
  .kana-detail:has(.kana-empty-glyph) { display: none; }
  .kana-detail h2 { font-size: 29px; }
  .kana-detail audio { max-width: 350px; }
  .kana-stage-heading { margin-top: 15px; }
  .kana-stage-heading h3 span { display: block; margin: 3px 0 0; }
  .kana-stage-grid { grid-template-columns: 1fr; gap: 8px; }
  .kana-stage { padding: 13px; }
  .kana-stage-copy strong { font-size: 13px; }
  .kana-stage-copy small { font-size: 11px; }
  .kana-stage-example { display: block; font-size: 13px; }
  .kana-start-row { flex-wrap: wrap; gap: 14px; margin-top: 17px; padding-top: 17px; }
  .kana-start-row > .btn { width: 100%; min-height: 49px; }
  .kana-more-practice { padding: 21px 1px; gap: 9px; }
  .kana-more-practice .feature-links { gap: 8px; width: 100%; }
  .kana-more-practice .btn { flex: 1; min-width: 145px; padding: 10px; }
  .kana-upcoming { padding-left: 1px; padding-right: 1px; }
  .kana-upcoming ol { gap: 10px 15px; }
  .kana-history-item { gap: 14px; flex-wrap: wrap; }
  .kana-history-item > div:nth-child(2) { flex: 1; min-width: 150px; }
  .kana-history-item .btn { width: 100%; }
  .kana-quiz .kana-quiz-progress { font-size: 11px; }
  .kana-quiz > p.muted { font-size: 12px; }
  .kana-question { min-height: 148px; font-size: 73px; margin: 17px 0; }
  .kana-option { min-height: 65px; padding: 12px 10px; gap: 8px; font-size: 24px; }
  .kana-choices { gap: 9px; }
  .kana-quiz-bottom { flex-direction: column; align-items: stretch; gap: 12px; }
  .kana-quiz-bottom > span { text-align: center; }
  .kana-quiz-bottom > .btn { min-height: 49px; }
  .kana-match-board,
  .kana-match-heading { gap: 12px; }
  .kana-match-tile { min-height: 82px; position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 1px 5px; padding: 10px; }
  .kana-match-tile strong { font-size: 23px; }
  .kana-match-glyph strong { font-size: 28px; }
  .kana-match-tile > small { grid-column: 2; margin-left: 0; font-size: 11px; }
  .kana-pair-number { width: 19px; height: 19px; }
  .kana-match-footer { flex-wrap: wrap; gap: 0; }
  .kana-match-footer p { font-size: 10px; }
  .kana-match-footer .text-btn { padding-left: 0; }
  .kana-result h1 { font-size: 24px; }
  .kana-result .kana-feedback { grid-template-columns: minmax(0, 1fr); }
  .kana-result > .btn { width: 100%; }
  .kana-footer { margin-top: 27px; }
  .japanese-entry { grid-template-columns: minmax(0,1fr) 100px; gap: 8px; padding: 25px 23px; border-radius: 20px; }
  .japanese-entry h2 { font-size: 26px; }
  .japanese-entry p { font-size: 12px; }
  .japanese-entry-glyphs { transform: scale(.6); transform-origin: left center; }
  .japanese-entry-meta { gap: 5px 12px; font-size: 9px; }
}
@media (max-width: 390px) {
  .kana-hero { padding: 20px; }
  .kana-hero h1 { font-size: 25px; }
  .kana-page .card { padding: 16px; }
  .kana-script { padding: 11px; }
  .kana-script > strong { font-size: 25px; width: 28px; }
  .kana-script > span:not(.kana-selection) { font-size: 12px; }
  .kana-stage-example { display: none; }
  .kana-tile strong { font-size: 25px; }
  .kana-tile small { font-size: 10px; }
  .kana-chart-heading .text-btn { font-size: 10px; }
  .japanese-entry { grid-template-columns: 1fr; }
  .japanese-entry-glyphs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .kana-page *, .japanese-program * { scroll-behavior: auto !important; transition: none !important; }
}
/* ===== Kana learning upgrade: today's recommendations, lesson picker, memory levels, explanations ===== */
.kana-lv-new { --lv: #b9c4ca; }
.kana-lv-learning { --lv: #dda449; }
.kana-lv-stable { --lv: #137c73; }
.kana-lv-mastered { --lv: #0f4c5c; }
.kana-today { margin-bottom: 18px; }
.kana-today h2 { margin-bottom: 14px; font-size: 18px; }
.kana-reco-list { display: grid; gap: 10px; }
.kana-reco { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid #e1e6e2; border-radius: 14px; background: #fdfdfb; }
.kana-reco strong { font-size: 14px; }
.kana-reco p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.kana-reco .btn { flex-shrink: 0; min-width: 104px; font-size: 12px; }
.kana-focus { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.kana-focus legend { padding: 0; margin-bottom: 10px; color: var(--ink); font-size: 14px; font-weight: 700; }
.kana-focus-list { display: grid; gap: 8px; }
.kana-focus-option { display: flex; align-items: center; gap: 13px; margin: 0; padding: 14px 15px; border: 1px solid #e1e6e2; border-radius: 14px; background: #fff; cursor: pointer; font-weight: 400; }
.kana-focus-option.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.kana-focus-option.disabled { background: #f7f8f5; cursor: not-allowed; }
.kana-focus-option input { margin: 0; accent-color: #137c73; }
.kana-focus-option.disabled .kana-focus-copy { opacity: .62; }
.kana-focus-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kana-focus-copy strong { color: var(--ink); font-size: 13px; font-weight: 750; line-height: 1.35; }
.kana-focus-copy small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
.kana-focus-count { color: #137c73; font-weight: 700; }
.kana-focus-hint { color: #7a5517; }
.kana-focus-set { padding: 0 0 2px 33px; }
.kana-focus-set select { margin: 0; min-height: 44px; padding: 9px 12px; border-color: var(--line); border-radius: 10px; color: var(--ink); font-size: 13px; background: #fff; }
.kana-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; padding: 0; list-style: none; color: var(--muted); font-size: 11px; }
.kana-legend li { display: inline-flex; align-items: center; gap: 6px; }
.kana-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--lv); }
.kana-tile small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kana-tile small::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--lv, #b9c4ca); vertical-align: 1px; }
.kana-tile.kana-lv-learning small { color: #7a5517; }
.kana-tile.kana-lv-mastered small { color: #0f4c5c; font-weight: 700; }
.kana-memo,
.kana-confused { margin: 16px 0 0; padding: 15px 16px; text-align: left; background: #fff; border: 1px solid #e7e7dd; border-radius: 14px; }
.kana-memo h3,
.kana-confused h3 { margin: 0 0 7px; color: #137c73; font-size: 12px; letter-spacing: .6px; }
.kana-memo p { margin: 0; font-size: 13px; line-height: 1.6; }
.kana-memo .kana-detail-note { margin: 9px 0 0; padding-top: 9px; border-top: 1px solid #eeeee6; }
.kana-confused ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kana-confuse-chip { display: grid; place-items: center; min-width: 48px; min-height: 48px; padding: 4px 10px; border: 1px solid #e0e6e1; border-radius: 12px; background: #fdfdfb; color: var(--ink); font-size: 26px; line-height: 1.2; }
button.kana-confuse-chip:hover { border-color: #137c73; background: #f1f7f3; }
.kana-confuse-chip.static { border-style: dashed; background: #f5f5ee; color: #566761; }
.kana-level-line { margin: 0 0 4px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.kana-level-line span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--lv); }
.kana-plan { margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.kana-quiz .kana-progress-bar:has(+ .kana-plan) { margin-bottom: 8px; }
.kana-match-hint { margin: 18px 0 -8px; padding: 9px 12px; border-radius: 10px; background: #fbf4e6; color: #6f5326; font-size: 12px; text-align: center; }
.kana-typing-field { max-width: 420px; margin: 0 auto; }
.kana-typing-field .kana-typing { max-width: none; }
.kana-typing-help { margin-top: 8px; text-align: center; font-size: 12px; }
.kana-feedback { align-items: start; }
.kana-explain { margin: 8px 0 0; padding: 10px 12px; border-left: 3px solid #c6995a; border-radius: 10px; background: #fbf4e6; color: #6f5326; font-size: 12px; line-height: 1.6; text-align: left; }
.kana-explain.ok { border-left-color: #137c73; background: #edf6f2; color: #14574f; }
.kana-accepted { margin: 6px 0 0; color: #4f6159; font-size: 12px; }
.kana-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kana-result-actions .btn { min-width: 190px; }
@media (max-width: 700px) {
  .kana-reco { flex-direction: column; align-items: stretch; gap: 12px; }
  .kana-reco .btn { width: 100%; min-height: 48px; }
  .kana-focus-option { padding: 13px; gap: 11px; }
  .kana-focus-set { padding-left: 0; }
  .kana-focus-set select { width: 100%; }
  .kana-result-actions { flex-direction: column; }
  .kana-result-actions .btn { width: 100%; min-height: 49px; }
}
/* ===== End kana learning upgrade ===== */
/* ===== Kana round 2: nine stages, introduction, practice options, custom group, word/text, stroke order and drawing ===== */
.kana-stage.disabled { background: #f7f8f5; border-style: dashed; cursor: not-allowed; }
.kana-stage.disabled .kana-stage-number,
.kana-stage.disabled .kana-stage-copy { opacity: .62; }
.kana-stage.disabled input { margin-left: 0; cursor: not-allowed; }
.kana-stage-soon { margin-left: auto; padding: 2px 9px; border: 1px solid #dfe3dc; border-radius: 20px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.kana-session-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.kana-session-stages > li { min-width: 0; }
.kana-custom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 0; padding: 12px 16px; border: 1px solid #137c73; border-radius: 14px; background: #edf6f2; }
.kana-custom p { margin: 0; color: #14574f; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.kana-custom .text-btn { flex: none; font-size: 12px; }
.kana-options { margin-top: 16px; border: 1px solid #e1e6e2; border-radius: 14px; background: #fff; }
.kana-options > summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 700; list-style: none; }
.kana-options > summary::-webkit-details-marker { display: none; }
.kana-options > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: -4px 3px 0 auto; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
.kana-options[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.kana-options[open] > summary { border-bottom: 1px solid #eef1ed; }
.kana-options-body { display: grid; gap: 18px; padding: 16px; }
.kana-option-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.kana-option-group legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.kana-segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(40px, 54px); max-width: 100%; gap: 4px; padding: 4px; border-radius: 12px; background: #f3f4f0; }
.kana-segmented label { position: relative; display: grid; place-items: center; min-height: 44px; margin: 0; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; }
.kana-segmented label.selected { background: #fff; color: #137c73; box-shadow: 0 1px 4px #17354b0c; }
.kana-segmented input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.kana-switch { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.kana-switch input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; min-height: 0; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 13px; background: #c3cfca; cursor: pointer; transition: background .15s; }
.kana-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #17354b33; transition: transform .15s; }
.kana-switch input:checked { background: #137c73; }
.kana-switch input:checked::after { transform: translateX(20px); }
.kana-skipped { margin: 0 0 18px; padding: 9px 12px; border-radius: 10px; background: #f6f6f0; color: #54656d; font-size: 12px; }
.kana-skipped p { margin: 0; }
.kana-skipped p + p { margin-top: 3px; }
.kana-intro .kana-plan { margin-bottom: 16px; text-align: center; }
.kana-intro-card { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 20px 0; padding: 22px 24px; border: 1px solid #e8e9df; border-radius: 18px; background: #f7f7f0; text-align: center; }
.kana-intro-count { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .6px; }
.kana-intro-glyph { color: var(--ink); font-size: 96px; font-weight: 500; line-height: 1.2; }
.kana-intro-reading { color: #137c73; font-size: 26px; font-weight: 750; }
.kana-intro-memo { width: 100%; max-width: 520px; margin: 6px 0 4px; text-align: left; }
.kana-intro-memo .kana-intro-tip-label { margin: 0 0 4px; color: #137c73; font-size: 12px; font-weight: 700; letter-spacing: .6px; }
.kana-intro-tip { margin: 0; padding: 12px 14px; border-left: 3px solid #137c73; border-radius: 10px; background: #fff; color: #3e5560; font-size: 13px; line-height: 1.65; text-align: left; }
.kana-intro-card audio { width: 100%; max-width: 350px; margin-top: 6px; }
.kana-intro-card .muted { margin: 0; font-size: 12px; }
.kana-intro-nav { display: flex; gap: 12px; }
.kana-intro-nav .btn { flex: 1; min-height: 48px; }
.kana-intro-skip { display: flex; justify-content: center; margin-top: 10px; }
.kana-intro-skip .text-btn { font-size: 12px; color: var(--muted); }
.kana-question-compact { min-height: 0; margin: 14px 0; padding: 12px; font-size: 56px; }
.kana-word { font-size: clamp(40px, 11vw, 72px); overflow-wrap: anywhere; }
.kana-text { min-height: 120px; font-size: clamp(28px, 7vw, 44px); line-height: 1.5; overflow-wrap: anywhere; }
.kana-focus-char { background: none; color: #137c73; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.kana-quiz > p.kana-meaning { margin: -6px 0 18px; color: var(--muted); font-size: 14px; text-align: center; }
.kana-strokes,
.kana-drawing { display: grid; gap: 12px; justify-items: center; margin-top: 4px; }
.kana-stroke-preview { display: block; width: min(100%, 300px); aspect-ratio: 1 / 1; height: auto; border: 1px solid #e0e3d9; border-radius: 16px; background: #fff; }
.kana-draw-status { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.kana-stroke-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kana-stroke-tile { position: relative; width: 76px; height: 76px; min-width: 64px; min-height: 64px; padding: 4px; border: 1px solid #dce5e1; border-radius: 12px; background: #fff; }
.kana-stroke-tile:hover:not(:disabled) { border-color: #137c73; background: #f1f7f3; }
.kana-stroke-tile svg { display: block; width: 100%; height: 100%; }
.kana-page .kana-stroke-tile:disabled { opacity: 1; cursor: not-allowed; }
.kana-stroke-tile.chosen { border-color: #137c73; background: #edf6f2; }
.kana-stroke-tile.chosen svg { opacity: .35; }
.kana-stroke-order { position: absolute; top: -7px; right: -7px; display: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #137c73; color: #fff; font-size: 12px; font-weight: 700; }
.kana-stroke-tile.chosen .kana-stroke-order { display: grid; }
.kana-stroke-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kana-stroke-actions .btn { min-width: 150px; }
.kana-draw-surface { display: block; width: min(100%, 420px, calc(100vh - 330px)); width: min(100%, 420px, calc(100dvh - 330px)); min-width: min(100%, 220px); aspect-ratio: 1 / 1; height: auto; border: 2px solid #cfdcd5; border-radius: 16px; background: #fff; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.kana-replay { margin-top: 6px; font-size: 12px; }
.kana-replay summary { display: list-item; min-height: 44px; padding-block: 12px; box-sizing: border-box; color: #137c73; font-weight: 650; cursor: pointer; }
.kana-replay audio { display: block; width: 100%; max-width: 320px; margin-top: 6px; }
.kana-row-glyph { display: block; width: 96px; height: 96px; margin: 4px 0; border: 1px solid #e0e3d9; border-radius: 10px; background: #fff; }
.kana-row-glyph.wide { width: 128px; height: 128px; }
.kana-feedback-item .kana-meaning { color: var(--muted); }
.kana-feedback-item b { font-weight: 750; }
.kana-results { margin: 16px 0 0; padding: 15px 16px; text-align: left; background: #fff; border: 1px solid #e7e7dd; border-radius: 14px; }
.kana-results h3 { margin: 0 0 8px; color: #137c73; font-size: 12px; letter-spacing: .6px; }
.kana-results ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kana-results li,
.kana-results p { margin: 0; color: #3e5560; font-size: 12px; line-height: 1.5; }
.kana-group-actions { display: grid; gap: 8px; margin: 16px 0 0; }
.kana-group-actions .btn { width: 100%; font-size: 12px; }
.kana-detail .kana-group-note,
.kana-detail .kana-group-full { margin: 2px 0 0; text-align: center; }
.kana-text-card .kana-progress-skill { margin-top: 0; padding-top: 0; border-top: 0; }
.kana-weak-list .btn { margin-top: 12px; font-size: 12px; }
@media (max-width: 700px) {
  .kana-session-stages { display: flex; gap: 4px; }
  .kana-session-stages > li { padding: 8px 0; }
  .kana-custom { flex-wrap: wrap; }
  .kana-intro-card { padding: 18px 16px; }
  .kana-intro-glyph { font-size: 80px; }
  .kana-stroke-tile { width: 68px; height: 68px; }
  .kana-stroke-actions .btn { flex: 1; min-width: 130px; }
  .kana-options-body { padding: 14px; }
  .kana-intro-nav { gap: 8px; }
}
@media (max-width: 390px) {
  .kana-practice-scope .kana-script { padding: 9px 8px; gap: 5px; }
  .kana-page .kana-quiz:has(.kana-draw-surface) { padding-inline: 10px; }
  .kana-drawing { grid-template-columns: minmax(0, 1fr); }
  .kana-draw-surface { max-width: calc(100vw - 24px); }
}
/* ===== End kana round 2 ===== */

/* ===== Kana round 3: skipping, shorter results, sticky actions, focus and contrast ===== */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* Two-tone focus ring (navy on a white halo, 12:1 on light and dark surfaces); choice cards show it around the whole card. */
.kana-page :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #17354b; outline-offset: 2px; box-shadow: 0 0 0 6px #fff; }
.kana-option:has(input:focus-visible),
.kana-stage:has(input:focus-visible),
.kana-focus-option:has(input:focus-visible),
.kana-segmented label:has(input:focus-visible) { outline: 3px solid #17354b; outline-offset: 2px; }
.kana-page .kana-option input:focus-visible,
.kana-page .kana-stage input:focus-visible,
.kana-page .kana-focus-option input:focus-visible,
.kana-page .kana-segmented input:focus-visible { outline: none; box-shadow: none; }
.kana-page :where(h1, h2, h3)[tabindex="-1"]:focus-visible { box-shadow: none; }
.kana-page select { min-height: 44px; }
.kana-page summary { min-height: 44px; padding-block: 12px; box-sizing: border-box; }
.kana-credits a { display: inline-flex; align-items: center; min-height: 44px; }
.kana-quiz { --pad: 34px; }
/* Skip (stages 7-9) */
.kana-skip { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.kana-skip .text-btn { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.kana-skip-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 6px; margin: 6px 0 0; padding: 0 6px 0 14px; border-radius: 12px; background: #eef0ec; color: #44544d; font-size: 13px; font-weight: 650; }
.kana-skip-status .text-btn { font-size: 13px; }
/* Typed stages: field-level alert for accented letters */
.kana-page .field-error { margin: 8px 0 0; color: #a2352c; font-size: 13px; font-weight: 650; text-align: center; }
.kana-page .field-error:empty { display: none; }
.kana-typing input[aria-invalid="true"] { border-color: #a2352c; box-shadow: 0 0 0 1px #a2352c; }
/* Round play button (listening question, introduction) */
.kana-play { display: grid; place-items: center; flex: none; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 50%; background: #137c73; color: #fff; font-size: 28px; line-height: 1; box-shadow: 0 4px 12px #137c7340; }
.kana-play:hover { background: #0d665f; }
.kana-play.playing { background: #17354b; }
.kana-play span { display: block; transform: translateX(2px); }
.kana-play.playing span { transform: none; }
.kana-listen .kana-play { margin: 0 auto; }
.kana-intro-card .kana-play { margin-top: 6px; }
/* Sticky primary action of a question */
.kana-quiz-bottom { position: sticky; bottom: 0; z-index: 3; margin-inline: calc(-1 * var(--pad)); padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8px 16px #17354b0d; }
/* A focused control scrolls into view above the sticky bar, never under it. */
html:has(.kana-quiz-bottom) { scroll-padding-bottom: 104px; }
/* The leave and replace dialogs live outside .kana-page: they get the same ring and a 44px close button. */
#dialog:has(.kana-confirm-actions) :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #17354b; outline-offset: 2px; box-shadow: 0 0 0 6px #fff; }
#dialog:has(.kana-confirm-actions) .close { min-width: 44px; min-height: 44px; }
/* Resume card, expired-session screen, leave dialog */
.kana-resume { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; border-color: #137c73; background: #edf6f2; }
.kana-resume strong { color: #14574f; font-size: 14px; }
.kana-resume-actions { display: flex; flex: none; gap: 10px; }
.kana-dead .form-error { margin-top: 14px; }
.kana-dead-actions { display: grid; gap: 10px; margin-top: 18px; }
.kana-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.kana-confirm-actions .btn { flex: 1; min-width: 150px; }
/* Untouched groups on the progress tab */
.kana-untouched { margin-top: 18px; padding: 0 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.kana-untouched > summary { cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 700; }
.kana-untouched ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; margin: 0; padding: 0 0 16px; list-style: none; color: var(--muted); font-size: 13px; }
.kana-stage6-note { margin: 16px 4px 0; }
/* Result: summary, actions, then the rows that need another look grouped by stage */
.kana-result-skipped { margin: -4px 0 12px; }
.kana-result-actions { margin: 20px 0 6px; }
.kana-review { margin-top: 26px; text-align: left; }
.kana-review h2 { margin-bottom: 10px; font-size: 18px; }
.kana-review-empty { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #edf6f2; color: #14574f; font-size: 14px; }
.kana-review > .btn { margin-bottom: 6px; }
.kana-feedback-group h3 { margin: 20px 0 10px; font-size: 14px; }
ol.kana-feedback { margin: 0; padding: 0; list-style: none; }
/* A long unbroken answer (the learner's own typing, a long model sentence) wraps inside its row instead of widening the page. */
.kana-feedback-item { min-width: 0; overflow-wrap: anywhere; }
.kana-skipped p { overflow-wrap: anywhere; }
@media (max-width: 650px) { ol.kana-feedback.grid { grid-template-columns: minmax(0, 1fr); } }
.kana-feedback-item.skipped { border-color: #d3dad5; background: #f6f6f2; }
.kana-feedback-item.skipped > span { color: #54656d; }
.kana-feedback-item.skipped .kana-explain { border-left-color: #9aa8a2; background: #eceeea; color: #44544d; }
.kana-page .kana-replay summary { padding-block: 12px; }
@media (max-width: 900px) {
  .kana-quiz { --pad: 24px; }
  .kana-session-stages { display: flex; gap: 5px; }
  .kana-session-stages > li { padding: 8px 0; }
}
@media (max-width: 700px) {
  .kana-quiz { --pad: 20px; }
  .kana-tile small { white-space: normal; text-align: center; line-height: 1.2; }
  .kana-resume { flex-direction: column; align-items: stretch; }
  .kana-resume-actions .btn { flex: 1; }
  /* The actions follow the score in the page order but stay in reach at the bottom of the screen. */
  .kana-result { --pad: 20px; display: flex; flex-direction: column; }
  .kana-result .kana-result-actions { order: 90; position: sticky; bottom: 0; z-index: 3; flex-direction: row; flex-wrap: wrap; margin: 18px calc(-1 * var(--pad)) calc(-1 * var(--pad)); padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; box-shadow: 0 -8px 16px #17354b0d; }
  .kana-result .kana-result-actions .btn { flex: 1 1 140px; width: auto; min-width: 0; min-height: 48px; }
  .kana-start-row { position: sticky; bottom: 0; z-index: 3; margin-inline: -20px; margin-bottom: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-radius: 0 0 18px 18px; box-shadow: 0 -8px 16px #17354b0d; }
  .kana-start-row > div { flex: 1 1 100%; }
  html:has(.kana-result-actions), html:has(.kana-start-row) { scroll-padding-bottom: 104px; }
}
@media (max-width: 700px) and (max-height: 760px) {
  .kana-start-row { gap: 8px; padding-block: 10px calc(10px + env(safe-area-inset-bottom)); }
  .kana-start-row p { display: none; }
}
@media (max-width: 390px) {
  .kana-quiz { --pad: 16px; }
  .kana-result { --pad: 16px; }
  .kana-start-row { margin-inline: -16px; margin-bottom: -16px; padding-inline: 16px; }
  .kana-page .kana-quiz:has(.kana-draw-surface) { --pad: 10px; }
}
/* Short screens: keep the question and the primary action in view */
/* Phones (narrow, or a touch screen in landscape) that are also short: the instruction, plan, stage chips and hint stay for screen readers only.
   A laptop window that is merely short keeps them, because the hint is where the 1-4 and R shortcuts are listed. */
@media (max-height: 760px) and (max-width: 700px), (max-height: 760px) and (pointer: coarse) {
  .kana-quiz > .kana-plan, .kana-quiz > p.muted, .kana-session-stages, .kana-quiz-bottom > span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

@media (max-height: 760px) {
  .kana-quiz-top { margin-bottom: 8px; }
  .kana-quiz .kana-progress-bar { margin: 6px 0 12px; }
  .kana-quiz > h2 { margin-bottom: 4px; font-size: 20px; }
  .kana-question { min-height: 96px; margin: 10px 0; font-size: 56px; padding: 8px; }
  .kana-question-compact { min-height: 60px; margin: 8px 0; font-size: 38px; }
  .kana-listen { margin: 10px 0; padding: 14px; }
  .kana-stroke-preview { width: min(100%, 160px); }
  .kana-draw-surface { width: min(100%, 420px, calc(100vh - 250px)); width: min(100%, 420px, calc(100dvh - 250px)); }
  .kana-quiz-bottom { flex-direction: row; align-items: center; padding-block: 10px calc(10px + env(safe-area-inset-bottom)); margin-top: 14px; }
  .kana-quiz-bottom > .btn { flex: 1; min-height: 46px; }
  .kana-drawing, .kana-strokes { gap: 8px; }
}
/* Landscape phones: the drawing surface on the left, its controls beside it */
@media (orientation: landscape) and (max-height: 520px) {
  .kana-drawing { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: stretch; column-gap: 18px; }
  .kana-drawing .kana-draw-surface { grid-row: 1 / span 4; width: min(100%, calc(100vh - 215px)); width: min(100%, calc(100dvh - 215px)); }
  .kana-drawing .kana-draw-status, .kana-drawing .kana-skip { justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .kana-play, .kana-play:hover { transition: none; }
}
/* ===== End kana round 3 ===== */

.support-session-banner{background:#fff2d6;color:#6d4710;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;border-bottom:1px solid #ebcb87}.support-session-banner button{background:#fff;border:1px solid #bb8b36;border-radius:8px;padding:8px 12px;color:#65420d;cursor:pointer}

/* Learning/class workflows: readable filters, stable keyboard focus, long names. */
.ux-filterbar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;padding:16px;background:var(--surface,#fff);border:1px solid var(--border,#dce5ec);border-radius:16px;margin:18px 0 12px}
.ux-filterbar label{display:flex;flex-direction:column;gap:7px;min-width:150px;flex:1;font-size:13px;font-weight:700;color:var(--text,#19334b)}
.ux-filterbar .ux-search{flex:2;min-width:min(260px,100%)}
.ux-filterbar input,.ux-filterbar select{width:100%;min-height:48px;font-size:16px;background:#fff;color:#19334b;border:1px solid #b9cbd6;border-radius:10px;padding:10px 12px}
.ux-filterbar .btn{min-height:48px;white-space:normal}
.ux-filterbar :is(input,select):focus-visible{outline:3px solid #226ba0;outline-offset:2px}
.ux-result-count{font-size:14px;color:var(--muted,#526879);font-variant-numeric:tabular-nums;margin:12px 0}
:is(.ux-class-card,.ux-roster-card){min-width:0;overflow-wrap:anywhere}
:is(.ux-class-card,.ux-roster-card) .row>div{min-width:0}
:is(.ux-class-card,.ux-roster-card)[hidden],#class-empty[hidden],#roster-empty[hidden]{display:none!important}
.ux-roster-card .feature-links{gap:8px}
.ux-roster-card .feature-links :is(a,button){min-height:44px;display:inline-flex;align-items:center}
:is(h1,h2,h3){scroll-margin-top:100px}
@media(max-width:600px){.ux-filterbar{padding:12px;gap:10px}.ux-filterbar label{min-width:calc(50% - 10px)}.ux-filterbar .ux-search{flex-basis:100%}.ux-filterbar .btn{flex-grow:1}.ux-roster-card .row{flex-wrap:wrap}}

/* Connection actions stay beside identity; narrow screens get an explicit grid. */
.friend-person-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px}
.friend-person-card>.row{min-width:0}.friend-person-card h3{overflow-wrap:anywhere}
.friend-person-actions{display:flex;flex-direction:column;gap:8px;align-items:stretch;max-width:190px}
.friend-person-actions>.btn{margin:0;min-height:44px;white-space:normal;text-align:center}
.profile-head .profile-topline{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:16px}
.profile-actionbar{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:10px;min-width:0}
.profile-actionbar>.btn{min-height:48px;white-space:normal;text-align:center}
.group-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
.group-workspace>.card{position:sticky;top:20px}.group-members{display:grid;gap:12px}
.group-member-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.group-member-actions .btn{white-space:normal;min-height:48px}
.group-picker{display:grid;gap:10px;margin-top:12px;max-height:520px;overflow:auto;padding:2px}
.group-friend-choice{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:14px;min-height:72px;padding:12px;cursor:pointer}
.group-friend-choice:has(input:checked){background:#edf6fc;border-color:#226ba0}
.group-friend-choice input{width:22px;height:22px;flex:none;accent-color:#226ba0}
.group-friend-choice span{overflow-wrap:anywhere}.group-friend-choice .avatar{flex:none}
@media(max-width:700px){.group-workspace{grid-template-columns:1fr}.group-workspace>.card{position:static}.profile-head .profile-topline{grid-template-columns:1fr}.profile-actionbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}.profile-actionbar>.tag{grid-column:1/-1}.friend-person-card{gap:10px}.friend-person-actions{max-width:145px}.group-picker{max-height:none}}

.friend-person-identity{min-width:0;color:inherit;text-decoration:none}.friend-person-identity>div{min-width:0}
.friend-person-actions{flex-direction:row;flex-wrap:nowrap;align-items:stretch;max-width:none}
.friend-person-actions>.btn{flex:1;min-width:0;padding:10px 12px}
.profile-head .profile-actionbar{display:flex;flex-wrap:nowrap;align-items:stretch;gap:8px}
.profile-actionbar>:is(.btn,.text-btn){display:flex;align-items:center;justify-content:center;flex:1;min-width:0;min-height:48px;padding:10px 8px;text-align:center;white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){.profile-actionbar{width:100%}.friend-person-actions{max-width:58%}}

.profile-actionbar>.connection-icon{flex:0 0 48px;width:48px;padding:10px}

/* Profile photos retain their crop in the header; the image dialog shows the full source. */
.profile-photo-button{display:block;padding:0;border:0;background:transparent;color:inherit;cursor:zoom-in;max-width:100%}
.profile-cover>.profile-photo-button{width:100%;height:100%}
.profile-avatar-button{border-radius:50%;flex-shrink:0}
.profile-photo-button:focus-visible{outline:3px solid var(--blue,#226b9b);outline-offset:4px}
.profile-photo-button:active{opacity:.8}

/* Beginner Japanese discovery: three real course covers; no auto-rotating carousel. */
.home-japanese{margin:24px 0 32px}.home-japanese>.muted{margin:0 0 16px;line-height:1.6}.home-kana-link{display:flex;align-items:center;gap:14px;padding:16px 20px;margin-bottom:16px;background:#edf6f3}.home-kana-link .icon{margin:0;flex-shrink:0}.home-kana-link strong{min-width:0;overflow-wrap:anywhere}.home-kana-link>span[lang]{color:var(--muted);margin-left:auto}.home-kana-link .course-icon{flex-shrink:0}@media(max-width:600px){.home-kana-link{flex-wrap:wrap;padding:14px}.home-kana-link>span[lang]{margin-left:0}.home-japanese .library-grid{grid-template-columns:1fr}}
