:root {
  --bg: #f7f6f2;
  --paper: #fffdfa;
  --ink: #1d1b18;
  --muted: #6b645b;
  --line: #dfd9cf;
  --accent: #0f766e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f5f1e9, #f8f7f4);
}
#app { max-width: 980px; margin: 0 auto; padding: 20px 16px 48px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
input, textarea, button, select { font: inherit; }
input, textarea { width: 100%; border: 1px solid #cec6ba; border-radius: 10px; padding: 10px; background: #fff; }
button { border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; background: var(--accent); color: white; }
button.sub { background: #ece7df; color: #2f2a24; }
button.warn { background: #9a3412; }
.small { font-size: 12px; color: var(--muted); }
.reading {
  font-size: clamp(19px, 2.5vw, 26px);
  line-height: 2;
  letter-spacing: 0.02em;
}
.sentence {
  display: inline;
  margin-right: 6px;
  position: relative;
}
.word {
  border-radius: 4px;
  padding: 0 2px;
}
.word:hover { background: #d9efe9; }
.sent-btn {
  font-size: 11px;
  margin-left: 6px;
  background: #ece7df;
  color: #3b332a;
  padding: 2px 8px;
  border-radius: 999px;
}
.translation { margin: 6px 0 12px; color: #154c47; font-size: 14px; }
.popup {
  position: fixed;
  z-index: 50;
  max-width: 260px;
  background: #fff;
  border: 1px solid #cdc3b5;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.14);
  padding: 10px;
  font-size: 13px;
}
.hidden { display: none; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.list-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 0; }
@media (max-width: 640px) {
  #app { padding: 12px 10px 36px; }
  .card { padding: 12px; }
}
