.learning-editor {
  width: min(510px, calc(100vw - 28px));
  max-height: min(86vh, 700px);
  max-height: min(86dvh, 700px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 16px 60px #30251933;
}
.learning-editor::backdrop { background: #2e291b52; }
.learning-note-form { display: grid; gap: 12px; padding: clamp(18px,4vw,29px); }
.learning-note-form h2 { font: 700 25px/1.25 var(--serif); }
.learning-note-word, .learning-note-actions, .learning-note-footer, .learning-note-tools { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.learning-note-word strong { color: var(--ink); font: 650 23px/1.5 var(--japanese); }
.learning-note-word span, .learning-note-footer small { font-size: 13px; color: var(--soft); }
.learning-note-word span[lang=ja] { font-family: var(--japanese); }
.learning-note-label { margin-top: 4px; font-size: 14px; font-weight: 650; }
.learning-textarea {
  width: 100%; min-width: 0; min-height: 100px; padding: 10px 12px; resize: vertical;
  font: inherit; font-size: 16px; line-height: 1.65; color: var(--ink);
  background: #fffcf5; border: 1px solid #c7baa5; border-radius: 7px;
}
.learning-textarea:focus-visible, .learning-day:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.learning-note-actions { justify-content: flex-end; }
.learning-note-actions .study-caption { margin-right: auto; white-space: nowrap; }
.learning-note-status { color: var(--red-dark); font-size: 13px; }
.learning-note-status:empty { display: none; }
.learning-note-tools { justify-content: space-between; gap: 8px 16px; }
.learning-note-search { width: min(100%, 310px); }
.learning-note-search input { width: 100%; }
.learning-note-count { margin-top: 14px; margin-bottom: 8px; }
.learning-note-entry { padding: 15px 0; border-top: 1px solid var(--rule); }
.learning-note-text { margin: 7px 0 5px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.learning-note-footer small { margin-right: auto; }
.learning-note-footer .study-btn { font-size: 13px; }
.learning-stats-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; max-width: 690px; margin: 21px 0; }
.learning-trend, .learning-breakdown { margin-top: 24px; }
.learning-trend h4, .learning-breakdown h4 { margin: 0 0 9px; font-size: 16px; line-height: 1.5; }
.learning-legend { display: flex; flex-wrap: wrap; gap: 5px 16px; color: var(--soft); font-size: 13px; }
.learning-legend span { display: inline-flex; align-items: center; gap: 5px; }
.learning-legend span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; }
.learning-bar-good, .learning-legend-good::before { background: #526c52; }
.learning-bar-aided,.learning-legend-aided::before { background: #bb9452; }
.learning-bar-wrong,.learning-legend-wrong::before { background: #a25645; }
.learning-chart { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: clamp(2px,.65vw,9px); margin-top: 12px; }
.learning-day {
  display: grid; grid-template-rows: 20px 76px auto; justify-items: center;
  min-width: 0; gap: 4px; padding: 6px 0; border-radius: 6px; border: 1px solid transparent;
  color: var(--soft); background: transparent; cursor: pointer; font: inherit;
}
.learning-day:hover { background: #f7f1e5; }
.learning-day[aria-pressed=true] { background: #f1ebde; border-color: #d4c9b4; color: var(--ink); }
.learning-day-count, .learning-day-label { font-size: 13px; font-variant-numeric: tabular-nums; }
.learning-day-count { font-weight: 650; }
.learning-bar-track { display: flex; flex-direction: column; justify-content: flex-end; width: min(34px,70%); height: 100%; border-bottom: 1px solid #bdb19c; }
.learning-bar-stack { display: flex; flex-direction: column-reverse; flex-shrink: 0; overflow: hidden; border-radius: 4px 4px 0 0; }
.learning-bar-stack span { flex-basis: 0; }
.learning-day-detail { margin-top: 7px; color: var(--soft); font-size: 13px; line-height: 1.65; }
.learning-breakdown table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.learning-breakdown td, .learning-breakdown th { padding: 8px 6px; border-bottom: 1px solid var(--rule); line-height: 1.5; text-align: right; }
.learning-breakdown th:first-child { text-align: left; padding-left: 0; }
.learning-breakdown thead th { color: var(--soft); font-size: 13px; font-weight: 600; }
.learning-method { margin-top: 13px; }
@media (max-width: 600px) {
  .learning-stats-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .learning-note-search { width: 100%; }
  .learning-day-label { font-size: 11px; }
}
@media (max-width: 360px) {
  .learning-breakdown td,.learning-breakdown th { padding-inline: 2px; }
  .learning-note-actions { gap: 4px; }
  .learning-note-actions .study-btn { padding-inline: 8px; }
}
