:root {
  --purple: #4c378b;
  --purple-dark: #382667;
  --yellow: #f4df49;
  --cream: #faf8f2;
  --ink: #242035;
  --muted: #716b80;
  --line: #e2dceb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  line-height: 1.7;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
h4 {
  line-height: 1.3;
}
h1 {
  font-size: 42px;
  letter-spacing: -1.8px;
  margin: 18px 0;
}
h1 span {
  color: var(--purple);
}
h2 {
  font-size: 27px;
  letter-spacing: -0.8px;
}
h3 {
  font-size: 20px;
}
p {
  color: var(--muted);
}
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}
.app-header {
  max-width: 1360px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 40px;
  border-bottom: 1px solid var(--line);
}
.portal-brand {
  width: 150px;
  height: 75px;
  overflow: hidden;
  display: block;
}
.portal-brand img {
  width: 150px;
  height: 150px;
  transform: translateY(-38px);
  mix-blend-mode: multiply;
}
.app-header nav {
  display: flex;
  align-items: center;
  gap: 25px;
  font-size: 12px;
  font-weight: 600;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--purple);
}
.button,
.soft-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  padding: 13px 19px;
  background: var(--purple);
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}
.button:hover {
  background: var(--purple-dark);
}
.button.yellow {
  background: var(--yellow);
  color: var(--ink);
}
.soft-button {
  background: #eee9f6;
  color: var(--purple);
  padding: 10px 15px;
}
.soft-button:hover {
  background: #e4dcf2;
}
.text-button {
  border: 0;
  background: none;
  color: var(--purple);
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.text-button:hover,
.text-link:hover {
  text-decoration: underline;
}
.text-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple);
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #d2cadd;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  margin-top: 6px;
  font-size: 13px;
}
textarea {
  resize: vertical;
}
.field-note,
.study-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.8;
  margin-top: 8px;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  line-height: 1.7;
}
.checkbox-label input {
  accent-color: var(--purple);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 3px;
}
.status {
  font-size: 12px;
  color: var(--purple);
  min-height: 24px;
}
.status[data-state='error'] {
  color: #a0442e;
}
.app-footer {
  max-width: 1280px;
  margin: 35px auto 0;
  padding: 25px 40px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.account-main {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 80px;
  max-width: 1100px;
  margin: 60px auto;
  padding: 0 30px;
}
.account-story > p {
  max-width: 480px;
  font-size: 14px;
}
.account-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  background: white;
  box-shadow: 0 18px 60px #4c378b0b;
}
.account-card label {
  margin: 15px 0;
}
.account-card form > .button {
  width: 100%;
  margin-top: 15px;
}
.account-card h2 {
  margin-top: 28px;
}
.account-card > p {
  font-size: 12px;
}
.auth-modes {
  display: flex;
  background: #f1edf7;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}
.auth-modes button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 11px;
  flex: 1;
  border-radius: 6px;
}
.auth-modes button[aria-pressed='true'] {
  background: var(--purple);
  color: white;
}
.support-note {
  font-size: 10px !important;
}
.support-note a {
  text-decoration: underline;
}
.account-illustration {
  position: relative;
  margin: 45px 0 35px;
  height: 220px;
}
.account-illustration > div {
  transform: rotate(-5deg);
  border: 2px solid var(--purple);
  border-radius: 16px;
  background: var(--purple);
  color: white;
  padding: 35px 30px;
  max-width: 340px;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -1px;
  box-shadow: 13px 13px 0 var(--yellow);
}
.account-illustration b {
  color: var(--yellow);
}
.account-illustration i {
  font-size: 65px;
  font-style: normal;
  float: right;
  margin-top: -22px;
}
.workspace {
  max-width: 1280px;
  margin: 42px auto;
  padding: 0 40px;
}
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.workspace-heading h1 {
  font-size: 38px;
}
.workspace-heading p {
  font-size: 12px;
}
.band-control {
  min-width: 135px;
}
.notice {
  background: #fff4bb;
  border: 1px solid #e6d158;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 12px;
  margin: 20px 0;
}
.notice a {
  color: var(--purple);
  text-decoration: underline;
  font-weight: 700;
}
.study-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 30px 0;
}
.study-stats > div {
  padding: 20px 25px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.study-stats span {
  font-size: 30px;
  font-weight: 800;
  color: var(--purple);
  line-height: 1;
}
.study-stats p {
  font-size: 10px;
  margin-bottom: 0;
}
.study-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}
.study-layout > aside {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 23px 15px;
}
.study-layout aside > .eyebrow {
  padding-left: 10px;
  font-size: 9px;
}
#tool-nav {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  gap: 7px;
}
.tool-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}
.tool-tab > span {
  font-size: 20px;
  min-width: 24px;
}
.tool-tab.active {
  background: var(--purple);
  color: white;
}
.rail-note {
  font-size: 10px;
  margin: 28px 10px 0;
}
.study-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  min-height: 500px;
  overflow: hidden;
}
.tool-heading h2 {
  margin: 13px 0;
}
.tool-heading p {
  font-size: 12px;
  max-width: 560px;
}
.pill {
  display: inline-block;
  border-radius: 20px;
  background: #f1edf7;
  color: var(--purple);
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 600;
}
.daily-meta {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin: 28px 0 17px;
  font-size: 10px;
  color: var(--muted);
}
.word-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #faf8ff, #fffbee);
  margin: 20px 0;
}
.word-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--purple);
  font-weight: 600;
}
.word-tags > span {
  padding: 4px 9px;
  border: 1px solid #d6cbe8;
  border-radius: 20px;
}
.word-card h3 {
  font-size: 40px;
  margin: 25px 0 8px;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}
