:root {
  font-family:
    system-ui,
    -apple-system,
    "Hiragino Sans",
    sans-serif;
  color: #2a382f;
  background: #f7f5ed;
  line-height: 1.7;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #365e48;
  text-underline-offset: 4px;
}
button,
.button {
  border: 0;
  border-radius: 10px;
  background: #3f654c;
  color: white;
  cursor: pointer;
  padding: 11px 19px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.secondary {
  background: #e6eadf;
  color: #304e3b;
}
.danger {
  background: #f4e3df;
  color: #943f32;
}
input,
select,
textarea {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid #ccd1c4;
  border-radius: 8px;
  background: white;
  max-width: 100%;
  min-height: 44px;
}
textarea {
  width: 100%;
  min-height: 100px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 12px 0;
}
label.inline {
  flex-direction: row;
  align-items: center;
}
input[type="checkbox"],
input[type="radio"] {
  min-height: 20px;
  width: 20px;
  accent-color: #3f654c;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #d99842;
  outline-offset: 3px;
}
.site-header {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 24px;
  border-bottom: 1px solid #dce1d3;
}
.brand {
  font-family: serif;
  font-size: 27px;
  letter-spacing: 4px;
  text-decoration: none;
  font-weight: bold;
}
.brand small {
  display: block;
  font-family: system-ui;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: normal;
  color: #77816f;
}
nav {
  display: flex;
  gap: 24px;
}
nav a {
  text-decoration: none;
  font-size: 14px;
}
main {
  max-width: 1000px;
  padding: 32px 24px 60px;
  margin: auto;
  min-height: 65vh;
}
h1 {
  font-size: 30px;
  line-height: 1.5;
  margin: 12px 0 22px;
}
h2 {
  font-size: 21px;
  margin: 0 0 14px;
}
h3 {
  font-size: 17px;
}
.hero {
  padding: 60px 12px 80px;
}
.hero h1 {
  font-family: serif;
  font-size: 48px;
  letter-spacing: 3px;
  line-height: 1.7;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  color: #947a47;
}
.hero p {
  color: #64705f;
}
.login-actions {
  margin: 30px 0;
  display: flex;
  gap: 12px;
  flex-direction: column;
  align-items: stretch;
  max-width: 480px;
}
.login-actions > .card {
  margin-bottom: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.card {
  background: white;
  border: 1px solid #dfe4d7;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 4px 15px #33442204;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 15px 0;
}
.muted,
small {
  color: #75806f;
  font-size: 13px;
}
.badge {
  background: #e9eee3;
  color: #4d6743;
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}
.badge.pending {
  background: #f5ebd4;
  color: #8c6328;
}
.sheet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid #edf0e8;
}
.sheet-row .grow {
  flex: 1;
}
.serial {
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0;
}
.section-head h1 {
  margin: 0;
}
.stats {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}
.stat b {
  display: block;
  font-size: 32px;
  color: #3d6249;
}
.site-footer {
  max-width: 1000px;
  margin: auto;
  padding: 24px;
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: #77816f;
  border-top: 1px solid #dce1d3;
}
.site-footer span {
  margin-left: auto;
}
.prose {
  max-width: 720px;
}
.prose p {
  margin-bottom: 25px;
}
#family-switch {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  margin-bottom: 24px;
}
#family-switch select {
  margin: 0;
  padding: 5px 10px;
  min-height: 34px;
}
#message:not(:empty) {
  padding: 14px 20px;
  background: #f5ebd4;
  border-radius: 10px;
  margin: 18px 0;
  white-space: pre-wrap;
}
.question-grade {
  border-left: 4px solid #c8d8bc;
}
.question-grade .answer-key {
  font-size: 24px;
  letter-spacing: 2px;
}
.choices {
  display: flex;
  gap: 20px;
}
.choices label {
  padding: 10px 20px;
  border: 1px solid #d9e0d1;
  border-radius: 10px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  font-size: 22px;
}
.confidence-low {
  background: #fff2d9;
  padding: 8px 12px;
  border-radius: 8px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f0f3eb;
  padding: 14px;
  border-radius: 8px;
}
details {
  margin: 16px 0;
}
summary {
  cursor: pointer;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}
.weak-chars {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.weak-chars span {
  padding: 12px 18px;
  background: #f3ebd9;
  border-radius: 10px;
  font-size: 24px;
}
.field-hint {
  font-size: 12px;
  color: #777;
}
.readonly {
  background: #f4f5f0;
  padding: 12px;
}
#token-output {
  user-select: all;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .site-header {
    padding: 20px 16px;
  }
  .brand {
    font-size: 22px;
    letter-spacing: 2px;
  }
  nav {
    gap: 15px;
  }
  main {
    padding: 25px 16px;
  }
  .hero {
    padding: 25px 0;
  }
  .hero h1 {
    font-size: clamp(24px, 7.2vw, 32px);
    letter-spacing: 1px;
  }
  .card {
    padding: 18px;
  }
  .sheet-row {
    flex-wrap: wrap;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .site-footer {
    gap: 15px;
    padding: 20px 16px;
  }
  .site-footer span {
    margin-left: 0;
  }
  .section-head {
    align-items: flex-start;
    gap: 12px;
  }
  h1 {
    font-size: 26px;
  }
}

@media (max-width: 600px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .section-head h1 {
    font-size: 26px;
    white-space: nowrap;
  }
}
