:root {
  --paper: #f7f1e3;
  --paper-light: #fffaf0;
  --ink: #203531;
  --ink-soft: #5e6d68;
  --coral: #eb6a4b;
  --coral-dark: #c84d34;
  --yellow: #f4c95d;
  --green: #85b77c;
  --blue: #6ba9b4;
  --line: rgba(32, 53, 49, 0.16);
  --shadow: 0 18px 50px rgba(55, 54, 42, 0.1);
  --display: "Kaiti SC", "STKaiti", "KaiTi", serif;
  --body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background:
    linear-gradient(rgba(60, 91, 83, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 91, 83, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
}

.app-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1.5px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 7px;
  background: var(--ink);
  border-radius: 50% 50% 48% 52% / 48% 54% 46% 52%;
  transform: rotate(-3deg);
}

.brand-mark span { display: block; border-radius: 3px 3px 1px 1px; background: var(--paper-light); }
.brand-mark span:nth-child(1) { height: 10px; }
.brand-mark span:nth-child(2) { height: 18px; background: var(--yellow); }
.brand-mark span:nth-child(3) { height: 14px; background: var(--coral); }

.header-tools { display: flex; align-items: center; gap: 18px; }
.step-meter { width: min(260px, 32vw); display: flex; align-items: center; gap: 12px; }
.step-meter__label { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.step-meter__track { width: 100%; height: 5px; overflow: hidden; background: rgba(32, 53, 49, 0.12); border-radius: 999px; }
.step-meter__track i { display: block; width: 20%; height: 100%; background: var(--coral); border-radius: inherit; transition: width 450ms cubic-bezier(.2,.8,.2,1); }
.parent-link { padding: 7px 12px; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper-light); font-size: 12px; font-weight: 900; white-space: nowrap; cursor: pointer; }
.account-link { min-width: 58px; padding: 7px 12px; border: 1px solid var(--ink); border-radius: 999px; color: var(--paper-light); background: var(--ink); font-size: 12px; font-weight: 900; white-space: nowrap; cursor: pointer; }
.account-link.is-member { color: var(--ink); background: var(--yellow); }
.account-link.is-admin { background: var(--coral); }

.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 80px; }
.view { display: none; animation: rise-in 520ms cubic-bezier(.2,.78,.2,1) both; }
.view--active { display: block; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes crop-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-card {
  min-height: 530px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  overflow: hidden;
  position: relative;
  background: var(--paper-light);
  border: 1.5px solid var(--ink);
  border-radius: 40px 22px 42px 26px;
  box-shadow: var(--shadow), 8px 9px 0 var(--ink);
}

.hero-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 36px;
  top: -8px;
  left: 47%;
  background: rgba(244, 201, 93, .6);
  transform: rotate(-2deg);
}

.hero-copy { padding: 82px 58px 64px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 18px; display: flex; align-items: center; gap: 9px; color: var(--coral-dark); font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.eyebrow span { width: 22px; height: 3px; background: currentColor; border-radius: 99px; transform: rotate(-8deg); }

h1, h2 { font-family: var(--display); letter-spacing: -.04em; }
h1 { margin: 0; max-width: 660px; font-size: clamp(44px, 6vw, 76px); line-height: 1.12; font-weight: 800; }
h1 em { position: relative; color: var(--coral); font-style: normal; white-space: nowrap; }
h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 9px; background: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 7 Q45 1 90 6 T178 4' fill='none' stroke='%23eb6a4b' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat; }
.hero-intro { max-width: 520px; margin: 28px 0 0; color: var(--ink-soft); font-size: 18px; line-height: 1.8; }
.hero-actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 24px;
  border: 1.5px solid var(--ink);
  border-radius: 17px 13px 18px 12px;
  background: transparent;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-2px) rotate(-.3deg); }