.ipa {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 15px;
}
.meaning {
  font-size: 20px;
  color: var(--ink);
  font-weight: 600;
  margin: 20px 0 10px;
}
.example {
  font-size: 13px;
  color: var(--purple);
  border-left: 3px solid var(--yellow);
  padding-left: 13px;
}
.word-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
  flex-wrap: wrap;
}
.flip-button {
  border: 1px dashed #ad9dc8;
  border-radius: 8px;
  padding: 12px 20px;
  background: white;
  color: var(--purple);
  width: 100%;
  font-size: 12px;
  margin: 15px 0 0;
}
.card-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 11px;
}
.filter-row {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin: 25px 0;
  font-size: 11px;
  color: var(--muted);
}
.filter-row select {
  max-width: 330px;
  margin: 0;
}
.review-ratings {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.empty {
  padding: 35px 15px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #faf8fd;
  border-radius: 12px;
  margin: 20px 0;
}
.saved-list {
  margin-top: 20px;
}
.saved-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.saved-row strong {
  display: block;
  color: var(--purple);
  font-size: 17px;
}
.saved-row .ipa {
  font-size: 11px;
}
.saved-row p {
  font-size: 12px;
  margin: 5px 0;
}
.saved-row small {
  font-size: 10px;
  color: var(--muted);
}
.saved-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}
.lesson-card {
  background: #faf8fd;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 25px;
  margin: 20px 0;
}
.lesson-card p,
.lesson-card li {
  font-size: 12px;
}
.lesson-card li {
  margin: 10px 0;
}
.formula {
  background: var(--purple);
  border-radius: 8px;
  padding: 16px;
  color: white;
  font-weight: 600;
}
.quiz-form fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px 20px;
  margin: 20px 0;
}
.quiz-form legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 5px;
  cursor: pointer;
  font-weight: 400;
}
.quiz-option input {
  accent-color: var(--purple);
}
.quiz-result p {
  font-size: 12px;
}
.answer-correct {
  color: #31634b;
}
.answer-wrong {
  color: #9c4e2b;
}
.study-note {
  max-width: 840px;
  margin-left: auto;
  margin-top: 22px;
}
.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}
.admin-library,
.editor-panel {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.admin-library .filter-row {
  display: block;
  margin: 0 0 20px;
}
.admin-library select {
  max-width: none;
  margin-bottom: 15px;
}
.content-list {
  max-height: 650px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.content-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  text-align: left;
  background: #faf8fd;
  color: var(--ink);
}
.content-row strong {
  display: block;
  font-size: 12px;
}
.content-row span {
  font-size: 9px;
  color: var(--muted);
}
.content-row:hover {
  border-color: var(--purple);
}
.editor-panel h2 {
  font-size: 21px;
  margin-top: 0;
}
.editor-panel label {
  margin: 14px 0;
}
.editor-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.json-editor {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  line-height: 1.6;
}
.admin-leads {
  margin-top: 40px;
}
.admin-leads > p {
  font-size: 12px;
}
.lead-row {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 20px 25px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  margin-top: 15px;
}
.lead-row h3 {
  font-size: 17px;
  margin: 0;
}
.lead-row p {
  font-size: 11px;
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.lead-row select {
  width: 170px;
  align-self: start;
  flex-shrink: 0;
}
@media (max-width: 1050px) {
  .account-main {
    gap: 40px;
    grid-template-columns: 1fr 400px;
  }
  .account-story h1 {
    font-size: 36px;
  }
  .workspace {
    padding: 0 25px;
  }
  .study-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .admin-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .study-panel {
    padding: 25px;
  }
}
@media (max-width: 760px) {
  .app-header {
    padding: 7px 20px;
    gap: 15px;
  }
  .portal-brand {
    width: 115px;
    height: 62px;
  }
  .portal-brand img {
    width: 115px;
    height: 115px;
    transform: translateY(-29px);
  }
  .app-header nav {
    gap: 15px;
    font-size: 10px;
  }
  .app-header nav > a:first-child {
    display: none;
  }
  .account-main {
    grid-template-columns: 1fr;
    margin: 35px auto;
    padding: 0 22px;
    gap: 25px;
  }
  .account-story h1 {
    font-size: 34px;
  }
  .account-story > p {
    font-size: 12px;
  }
  .account-illustration {
    display: none;
  }
  .account-card {
    padding: 25px;
  }
  .workspace {
    margin: 30px auto;
    padding: 0 20px;
  }
  .workspace-heading {
    display: block;
  }
  .workspace-heading h1,
  h1 {
    font-size: 32px;
  }
  .band-control {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 230px;
  }
  .band-control select {
    width: 100px;
    margin: 0;
  }
  .study-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 25px 0;
  }
  .study-stats > div {
    padding: 18px;
  }
  .study-stats span {
    font-size: 25px;
  }
  .study-layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .study-layout > aside {
    padding: 15px;
  }
  .rail-note {
    display: none;
  }
  #tool-nav {
    flex-direction: row;
    overflow: auto;
    margin: 12px 0 0;
    gap: 5px;
  }
  .tool-tab {
    flex-shrink: 0;
    padding: 10px;
    font-size: 11px;
  }
  .tool-tab > span {
    font-size: 17px;
    min-width: 18px;
  }
  .study-panel {
    padding: 23px 18px;
    min-height: 400px;
  }
  .tool-heading h2 {
    font-size: 24px;
  }
  .daily-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .word-card {
    padding: 23px 18px;
  }
  .word-card h3 {
    font-size: 34px;
  }
  .meaning {
    font-size: 18px;
  }
  .word-actions .soft-button {
    font-size: 10px;
    padding: 10px;
  }
  .filter-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .filter-row select {
    max-width: none;
  }
  .saved-row {
    flex-direction: column;
    gap: 10px;
  }
  .saved-actions {
    justify-content: flex-start;
  }
  .lesson-card {
    padding: 20px 15px;
  }
  .quiz-form fieldset {
    padding: 15px;
  }
  .review-ratings {
    flex-direction: column;
  }
  .review-ratings > button {
    width: 100%;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-library,
  .editor-panel {
    padding: 20px;
  }
  .content-list {
    max-height: 300px;
  }
  .lead-row {
    flex-direction: column;
    padding: 20px;
  }
  .lead-row select {
    width: 100%;
  }
  .app-footer {
    padding: 22px;
    font-size: 10px;
  }
  .card-controls .soft-button {
    padding: 10px;
    font-size: 10px;
  }
  .study-note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
