:root {
  color-scheme: light;
  --ink: #192d24;
  --muted: #586b61;
  --line: #d7e1d7;
  --paper: #fbfcf8;
  --bg: #edf1e9;
  --green: #145747;
  --deep: #122e25;
  --lime: #e3f7aa;
  --error: #832b3b;
  font-family: Tahoma,"Segoe UI",sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
}

button,input,textarea,select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible {
  outline: 3px solid #478d76;
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
  opacity: .58;
}

.shell {
  max-width: 760px;
  margin: auto;
  padding: 0 clamp(16px,5vw,40px) calc(100px + env(safe-area-inset-bottom));
}

.masthead {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--deep);
  color: var(--lime);
  font: bold 20px Georgia,serif;
}

h1,h2,p {
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(24px,5vw,36px);
  line-height: 1.5;
}

h2 {
  font-size: 18px;
}

small,.muted {
  color: var(--muted);
}

.hero,.card {
  padding: clamp(17px,4vw,28px);
  border-radius: 22px;
  margin-bottom: 15px;
}

.hero {
  color: white;
  background: var(--deep);
}

.hero small,.hero p {
  color: #daf0df;
}

.hero .english-title {
  color: #fff;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
}

.card > :last-child,.hero > :last-child {
  margin-bottom: 0;
}

.english,.english-title {
  direction: ltr;
  text-align: left;
  font-family: system-ui,sans-serif;
}

.english-title {
  font-weight: 670;
  font-size: clamp(19px,4vw,26px);
  line-height: 1.42;
}

.examples {
  padding: 0;
  list-style: none;
  margin: 14px 0;
}

.example {
  padding: 10px 14px;
  background: #edf3e7;
  border-inline-start: 3px solid #44846c;
  border-radius: 8px;
  margin: 8px 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary,.secondary,.text-button,.choice,.topic {
  border-radius: 12px;
  padding: 9px 16px;
  min-height: 44px;
}

.primary {
  background: var(--green);
  color: white;
  border: 1px solid transparent;
  font-weight: bold;
}

.hero .primary {
  background: var(--lime);
  color: var(--deep);
}

.secondary,.choice,.topic {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

.text-button {
  background: transparent;
  color: var(--green);
  border: 1px solid transparent;
}

.primary:hover,.secondary:hover,.choice:hover,.topic:hover {
  filter: brightness(.96);
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

progress {
  width: 100%;
  height: 9px;
  accent-color: var(--green);
  display: block;
}

.topics {
  display: grid;
  gap: 8px;
}

.topic {
  text-align: start;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.topic[disabled] {
  opacity: .73;
}

.topic .english {
  font-weight: 600;
}

.topic .status {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.topic .symbol {
  min-width: 26px;
  color: var(--green);
  font-weight: bold;
  text-align: center;
}

.choices {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.choice {
  width: 100%;
  text-align: left;
}

.feedback {
  background: #edf4e7;
  border-color: #c2d4bb;
}

.feedback.incorrect {
  background: #fbf1ed;
  border-color: #e9cbc4;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

label {
  display: block;
  margin: 12px 0 4px;
  font-weight: bold;
}

textarea,input,select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #acbfb2;
  border-radius: 10px;
  color: var(--ink);
  background: white;
}

textarea {
  resize: vertical;
  min-height: 150px;
}

.writing-result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#notice {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: #fff4f5;
  color: var(--error);
}

#notice[data-kind="loading"] {
  color: var(--ink);
  background: #dcead9;
}

#nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4,1fr);
  width: min(100%,760px);
  gap: 5px;
  padding: 9px clamp(12px,4vw,28px) calc(9px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  z-index: 2;
}

#nav button {
  padding: 8px 0;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
}

#nav [aria-current="page"] {
  background: #e1efdc;
  color: var(--deep);
  font-weight: bold;
}

a {
  color: var(--green);
}