.button:active { transform: translateY(1px); }
.button--large { min-height: 58px; padding-inline: 30px; font-size: 17px; }
.button--primary { color: #fffaf0; background: var(--coral); border-color: var(--ink); box-shadow: 4px 5px 0 var(--ink); }
.button--primary:hover { background: #f17858; box-shadow: 6px 7px 0 var(--ink); }
.button--paper { background: var(--paper-light); box-shadow: 3px 4px 0 rgba(32, 53, 49, .22); }
.button--danger { color: var(--coral-dark); background: rgba(235,106,75,.12); border-color: var(--coral-dark); }
.button--restore { color: #2f6841; background: rgba(133,183,124,.2); border-color: #477b51; }
.button-icon { font-size: 25px; transform: rotate(20deg); }
.demo-links { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.text-button { padding: 5px 0; border: 0; border-bottom: 1px dashed var(--ink-soft); background: transparent; color: var(--ink-soft); font-weight: 700; cursor: pointer; }
.text-button span { display: inline-block; color: var(--coral); transition: transform .2s ease; }
.text-button:hover span { transform: translateX(5px); }
.text-button--3d { color: var(--coral-dark); border-bottom-color: var(--coral); }

.hero-visual {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background: var(--yellow);
  border-left: 1.5px solid var(--ink);
  clip-path: polygon(9% 0, 100% 0, 100% 100%, 0 100%);
}
.hero-visual::before { content: ""; position: absolute; inset: 30px; border: 1.5px dashed rgba(32, 53, 49, .35); border-radius: 50% 40% 48% 44%; transform: rotate(8deg); }
.note-card { position: absolute; background: var(--paper-light); border: 1.5px solid var(--ink); box-shadow: 6px 7px 0 rgba(32, 53, 49, .24); }
.fraction-note { z-index: 2; width: 92px; height: 128px; top: 64px; left: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-7deg); border-radius: 8px 13px 7px 11px; font-family: var(--display); font-size: 36px; font-weight: 700; }
.fraction-note i { width: 48px; height: 3px; background: var(--ink); }
.hero-sketch { position: absolute; width: 76%; right: 1%; bottom: 56px; fill: var(--paper-light); stroke: var(--ink); stroke-width: 4; }
.sketch-line { fill: none; stroke: var(--coral); stroke-width: 11; stroke-linecap: round; }
.sketch-arrow { fill: none; stroke-width: 4; }
.pencil-label { position: absolute; right: 48px; top: 66px; padding: 11px 18px; color: var(--paper-light); background: var(--ink); border-radius: 50%; font-family: var(--display); font-size: 20px; transform: rotate(7deg); }
.mini-grid { position: absolute; left: 72px; bottom: 62px; width: 145px; display: grid; grid-template-columns: repeat(4, 1fr); border: 2px solid var(--ink); transform: rotate(4deg); }
.mini-grid i { aspect-ratio: 1; border: 1px solid var(--ink); background: var(--paper-light); }
.mini-grid i:nth-child(-n+3) { background: var(--green); }

.promise-row { margin-top: 58px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.promise-row article { position: relative; padding: 10px 12px 10px 62px; }
.promise-number { position: absolute; left: 0; top: 7px; color: var(--coral); font-family: var(--display); font-size: 31px; font-weight: 800; transform: rotate(-7deg); }
.promise-row strong { display: block; font-family: var(--display); font-size: 23px; }
.promise-row p { margin: 8px 0 0; color: var(--ink-soft); line-height: 1.65; }

.scope-panel { margin-top: 70px; padding: 42px; position: relative; overflow: hidden; color: var(--paper-light); background: var(--ink); border-radius: 28px 17px 32px 19px; box-shadow: 8px 9px 0 var(--coral); }
.scope-panel::after { content: "✓"; position: absolute; right: -8px; top: -48px; color: rgba(244,201,93,.12); font-family: var(--display); font-size: 190px; transform: rotate(8deg); pointer-events: none; }
.scope-intro { max-width: 770px; position: relative; z-index: 1; }
.scope-intro .eyebrow { color: var(--yellow); }
.scope-intro h2 { font-size: clamp(34px, 4.5vw, 52px); }
.scope-intro > p:last-child { max-width: 690px; margin: 20px 0 0; color: rgba(255,250,240,.72); font-size: 16px; line-height: 1.8; }
.scope-grid { margin-top: 32px; display: grid; grid-template-columns: .8fr 1.2fr 1fr; gap: 14px; position: relative; z-index: 1; }
.scope-card { min-width: 0; padding: 23px; color: var(--ink); background: var(--paper-light); border: 1.5px solid var(--paper-light); border-radius: 18px 12px 21px 14px; }
.scope-card > span { display: block; margin-bottom: 10px; color: var(--coral-dark); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.scope-card > strong { display: block; font-family: var(--display); font-size: 23px; }
.scope-card > p { margin: 10px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.scope-card--boundary { background: #f9e4dc; }
.scope-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.scope-tags i { padding: 6px 9px; color: var(--ink); background: rgba(244,201,93,.4); border: 1px solid rgba(32,53,49,.2); border-radius: 999px; font-size: 11px; font-style: normal; font-weight: 800; }

.section-heading { display: flex; align-items: flex-start; gap: 18px; }
.section-heading .eyebrow { margin-bottom: 8px; }
h2 { margin: 0; font-size: clamp(36px, 5vw, 58px); line-height: 1.12; }
.section-lead { margin: 15px 0 30px 66px; color: var(--ink-soft); font-size: 17px; }
.back-button { width: 48px; height: 48px; flex: 0 0 auto; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper-light); font-size: 23px; cursor: pointer; box-shadow: 2px 3px 0 rgba(32, 53, 49, .2); }

.crop-stage {
  width: min(900px, 100%);
  min-height: 420px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2d3532;
  border: 2px solid var(--ink);
  border-radius: 26px 17px 24px 19px;
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none;
}
.crop-stage img { display: block; max-width: 100%; max-height: 66vh; object-fit: contain; pointer-events: none; }
.crop-shade { position: absolute; z-index: 2; background: rgba(20, 28, 26, .62); pointer-events: none; }
.crop-box { position: absolute; z-index: 3; border: 2px solid #fffaf0; box-shadow: 0 0 0 1px rgba(32,53,49,.5), inset 0 0 0 1px rgba(32,53,49,.5); cursor: move; touch-action: none; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; pointer-events: none; }
.crop-box::before { left: 33.333%; top: 0; bottom: 0; width: 33.333%; border-left: 1px dashed rgba(255,255,255,.45); border-right: 1px dashed rgba(255,255,255,.45); }
.crop-box::after { top: 33.333%; left: 0; right: 0; height: 33.333%; border-top: 1px dashed rgba(255,255,255,.45); border-bottom: 1px dashed rgba(255,255,255,.45); }
.crop-corner { position: absolute; width: 26px; height: 26px; border: 4px solid var(--yellow); background: var(--ink); border-radius: 50%; }
.crop-corner--nw { left: -13px; top: -13px; cursor: nwse-resize; }
.crop-corner--ne { right: -13px; top: -13px; cursor: nesw-resize; }
.crop-corner--se { right: -13px; bottom: -13px; cursor: nwse-resize; }
.crop-corner--sw { left: -13px; bottom: -13px; cursor: nesw-resize; }
.crop-label { position: absolute; left: 12px; top: 12px; padding: 5px 10px; color: var(--ink); background: var(--yellow); border-radius: 8px; font-size: 12px; font-weight: 900; }
.tip-strip { width: min(900px, 100%); margin: 18px auto 0; padding: 13px 17px; border-left: 4px solid var(--yellow); background: rgba(255, 250, 240, .72); color: var(--ink-soft); border-radius: 0 10px 10px 0; }
.tip-strip span { margin-right: 8px; color: var(--ink); font-weight: 900; }
.sticky-actions { width: min(900px, 100%); margin: 28px auto 0; display: flex; justify-content: flex-end; gap: 12px; }

.recognition-layout { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr); gap: 26px; align-items: stretch; }
.thumbnail-card, .question-editor { background: var(--paper-light); border: 1.5px solid var(--ink); box-shadow: 5px 6px 0 rgba(32,53,49,.17); }
.thumbnail-card { padding: 14px; border-radius: 18px 12px 20px 14px; }
.thumbnail-card img { display: block; width: 100%; height: 260px; object-fit: contain; background: #e9e5d9; border-radius: 10px; }
.thumbnail-action { width: 100%; margin-top: 12px; padding: 10px; border: 0; background: transparent; color: var(--coral-dark); font-weight: 800; cursor: pointer; }
.question-editor { padding: 24px; border-radius: 14px 22px 13px 19px; }
.editor-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-topline label { font-weight: 900; }
.confidence-pill { padding: 6px 10px; color: var(--ink); background: var(--yellow); border-radius: 999px; font-size: 12px; font-weight: 900; }
.question-editor textarea { width: 100%; margin-top: 16px; resize: vertical; border: 0; border-bottom: 2px solid var(--ink); outline: 0; background: repeating-linear-gradient(transparent, transparent 34px, rgba(32,53,49,.1) 35px); color: var(--ink); font-family: var(--display); font-size: 23px; line-height: 35px; }
.tag-row { min-height: 32px; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--paper); font-size: 12px; font-weight: 800; }
.model-note { margin: 24px 0 0; padding: 14px 16px; background: rgba(244, 201, 93, .28); border: 1px dashed rgba(32,53,49,.3); border-radius: 12px; color: var(--ink-soft); }
.model-note span { margin-right: 8px; color: var(--coral-dark); font-weight: 900; }

.auth-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.auth-card { min-height: 430px; position: relative; display: flex; flex-direction: column; padding: 36px; overflow: hidden; border: 1.5px solid var(--ink); box-shadow: 7px 8px 0 rgba(32,53,49,.16); }
.auth-card--login { background: var(--paper-light); border-radius: 27px 16px 31px 18px; }
.auth-card--register { background: #dfead8; border-radius: 17px 31px 18px 28px; }
.auth-number { position: absolute; top: 17px; right: 24px; color: rgba(32,53,49,.13); font-family: var(--display); font-size: 74px; font-weight: 900; line-height: 1; }
.auth-kicker { margin: 0; color: var(--coral-dark); font-size: 12px; font-weight: 900; letter-spacing: .09em; }
.auth-card h3, .redeem-card h3, .membership-ticket h3, .admin-action-card h3 { margin: 7px 0 25px; font-family: var(--display); font-size: 30px; }
.auth-card label, .admin-action-card label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--ink-soft); font-size: 12px; font-weight: 900; }
.auth-card input, .admin-action-card input, .admin-action-card select, .redeem-card input { width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 11px 8px 12px 9px; outline: 0; color: var(--ink); background: rgba(255,250,240,.8); }
.auth-card input:focus, .admin-action-card input:focus, .admin-action-card select:focus, .redeem-card input:focus { box-shadow: 0 0 0 4px rgba(244,201,93,.5); }
.auth-card .button { width: 100%; margin-top: auto; }
.auth-card small { margin-top: 14px; color: var(--ink-soft); text-align: center; line-height: 1.5; }

.member-overview { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 24px; }
.membership-ticket { min-height: 330px; position: relative; overflow: hidden; padding: 35px; color: var(--paper-light); background: var(--ink); border: 1.5px solid var(--ink); border-radius: 31px 17px 34px 19px; box-shadow: 7px 8px 0 var(--coral); }
.membership-ticket::after { content: ""; width: 190px; height: 190px; position: absolute; right: -55px; bottom: -70px; border: 25px solid var(--yellow); border-radius: 50%; opacity: .65; }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; z-index: 1; }
.ticket-top span { padding: 7px 13px; color: var(--ink); background: var(--yellow); border-radius: 999px; font-size: 12px; font-weight: 900; }
.ticket-top small { color: rgba(255,250,240,.68); }
.membership-ticket h3 { position: relative; z-index: 1; margin-top: 34px; margin-bottom: 8px; font-size: 34px; }
.membership-ticket > p { position: relative; z-index: 1; margin: 0; color: rgba(255,250,240,.68); }
.quota-grid { max-width: 560px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; position: relative; z-index: 1; margin-top: 38px; }
.quota-grid div { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.quota-grid span { color: rgba(255,250,240,.65); font-size: 12px; font-weight: 800; }
.quota-grid strong { font-family: var(--display); font-size: 18px; }
.quota-grid i { grid-column: 1 / -1; height: 7px; overflow: hidden; background: rgba(255,250,240,.18); border-radius: 99px; }
.quota-grid b { display: block; width: 0; height: 100%; background: var(--coral); border-radius: inherit; transition: width .45s ease; }
.redeem-card { padding: 31px; background: var(--paper-light); border: 1.5px solid var(--ink); border-radius: 18px 29px 16px 25px; box-shadow: 5px 6px 0 rgba(32,53,49,.15); }
.redeem-card h3 { margin-bottom: 8px; }
.redeem-card > p { color: var(--ink-soft); line-height: 1.65; }
.redeem-card form { display: grid; gap: 10px; margin-top: 24px; }
.redeem-card .text-button { margin-top: 24px; }
.pricing-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pricing-grid article { min-height: 190px; position: relative; padding: 26px; background: var(--paper-light); border: 1.5px solid var(--ink); border-radius: 17px 12px 20px 14px; }
.pricing-grid article.is-featured { background: var(--yellow); box-shadow: 5px 6px 0 var(--ink); transform: rotate(-.5deg); }
.pricing-grid article > i { position: absolute; right: 12px; top: -11px; padding: 5px 9px; color: var(--paper-light); background: var(--coral); border: 1px solid var(--ink); border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 900; }
.pricing-grid span, .pricing-grid strong, .pricing-grid small { display: block; }
.pricing-grid span { color: var(--ink-soft); font-size: 12px; font-weight: 900; }
.pricing-grid strong { margin-top: 8px; color: var(--coral-dark); font-family: var(--display); font-size: 38px; }
.pricing-grid p { margin: 12px 0 4px; font-weight: 800; }
.pricing-grid small { color: var(--ink-soft); }

.admin-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.admin-summary article { min-height: 130px; padding: 22px; background: var(--paper-light); border: 1.5px solid var(--ink); border-radius: 16px 11px 19px 13px; box-shadow: 3px 4px 0 rgba(32,53,49,.13); }
.admin-summary span, .admin-summary small { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 900; }
.admin-summary strong { display: block; margin: 12px 0 4px; color: var(--coral); font-family: var(--display); font-size: 34px; }
.admin-actions-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.admin-action-card { padding: 28px; background: #dfead8; border: 1.5px solid var(--ink); border-radius: 18px 27px 15px 24px; }
.admin-action-card:nth-child(2) { background: rgba(244,201,93,.55); border-radius: 27px 17px 25px 15px; }
.admin-action-card--security { background: rgba(107,169,180,.2); border-radius: 15px 24px 20px 13px; }
.admin-action-card h3 { margin-bottom: 18px; }
.admin-action-card .button { width: 100%; }
.admin-action-card > small { display: block; margin-top: 12px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.admin-action-card output { min-height: 42px; display: grid; place-items: center; margin-top: 13px; padding: 8px; border: 1px dashed var(--ink-soft); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 900; }
.admin-table-card { margin-top: 22px; padding: 26px; background: var(--paper-light); border: 1.5px solid var(--ink); border-radius: 21px 14px 24px 16px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table-card table { width: 100%; border-collapse: collapse; margin-top: 10px; text-align: left; }
.admin-table-card th, .admin-table-card td { padding: 14px 10px; border-bottom: 1px dashed var(--line); white-space: nowrap; }
.admin-table-card th { color: var(--ink-soft); font-size: 11px; letter-spacing: .05em; }
.admin-table-card tr.is-archived { opacity: .62; }
.status-dot { padding: 5px 8px; color: var(--coral-dark); background: rgba(235,106,75,.13); border-radius: 99px; font-size: 11px; font-weight: 900; }
.status-dot.is-active { color: #356942; background: rgba(133,183,124,.27); }
.status-dot.is-disabled { color: var(--ink-soft); background: rgba(94,109,104,.14); }
.table-action { min-height: 34px; padding: 0 12px; color: var(--coral-dark); background: rgba(235,106,75,.09); border: 1px solid var(--coral); border-radius: 999px; font-size: 12px; font-weight: 900; cursor: pointer; }
.table-action:hover { color: var(--paper-light); background: var(--coral); }
.code-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 18px; }
.code-list article { padding: 13px; border: 1px dashed var(--ink-soft); border-radius: 9px; background: var(--paper); }
.code-list code, .code-list span { display: block; }
.code-list code { font-weight: 900; }
.code-list span { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.audit-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 11px; padding-top: 18px; }
.audit-list article { min-width: 0; padding: 15px; background: var(--paper); border: 1px dashed var(--ink-soft); border-radius: 9px 13px 8px 12px; }
.audit-list span, .audit-list small { display: block; color: var(--ink-soft); font-size: 10px; font-weight: 900; }
.audit-list strong { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.audit-list p { min-height: 2.8em; margin: 7px 0 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.4; }

.member-editor { width: min(720px, calc(100% - 28px)); max-height: min(88vh, 820px); padding: 0; overflow: auto; color: var(--ink); background: var(--paper-light); border: 2px solid var(--ink); border-radius: 25px 16px 28px 18px; box-shadow: 9px 11px 0 var(--ink); }
.member-editor::backdrop { background: rgba(25,38,35,.66); backdrop-filter: blur(3px); }
.member-editor form { padding: 30px; }
.member-editor__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.member-editor__head h3 { margin: 6px 0 0; font-family: var(--display); font-size: 34px; }
.member-editor__close { width: 42px; height: 42px; flex: 0 0 auto; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper); font-size: 25px; cursor: pointer; }
.member-editor__summary { margin-top: 22px; display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 16px 18px; color: var(--paper-light); background: var(--ink); border-radius: 14px 9px 16px 11px; }
.member-editor__summary span, .member-editor__summary small { font-size: 11px; font-weight: 800; }
.member-editor__summary strong { grid-row: span 2; align-self: center; color: var(--yellow); font-family: var(--display); font-size: 25px; }
.member-editor__summary small { color: rgba(255,250,240,.68); }
.member-editor__grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 22px; }
.member-editor__grid label { display: grid; align-content: start; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 900; }
.member-editor__grid input { width: 100%; min-height: 48px; padding: 0 14px; color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 10px 7px 12px 8px; outline: 0; }
.member-editor__grid input:focus { box-shadow: 0 0 0 4px rgba(244,201,93,.5); }
.member-editor__grid small { color: var(--ink-soft); font-size: 10px; font-weight: 700; line-height: 1.4; }
.member-editor__warning { margin: 20px 0 0; padding: 12px 14px; color: var(--coral-dark); background: rgba(235,106,75,.1); border-left: 4px solid var(--coral); border-radius: 0 10px 10px 0; font-size: 12px; line-height: 1.55; }
.member-editor__actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

.tutor-topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tutor-topbar .eyebrow { margin-bottom: 7px; }
.voice-button { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--yellow); font-weight: 900; cursor: pointer; }
.voice-bars { height: 18px; display: flex; align-items: center; gap: 2px; }
.voice-bars i { display: block; width: 3px; height: 8px; background: var(--ink); border-radius: 3px; }
.voice-button.is-speaking .voice-bars i { animation: sound .6s ease-in-out infinite alternate; }
.voice-button.is-speaking .voice-bars i:nth-child(2) { animation-delay: .2s; }
.voice-button.is-speaking .voice-bars i:nth-child(3) { animation-delay: .35s; }
@keyframes sound { to { height: 18px; } }

.problem-fold { margin-top: 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.problem-fold summary { padding: 13px 3px; display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 14px; font-weight: 800; cursor: pointer; list-style: none; }
.problem-fold summary::-webkit-details-marker { display: none; }
.problem-fold[open] summary span { transform: rotate(45deg); }
.problem-fold p { margin: 0; padding: 6px 4px 18px; font-family: var(--display); font-size: 20px; line-height: 1.7; }

.learning-grid { margin-top: 25px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr); gap: 24px; }
.diagram-card, .coach-card, .answer-dock { border: 1.5px solid var(--ink); box-shadow: 6px 7px 0 rgba(32,53,49,.14); }
.diagram-card { min-height: 450px; padding: 24px; background: var(--paper-light); border-radius: 24px 15px 28px 17px; }
.card-kicker { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.card-kicker span { padding: 7px 12px; color: var(--paper-light); background: var(--ink); border-radius: 8px; font-weight: 900; }
.card-kicker small { color: var(--ink-soft); }
.diagram-assurance { margin-top: 16px; display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 8px 12px; align-items: center; padding: 11px 13px; color: #356942; background: rgba(133,183,124,.18); border-left: 4px solid var(--green); border-radius: 0 10px 10px 0; }
.diagram-assurance[hidden] { display: none; }
.diagram-assurance strong { font-size: 12px; white-space: nowrap; }
.diagram-assurance span { min-width: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.diagram-assurance[data-status="schematic"] { color: #725512; background: rgba(244,201,93,.24); border-left-color: var(--yellow); }
.diagram-assurance[data-status="unsupported"] { color: var(--coral-dark); background: rgba(235,106,75,.12); border-left-color: var(--coral); }
.diagram-stage { min-height: 330px; display: flex; align-items: center; justify-content: center; padding: 28px 8px 12px; }
.diagram-caption { margin: 0; text-align: center; color: var(--ink-soft); font-family: var(--display); font-size: 19px; }

.solid-loading, .solid-error { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ink-soft); text-align: center; }
.solid-loading i { width: 42px; height: 42px; border: 3px solid rgba(32,53,49,.18); border-top-color: var(--coral); border-radius: 50%; animation: spin .8s linear infinite; }
.solid-error strong, .solid-error span { display: block; }
.solid-error strong { color: var(--ink); font-family: var(--display); font-size: 22px; }
.solid-3d-shell { width: min(680px, 100%); }
.solid-viewport { height: 340px; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 42%, #fffdf7 0, #f3ead7 70%, #e5dbc7 100%); border: 1.5px solid var(--ink); border-radius: 22px 14px 24px 16px; box-shadow: inset 0 0 45px rgba(32,53,49,.06), 4px 5px 0 rgba(32,53,49,.12); }
.solid-canvas { width: 100%; height: 100%; }
.solid-canvas canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.solid-canvas canvas:active { cursor: grabbing; }
.dimension-chip { position: absolute; z-index: 2; padding: 5px 9px; color: var(--paper-light); background: var(--ink); border: 1px solid var(--paper-light); border-radius: 8px 6px 9px 7px; box-shadow: 2px 3px 0 var(--coral); font-family: var(--display); font-size: 13px; font-weight: 800; pointer-events: none; }
.dimension-chip--length { left: 50%; bottom: 19px; transform: translateX(-50%) rotate(-1deg); }
.dimension-chip--width { right: 16px; bottom: 72px; transform: rotate(-8deg); }
.dimension-chip--height { left: 15px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.dimension-chip--radius { left: 50%; bottom: 19px; transform: translateX(-50%) rotate(-1deg); }
.drag-hint { position: absolute; z-index: 2; top: 13px; right: 14px; padding: 6px 9px; color: var(--ink-soft); background: rgba(255,250,240,.82); border-radius: 999px; font-size: 11px; font-weight: 800; pointer-events: none; }
.drag-hint i { display: inline-block; margin-right: 3px; color: var(--coral); font-style: normal; }
.solid-toolbar { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 5px; background: rgba(32,53,49,.09); border-radius: 14px; }
.solid-toolbar button { min-height: 42px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 900; cursor: pointer; transition: background .18s ease, color .18s ease, transform .18s ease; }
.solid-toolbar button:hover:not(:disabled) { transform: translateY(-1px); }
.solid-toolbar button.is-active { color: var(--paper-light); background: var(--ink); border-color: var(--ink); box-shadow: 2px 3px 0 var(--coral); }
.solid-toolbar button:disabled { opacity: .38; cursor: not-allowed; }
.solid-mode-copy { min-height: 42px; margin: 11px 8px 0; color: var(--ink-soft); text-align: center; font-family: var(--display); font-size: 16px; line-height: 1.5; }
.solid-3d-shell--fallback .solid-canvas { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px; text-align: center; }
.solid-3d-shell--fallback .solid-canvas strong { font-family: var(--display); font-size: 21px; }
.solid-3d-shell--fallback .solid-canvas span { color: var(--ink-soft); }

.fraction-diagram { width: min(640px, 100%); }
.fraction-diagram__title { margin-bottom: 26px; text-align: center; font-family: var(--display); font-size: 26px; font-weight: 800; }
.fraction-diagram__total { position: relative; margin-bottom: 8px; text-align: center; color: var(--ink-soft); font-weight: 800; }
.fraction-diagram__total::before, .fraction-diagram__total::after { content: ""; position: absolute; top: 50%; width: 22%; border-top: 1.5px solid var(--ink); }
.fraction-diagram__total::before { left: 0; }
.fraction-diagram__total::after { right: 0; }
.fraction-parts { display: grid; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 4px 5px 0 rgba(32,53,49,.14); }
.fraction-part { min-height: 90px; position: relative; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-right: 1.5px solid var(--ink); background: var(--paper); cursor: pointer; animation: part-in .45s ease both; }
.fraction-part:last-child { border-right: 0; }
.fraction-part.is-highlighted { background: var(--coral); }
.fraction-part.is-selected { box-shadow: inset 0 0 0 5px var(--blue); }
.fraction-part i { width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-light); }
.fraction-part.is-highlighted i { background: var(--yellow); }
@keyframes part-in { from { opacity: 0; transform: translateY(8px); } }
.fraction-brace { width: 37.5%; min-width: 120px; margin-top: 8px; color: var(--coral-dark); text-align: center; font-family: var(--display); font-size: 18px; font-weight: 800; }
.fraction-brace::before { content: ""; display: block; width: 100%; height: 14px; border-left: 2px solid; border-right: 2px solid; border-bottom: 2px solid; border-radius: 0 0 12px 12px; }

.bar-diagram { width: min(620px, 100%); }
.bar-title, .number-title, .rect-title { margin-bottom: 30px; text-align: center; font-family: var(--display); font-size: 25px; font-weight: 800; }
.bar-total { margin-bottom: 10px; text-align: center; color: var(--ink-soft); font-weight: 800; }
.bar-track { display: flex; min-height: 94px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.bar-segment { flex: 1 1 0; display: grid; place-items: center; padding: 8px; border: 0; border-right: 2px solid var(--ink); background: var(--yellow); color: var(--ink); text-align: center; cursor: pointer; }
.bar-segment:nth-child(2n) { background: var(--green); }
.bar-segment:last-child { border-right: 0; }
.bar-segment.is-unknown { background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 8px, rgba(107,169,180,.3) 9px, rgba(107,169,180,.3) 16px); }
.bar-segment.is-selected { box-shadow: inset 0 0 0 5px var(--coral); }
.bar-segment strong { display: block; font-family: var(--display); font-size: 18px; }
.bar-segment small { color: var(--ink-soft); }

.number-diagram { width: min(620px, 100%); }
.number-line { height: 120px; position: relative; margin: 60px 28px 0; border-top: 4px solid var(--ink); }
.number-tick { position: absolute; top: -11px; width: 2px; height: 22px; background: var(--ink); }
.number-tick span { position: absolute; top: 27px; left: 50%; transform: translateX(-50%); font-size: 12px; }
.number-marker { position: absolute; top: -50px; padding: 2px 5px; transform: translateX(-50%); border: 0; background: transparent; color: var(--coral-dark); font-weight: 900; cursor: pointer; }
.number-marker::after { content: ""; display: block; width: 14px; height: 14px; margin: 7px auto 0; background: var(--coral); border: 2px solid var(--ink); border-radius: 50%; }
.number-marker.is-selected::after { background: var(--blue); box-shadow: 0 0 0 5px rgba(107,169,180,.25); }

.rect-diagram { text-align: center; }
.rect-shape { width: min(420px, 70vw); aspect-ratio: 1.7; display: grid; margin: 0 auto; border: 3px solid var(--ink); background: rgba(133,183,124,.3); }
.rect-cell { display: grid; place-items: center; padding: 0; border: 0; border-right: 1px dashed rgba(32,53,49,.4); background: transparent; color: var(--ink); font-weight: 800; cursor: pointer; }
.rect-cell:last-child { border-right: 0; }
.rect-cell.is-selected { background: rgba(235,106,75,.55); }
.fraction-part:focus-visible, .bar-segment:focus-visible, .number-marker:focus-visible, .rect-cell:focus-visible { outline: 4px solid var(--blue); outline-offset: -4px; }
.rect-label { margin-top: 12px; font-family: var(--display); font-size: 18px; }

.circle-title, .ratio-title, .statistics-title, .journey-title { margin-bottom: 18px; text-align: center; font-family: var(--display); font-size: 25px; font-weight: 800; }

.circle-diagram { width: min(600px, 100%); }
.circle-diagram svg { width: 100%; max-height: 270px; overflow: visible; }
.circle-shape { fill: rgba(133,183,124,.12); stroke: var(--ink); stroke-width: 4; transition: fill .2s ease, stroke .2s ease, stroke-width .2s ease; }
.circle-sector { fill: rgba(244,201,93,.16); stroke: none; transition: fill .2s ease; }
.circle-radius, .circle-diameter { stroke: rgba(32,53,49,.38); stroke-width: 3; stroke-linecap: round; transition: stroke .2s ease, stroke-width .2s ease; }
.circle-center { fill: var(--ink); }
.circle-diagram text { fill: var(--ink-soft); font-family: var(--display); font-size: 15px; font-weight: 800; }
.circle-diagram[data-circle-mode="radius"] .circle-radius,
.circle-diagram[data-circle-mode="diameter"] .circle-diameter { stroke: var(--coral); stroke-width: 6; }
.circle-diagram[data-circle-mode="circumference"] .circle-shape { stroke: var(--coral); stroke-width: 9; }
.circle-diagram[data-circle-mode="area"] .circle-shape { fill: rgba(133,183,124,.55); }
.circle-diagram[data-circle-mode="sector"] .circle-sector { fill: rgba(244,201,93,.82); stroke: var(--coral); stroke-width: 3; }
.circle-toolbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; padding: 5px; background: rgba(32,53,49,.08); border-radius: 14px; }
.circle-toolbar button { min-height: 40px; padding: 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 900; cursor: pointer; }
.circle-toolbar button.is-active { color: var(--paper-light); background: var(--ink); border-color: var(--ink); box-shadow: 2px 3px 0 var(--coral); }

.annulus-diagram { width: min(600px, 100%); }
.annulus-diagram svg { width: 100%; max-height: 300px; overflow: visible; }
.annulus-road { fill: rgba(244,201,93,.78); stroke: var(--ink); stroke-width: 4; }
.annulus-inner { fill: var(--paper-light); stroke: var(--ink); stroke-width: 3; }
.annulus-diameter { stroke: rgba(32,53,49,.56); stroke-width: 3; stroke-linecap: round; }
.annulus-width { stroke: var(--coral); stroke-width: 7; stroke-linecap: round; }
.annulus-measure-tick { stroke: rgba(32,53,49,.65); stroke-width: 2; }
.annulus-width-tick { stroke: var(--coral-dark); stroke-width: 3; }
.annulus-center { fill: var(--ink); }
.annulus-diagram text { fill: var(--ink); font-family: var(--display); font-size: 14px; font-weight: 800; text-anchor: middle; paint-order: stroke; stroke: rgba(255,250,240,.9); stroke-width: 4px; stroke-linejoin: round; }
.annulus-ring-label { fill: var(--coral-dark) !important; }
.annulus-width-label { fill: var(--coral-dark) !important; font-size: 12px !important; }
.annulus-outer-label { font-size: 13px !important; }

.unsupported-diagram { width: min(520px, 100%); padding: 30px; text-align: center; background: rgba(235,106,75,.08); border: 2px dashed var(--coral); border-radius: 24px 15px 26px 17px; }
.unsupported-mark { width: 66px; height: 66px; display: grid; place-items: center; margin: 0 auto 18px; color: var(--paper-light); background: var(--coral); border: 2px solid var(--ink); border-radius: 50%; box-shadow: 4px 5px 0 var(--yellow); font-family: var(--display); font-size: 34px; }
.unsupported-diagram h3 { margin: 7px 0 10px; font-family: var(--display); font-size: 26px; }
.unsupported-diagram > p:not(.history-kicker) { margin: 0; color: var(--ink-soft); line-height: 1.75; }
.unsupported-diagram > div:last-child { margin-top: 20px; padding: 13px; display: grid; gap: 4px; background: var(--paper-light); border-radius: 11px; }
.unsupported-diagram > div:last-child strong { color: var(--coral-dark); font-size: 11px; letter-spacing: .08em; }
.unsupported-diagram > div:last-child span { font-family: var(--display); font-size: 17px; }

.ratio-diagram { width: min(650px, 100%); }
.ratio-badge { width: max-content; margin: -8px auto 22px; padding: 5px 13px; color: var(--paper-light); background: var(--ink); border-radius: 999px; font-weight: 900; }
.ratio-rows { display: grid; gap: 15px; }
.ratio-row { display: grid; grid-template-columns: minmax(58px, auto) minmax(0, 1fr) minmax(40px, auto); gap: 12px; align-items: center; }
.ratio-row > strong { font-family: var(--display); font-size: 18px; }
.ratio-row > span { color: var(--ink-soft); font-weight: 900; }
.ratio-units { display: grid; grid-template-columns: repeat(auto-fit, minmax(22px, 1fr)); gap: 4px; }
.ratio-unit { min-width: 20px; min-height: 42px; padding: 0; border: 2px solid var(--ink); border-radius: 6px 4px 7px 5px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.ratio-unit:nth-child(3n) { transform: rotate(1deg); }
.ratio-unit.is-selected { box-shadow: inset 0 0 0 5px var(--paper-light), 0 0 0 3px var(--coral); transform: translateY(-3px); }
.ratio-diagram > p { margin: 22px 0 0; text-align: center; color: var(--ink-soft); font-family: var(--display); }

.stats-color-0 { fill: var(--coral); background: var(--coral); }
.stats-color-1 { fill: var(--yellow); background: var(--yellow); }
.stats-color-2 { fill: var(--green); background: var(--green); }
.stats-color-3 { fill: var(--blue); background: var(--blue); }
.stats-color-4 { fill: #b891c7; background: #b891c7; }
.stats-color-5 { fill: #e69a62; background: #e69a62; }
.statistics-diagram { width: min(680px, 100%); }
.statistics-unit { margin: -12px 0 10px; color: var(--ink-soft); text-align: right; font-size: 12px; font-weight: 800; }
.stats-bars { height: 250px; display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 3vw, 24px); padding: 18px 16px 0; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.stats-bar-wrap { min-width: 36px; height: 100%; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.stats-bar { width: min(58px, 80%); min-width: 24px; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; border: 2px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0; transition: filter .16s ease, transform .16s ease; }
.stats-bar b { padding: 2px 4px; color: var(--ink); background: rgba(255,250,240,.75); border-radius: 4px; font-size: 12px; }
.stats-bar-wrap small { color: var(--ink); font-size: 12px; font-weight: 800; }
.stats-bar-wrap.is-selected .stats-bar { filter: saturate(1.3); transform: translateY(-6px); box-shadow: 0 0 0 4px var(--blue); }
.stats-line-chart { width: 100%; max-height: 300px; }
.stats-axis { stroke: var(--ink); stroke-width: 3; }
.stats-line { fill: none; stroke: var(--coral); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.stat-point { cursor: pointer; }
.stat-point circle { fill: var(--yellow); stroke: var(--ink); stroke-width: 3; transition: r .16s ease, fill .16s ease; }
.stat-point text { fill: var(--ink); text-anchor: middle; font-family: var(--body); font-size: 12px; font-weight: 800; }
.stat-point.is-selected circle { r: 13px; fill: var(--blue); }
.stats-pie-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, .65fr); gap: 16px; align-items: center; }
.stats-pie { width: 100%; max-height: 285px; overflow: visible; }
.stats-slice { stroke: var(--paper-light); stroke-width: 4; cursor: pointer; transform-origin: 160px 145px; transition: transform .16s ease, filter .16s ease; }
.stats-slice.is-selected { transform: scale(1.04); filter: saturate(1.25); stroke: var(--ink); }
.stats-pie-hole { fill: var(--paper-light); stroke: var(--ink); stroke-width: 2; }
.stats-legend { display: grid; gap: 9px; }
.stats-legend span { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 13px; font-weight: 800; }
.stats-legend i { width: 14px; height: 14px; border: 1px solid var(--ink); border-radius: 4px; }

.journey-diagram { width: min(700px, 100%); padding: 0 20px; }
.journey-distance { width: max-content; margin: 0 auto 18px; padding: 5px 13px; border-bottom: 2px solid var(--coral); color: var(--ink-soft); font-family: var(--display); font-weight: 800; }
.journey-track { height: 190px; position: relative; margin: 0 22px; }
.journey-track::before { content: ""; position: absolute; left: 0; right: 0; top: 84px; border-top: 5px solid var(--ink); }
.journey-place { position: absolute; top: 63px; z-index: 2; width: 48px; height: 48px; display: grid; place-items: center; padding: 4px; color: var(--paper-light); background: var(--ink); border: 3px solid var(--paper-light); outline: 2px solid var(--ink); border-radius: 50%; text-align: center; font-size: 11px; font-weight: 900; }
.journey-place--start { left: 0; transform: translateX(-50%); }
.journey-place--end { right: 0; transform: translateX(50%); }
.journey-meeting { position: absolute; top: 75px; z-index: 3; width: 22px; height: 22px; transform: translateX(-50%) rotate(45deg); background: var(--yellow); border: 2px solid var(--ink); }
.journey-meeting b { position: absolute; width: 88px; left: 50%; top: 25px; transform: translateX(-50%) rotate(-45deg); color: var(--coral-dark); font-family: var(--display); font-size: 13px; }
.journey-traveler { position: absolute; top: 8px; z-index: 4; min-width: 92px; min-height: 55px; display: grid; grid-template-columns: 1fr auto; gap: 0 6px; padding: 7px 9px; transform: translateX(-50%); border: 2px solid var(--ink); border-radius: 12px 8px 13px 9px; color: var(--ink); cursor: pointer; box-shadow: 3px 4px 0 rgba(32,53,49,.22); }
.journey-traveler:nth-of-type(even) { top: 122px; }
.journey-traveler strong { font-family: var(--display); }
.journey-traveler > span { font-size: 20px; line-height: 1; }
.journey-traveler small { grid-column: 1 / -1; font-size: 10px; }
.journey-traveler.is-selected { box-shadow: 0 0 0 4px var(--paper-light), 0 0 0 7px var(--coral); }
.circle-toolbar button:focus-visible, .ratio-unit:focus-visible, .stats-bar-wrap:focus-visible, .stats-slice:focus-visible, .stat-point:focus-visible, .journey-traveler:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }

.coach-card { padding: 24px; align-self: start; background: #dfead8; border-radius: 17px 28px 15px 24px; }
.coach-avatar { width: 58px; height: 58px; display: grid; place-items: center; float: left; margin: 0 14px 8px 0; background: var(--ink); color: var(--yellow); border-radius: 54% 46% 58% 42%; font-family: var(--display); font-size: 28px; transform: rotate(-4deg); }
.coach-name { margin: 3px 0 8px; color: var(--ink-soft); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.coach-message { min-height: 74px; margin: 0; font-family: var(--display); font-size: 21px; line-height: 1.55; font-weight: 700; }
.hint-stack { clear: both; padding-top: 12px; }
.hint-item { margin-top: 10px; padding: 12px 13px; background: rgba(255,250,240,.72); border-left: 3px solid var(--coral); border-radius: 0 9px 9px 0; font-size: 14px; line-height: 1.55; animation: rise-in .35s ease both; }
.hint-item small { display: block; margin-bottom: 3px; color: var(--coral-dark); font-weight: 900; }
.button--hint { width: 100%; margin-top: 20px; background: var(--paper-light); box-shadow: 3px 4px 0 var(--ink); }

.answer-dock { margin-top: 24px; padding: 20px 24px; background: var(--paper-light); border-radius: 18px 13px 20px 15px; }
.answer-dock > label { display: block; margin-bottom: 11px; font-weight: 900; }
.answer-row { display: flex; gap: 12px; }
.answer-row input { flex: 1; min-width: 0; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 12px; outline: none; background: var(--paper); font-family: var(--display); font-size: 22px; }
.answer-row input:focus { box-shadow: 0 0 0 3px rgba(244,201,93,.6); }
.answer-feedback { min-height: 22px; margin: 12px 0 0; color: var(--coral-dark); font-weight: 800; }
.answer-feedback.is-correct { color: #3d7d4c; }

.parent-summary { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.parent-summary article { padding: 24px; position: relative; overflow: hidden; background: var(--paper-light); border: 1.5px solid var(--ink); border-radius: 18px 13px 21px 15px; box-shadow: 4px 5px 0 rgba(32,53,49,.16); }
.parent-summary article::after { content: ""; width: 72px; height: 72px; position: absolute; right: -28px; bottom: -28px; border: 13px solid var(--yellow); border-radius: 50%; opacity: .55; }
.parent-summary article:nth-child(2)::after { border-color: var(--green); }
.parent-summary article:nth-child(3)::after { border-color: var(--coral); }
.parent-summary span, .parent-summary small { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.parent-summary strong { display: block; margin: 8px 0 3px; color: var(--coral); font-family: var(--display); font-size: 44px; line-height: 1; }
.history-card { margin-top: 28px; padding: 28px; background: var(--paper-light); border: 1.5px solid var(--ink); border-radius: 22px 15px 25px 17px; }
.history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.history-kicker { color: var(--coral-dark); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.history-heading h3 { margin: 5px 0 0; font-family: var(--display); font-size: 26px; }
.clear-history { padding: 8px 0; border: 0; border-bottom: 1px dashed var(--ink-soft); background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 800; cursor: pointer; }
.history-list { display: grid; }
.history-item { display: grid; grid-template-columns: 60px minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-date { width: 54px; height: 54px; display: grid; place-items: center; color: var(--paper-light); background: var(--ink); border-radius: 50%; text-align: center; font-family: var(--display); font-size: 13px; line-height: 1.15; }
.history-question { min-width: 0; }
.history-question strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: 18px; }
.history-question span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 12px; }
.history-status { padding: 7px 10px; color: #356942; background: rgba(133,183,124,.28); border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.history-status.needs-practice { color: var(--coral-dark); background: rgba(235,106,75,.14); }
.empty-history { padding: 46px 15px; text-align: center; color: var(--ink-soft); }
.empty-history strong { display: block; margin-bottom: 8px; color: var(--ink); font-family: var(--display); font-size: 24px; }
.privacy-note { margin-top: 20px; padding: 18px 20px; border-left: 4px solid var(--green); background: rgba(255,250,240,.56); }
.privacy-note strong { font-size: 13px; }
.privacy-note p { margin: 6px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }

.success-card { max-width: 740px; margin: 30px auto; padding: 58px 48px; position: relative; overflow: hidden; text-align: center; background: var(--paper-light); border: 2px solid var(--ink); border-radius: 42px 21px 46px 25px; box-shadow: 9px 10px 0 var(--ink); }
.success-card::before, .success-card::after { content: ""; position: absolute; width: 130px; height: 130px; border: 18px solid var(--yellow); border-radius: 50%; opacity: .55; }
.success-card::before { left: -70px; top: 80px; }
.success-card::after { right: -60px; bottom: 70px; border-color: var(--green); }
.success-card .eyebrow { justify-content: center; }
.success-burst { width: 96px; height: 96px; display: grid; place-items: center; margin: 0 auto 24px; color: var(--paper-light); background: var(--coral); border: 3px solid var(--ink); border-radius: 47% 53% 44% 56%; box-shadow: 6px 7px 0 var(--yellow); transform: rotate(-5deg); }
.success-burst span { font-size: 46px; transform: rotate(5deg); }
.success-card h2 { font-size: clamp(38px, 6vw, 62px); }
.success-card > p:not(.eyebrow) { color: var(--ink-soft); font-size: 17px; line-height: 1.7; }
.success-stats { margin: 34px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.success-stats div { padding: 20px 10px; border-right: 1px solid var(--line); }
.success-stats div:last-child { border-right: 0; }
.success-stats strong, .success-stats span { display: block; }
.success-stats strong { color: var(--coral); font-family: var(--display); font-size: 32px; }
.success-stats span { margin-top: 4px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }

.loading-screen { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; background: rgba(247,241,227,.96); text-align: center; }
.loading-screen[hidden] { display: none; }
.loading-orbit { width: 112px; height: 112px; display: grid; place-items: center; position: relative; margin-bottom: 26px; border: 2px dashed var(--ink); border-radius: 50%; animation: spin 10s linear infinite; }
.loading-orbit span { width: 54px; height: 54px; display: grid; place-items: center; color: var(--paper-light); background: var(--coral); border: 2px solid var(--ink); border-radius: 50%; font-family: var(--display); font-size: 28px; animation: spin-reverse 10s linear infinite; }
.loading-orbit i { width: 14px; height: 14px; position: absolute; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; }
.loading-orbit i:nth-of-type(1) { top: 4px; left: 15px; }
.loading-orbit i:nth-of-type(2) { right: -4px; top: 49px; background: var(--green); }
.loading-orbit i:nth-of-type(3) { bottom: 3px; left: 20px; background: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }
.loading-screen strong { font-family: var(--display); font-size: 30px; }
.loading-screen p { color: var(--ink-soft); }

.toast { position: fixed; z-index: 30; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 13px 18px; opacity: 0; transform: translate(-50%, 18px); pointer-events: none; color: var(--paper-light); background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); font-weight: 700; transition: opacity .25s ease, transform .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .app-header, .app-shell { width: min(100% - 28px, 680px); }
  .app-header { min-height: 72px; }
  .brand { font-size: 19px; }
  .brand-mark { width: 34px; height: 34px; }
  .step-meter { width: 35vw; }
  .step-meter__label { display: none; }
  .app-shell { padding-top: 28px; padding-bottom: 50px; }
  .hero-card { min-height: 0; grid-template-columns: 1fr; border-radius: 28px 18px 30px 20px; box-shadow: 5px 6px 0 var(--ink); }
  .hero-card::before { left: 22%; }
  .hero-copy { padding: 54px 28px 38px; }
  h1 { font-size: clamp(40px, 12.5vw, 58px); }
  .hero-intro { font-size: 16px; }
  .hero-visual { min-height: 300px; border-left: 0; border-top: 1.5px solid var(--ink); clip-path: none; }
  .fraction-note { top: 43px; left: 56px; width: 76px; height: 104px; font-size: 28px; }
  .pencil-label { top: 40px; right: 30px; }
  .mini-grid { left: 40px; bottom: 38px; width: 112px; }
  .hero-sketch { width: 64%; right: 2%; bottom: 14px; }
  .promise-row { margin-top: 40px; grid-template-columns: 1fr; gap: 18px; }
  .promise-row article { padding-left: 55px; }
  .scope-panel { margin-top: 48px; padding: 30px; }
  .scope-grid { grid-template-columns: 1fr; }
  .section-lead { margin-left: 0; }
  #view-crop.view--active { animation-name: crop-fade-in; }
  #view-crop { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  #view-crop .section-lead { margin-bottom: 18px; }
  .crop-stage { min-height: 280px; max-height: 58dvh; }
  .crop-stage img { max-height: 58dvh; }
  .crop-actions {
    width: 100%;
    margin: 0;
    position: fixed;
    z-index: 15;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px max(14px, calc((100vw - 680px) / 2)) calc(10px + env(safe-area-inset-bottom));
    justify-content: center;
    background: rgba(247, 241, 227, .94);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(32, 53, 49, .12);
    backdrop-filter: blur(12px);
  }
  .crop-actions .button--paper { flex: 0 0 auto; }
  .crop-actions .button--primary { min-width: min(58vw, 340px); }
  .recognition-layout, .learning-grid { grid-template-columns: 1fr; }
  .auth-layout, .member-overview, .admin-actions-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .admin-summary { grid-template-columns: repeat(2, 1fr); }
  .code-list { grid-template-columns: repeat(2, 1fr); }
  .thumbnail-card img { height: 180px; }
  .tutor-topbar { align-items: flex-start; }
  .tutor-topbar h2 { font-size: 36px; }
  .voice-button { flex: 0 0 auto; padding-inline: 13px; }
  .learning-grid { gap: 18px; }
  .diagram-card { min-height: 390px; padding: 17px; }
  .diagram-stage { min-height: 290px; padding-inline: 0; }
  .diagram-assurance { grid-template-columns: 1fr; gap: 4px; }
  .fraction-part { min-height: 76px; }
  .stats-pie-layout { grid-template-columns: 1fr; gap: 2px; }
  .stats-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey-diagram { padding-inline: 10px; }
  .coach-card { padding: 20px; }
  .answer-dock { padding: 17px; }
  .success-card { padding: 46px 22px; box-shadow: 6px 7px 0 var(--ink); }
  .parent-summary { grid-template-columns: 1fr; gap: 12px; }
  .parent-summary article { padding: 18px 20px; }
  .history-card { padding: 20px; }
  .admin-table-wrap { overflow: visible; }
  .admin-table-card table, .admin-table-card tbody, .admin-table-card tr, .admin-table-card td { display: block; width: 100%; }
  .admin-table-card thead { display: none; }
  .admin-table-card tr { margin-top: 13px; padding: 14px; background: var(--paper); border: 1px dashed var(--ink-soft); border-radius: 11px 8px 13px 9px; }
  .admin-table-card td { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 10px; padding: 8px 2px; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .admin-table-card td::before { content: attr(data-label); color: var(--ink-soft); font-size: 11px; font-weight: 900; }
  .member-editor__grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .hero-actions, .sticky-actions { flex-direction: column; }
  .hero-actions .button, .sticky-actions .button { width: 100%; }
  .crop-actions { flex-direction: row; }
  .crop-actions .button { width: auto; min-height: 52px; }
  .crop-actions .button--paper { padding-inline: 16px; }
  .crop-actions .button--primary { flex: 1; min-width: 0; }
  .hero-actions .button--primary { order: -1; }
  .section-heading { gap: 12px; }
  .back-button { width: 42px; height: 42px; }
  h2 { font-size: 36px; }
  .scope-panel { padding: 26px 21px; border-radius: 22px 14px 25px 16px; box-shadow: 5px 6px 0 var(--coral); }
  .scope-intro h2 { font-size: 34px; }
  .scope-card { padding: 20px; }
  .question-editor { padding: 18px; }
  .question-editor textarea { font-size: 20px; }
  .answer-row { align-items: stretch; }
  .answer-row input { width: 100%; min-height: 52px; }
  .answer-row .button { padding-inline: 15px; }
  .success-stats div { padding-inline: 4px; }
  .header-tools { gap: 8px; }
  .step-meter { display: none; }
  .parent-link { padding-inline: 10px; }
  .account-link { padding-inline: 9px; }
  .auth-card { min-height: 390px; padding: 28px 23px; }
  .membership-ticket, .redeem-card { padding: 25px 21px; }
  .quota-grid { grid-template-columns: 1fr; gap: 15px; }
  .admin-summary { gap: 9px; }
  .admin-summary article { min-height: 108px; padding: 17px; }
  .admin-action-card, .admin-table-card { padding: 20px 17px; }
  .member-editor { width: calc(100% - 18px); max-height: 92vh; border-radius: 19px 12px 21px 14px; box-shadow: 5px 6px 0 var(--ink); }
  .member-editor form { padding: 23px 18px; }
  .member-editor__head h3 { font-size: 29px; }
  .member-editor__summary { grid-template-columns: 1fr; }
  .member-editor__summary strong { grid-row: auto; }
  .member-editor__actions { align-items: stretch; flex-direction: column-reverse; }
  .member-editor__actions .button { width: 100%; }
  .code-list { grid-template-columns: 1fr; }
  .history-heading { align-items: flex-end; }
  .history-item { grid-template-columns: 50px minmax(0,1fr); gap: 12px; }
  .history-date { width: 46px; height: 46px; }
  .history-status { grid-column: 2; justify-self: start; }
  .demo-links { align-items: flex-start; flex-direction: column; gap: 10px; }
  .solid-viewport { height: 310px; }
  .dimension-chip--width { right: 8px; }
  .dimension-chip--height { left: 4px; }
  .drag-hint { right: 8px; top: 8px; }
  .circle-toolbar { grid-template-columns: repeat(3, 1fr); }
  .ratio-row { grid-template-columns: 50px minmax(0, 1fr); gap: 8px; }
  .ratio-row > span { grid-column: 2; }
  .ratio-unit { min-height: 34px; }
  .stats-bars { gap: 5px; padding-inline: 7px; }
  .stats-bar-wrap small { max-width: 54px; overflow-wrap: anywhere; }
  .stats-legend { grid-template-columns: 1fr; }
  .journey-track { margin-inline: 28px; }
  .journey-traveler { min-width: 78px; padding-inline: 6px; }
  .tutor-topbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .tutor-topbar h2 { font-size: 32px; }
  .diagram-card { padding-inline: 14px; }
  .unsupported-diagram { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
