/* Review/CorrectNote page styles.
   Extracted from user/templates/review.html to keep CSS order intact.
   Scope rules are intentionally Review/Note-specific. */

.aivi-ai-note-context-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 1rem 0;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  padding: 1rem;
}

.aivi-ai-note-context-card[hidden] {
  display: none;
}

.aivi-ai-note-context-card h2 {
  margin: .45rem 0 .25rem;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 900;
}

.aivi-ai-note-context-card p {
  margin: 0;
  color: #475569;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.6;
}

.aivi-ai-note-context-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #fff;
  padding: .3rem .7rem;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 900;
}

.aivi-ai-note-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin: 0;
}

.aivi-ai-note-context-grid div {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  padding: .7rem;
}

.aivi-ai-note-context-grid dt {
  margin: 0;
  color: #64748b;
  font-size: .75rem;
  font-weight: 900;
}

.aivi-ai-note-context-grid dd {
  margin: .2rem 0 0;
  color: #0f172a;
  font-size: .95rem;
  font-weight: 900;
}

.aivi-ai-note-context-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
}

.aivi-ai-note-draft-card {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
  padding: 1.1rem;
}

.aivi-ai-note-draft-card[hidden],
.aivi-ai-note-draft-body[hidden],
.aivi-ai-note-draft-empty[hidden],
.aivi-ai-note-draft-passage[hidden],
.aivi-ai-note-draft-choices[hidden],
.aivi-ai-note-draft-loading[hidden] {
  display: none;
}

.aivi-ai-note-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: .9rem;
}

.aivi-ai-note-draft-kicker,
.aivi-ai-note-draft-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: .25rem .65rem;
  font-size: .76rem;
  font-weight: 900;
}

.aivi-ai-note-draft-kicker {
  border: 1px solid #e9d5ff;
  background: #faf5ff;
  color: #7e22ce;
}

.aivi-ai-note-draft-status {
  flex: 0 0 auto;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.aivi-ai-note-draft-status[data-state="ready"] {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.aivi-ai-note-draft-status[data-state="saved"],
.aivi-ai-note-draft-status[data-state="duplicate"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.aivi-ai-note-draft-status[data-state="error"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.aivi-ai-note-draft-card h2 {
  margin: .45rem 0 .25rem;
  color: #0f172a;
  font-size: 1.22rem;
  font-weight: 950;
}

.aivi-ai-note-draft-card p {
  margin: 0;
  color: #475569;
  line-height: 1.62;
}

.aivi-ai-note-draft-loading,
.aivi-ai-note-draft-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 1rem;
  color: #64748b;
  font-weight: 800;
}

.aivi-ai-note-draft-body {
  display: grid;
  gap: .85rem;
}

.aivi-ai-note-draft-section,
.aivi-ai-note-draft-passage {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: .95rem;
}

.aivi-ai-note-draft-section > span,
.aivi-ai-note-draft-passage > span,
.aivi-ai-note-draft-answer-grid span {
  display: block;
  margin-bottom: .35rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 900;
}

.aivi-ai-note-draft-section p,
.aivi-ai-note-draft-passage p {
  color: #0f172a;
  font-size: .96rem;
  font-weight: 760;
  white-space: pre-wrap;
}

.aivi-ai-note-draft-section.is-guidance {
  border-color: #dbeafe;
  background: #eff6ff;
}

.aivi-ai-note-draft-choices {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: 0;
}

.aivi-ai-note-draft-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: .65rem .75rem;
}

.aivi-ai-note-draft-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: .8rem;
  font-weight: 900;
}

.aivi-ai-note-draft-choice strong {
  color: #0f172a;
  font-size: .92rem;
  font-weight: 760;
}

.aivi-ai-note-draft-choice.is-answer {
  border-color: #86efac;
  background: #f0fdf4;
}

.aivi-ai-note-draft-choice.is-selected:not(.is-answer) {
  border-color: #fecaca;
  background: #fef2f2;
}

.aivi-ai-note-draft-answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.aivi-ai-note-draft-answer-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: .85rem;
}

.aivi-ai-note-draft-answer-grid strong {
  display: block;
  color: #0f172a;
  line-height: 1.5;
  font-size: .94rem;
  font-weight: 900;
  white-space: pre-wrap;
}

.aivi-ai-note-draft-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
  padding-top: .15rem;
}

.aivi-ai-note-draft-actions .aivi-btn[disabled] {
  cursor: not-allowed;
  opacity: .72;
}

.aivi-ai-note-draft-actions .aivi-btn[data-state="saved"] {
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.aivi-ai-note-draft-policy {
  border-top: 1px solid #e2e8f0;
  padding-top: .75rem;
  color: #64748b !important;
  font-size: .86rem;
  font-weight: 760;
}

.aivi-ai-note-list-card {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
  padding: 1.1rem;
}

.aivi-ai-note-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: .9rem;
}

.aivi-ai-note-list-head h2 {
  margin: .45rem 0 .25rem;
  color: #0f172a;
  font-size: 1.22rem;
  font-weight: 950;
}

.aivi-ai-note-list-head p {
  margin: 0;
  color: #475569;
  line-height: 1.62;
}

.aivi-ai-note-list-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  padding: .35rem .75rem;
  color: #1d4ed8;
  font-size: .82rem;
  font-weight: 950;
  white-space: nowrap;
}

.aivi-ai-note-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  padding: .35rem;
}

.aivi-ai-note-filter-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  padding: .45rem .9rem;
  color: #334155;
  font-size: .88rem;
  font-weight: 900;
  cursor: pointer;
}

.aivi-ai-note-filter-tab.is-active {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(29, 78, 216, .18);
}

.aivi-ai-note-list-status {
  color: #64748b;
  font-size: .88rem;
  font-weight: 800;
}

.aivi-ai-note-list-status[data-state="error"] {
  color: #b91c1c;
}

.aivi-ai-note-list-items {
  display: grid;
  gap: .75rem;
}

.aivi-ai-note-list-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 1rem;
  color: #64748b;
  font-weight: 800;
}

.aivi-ai-note-list-empty[hidden] {
  display: none;
}

.aivi-ai-note-list-item {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}

.aivi-ai-note-list-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  width: 100%;
  border: 0;
  background: #ffffff;
  padding: .9rem;
  text-align: left;
  cursor: pointer;
}

.aivi-ai-note-list-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  background: #ede9fe;
  padding: .3rem .7rem;
  color: #6d28d9;
  font-size: .78rem;
  font-weight: 950;
  white-space: nowrap;
}

.aivi-ai-note-list-item.is-wrong .aivi-ai-note-list-type {
  background: #fef2f2;
  color: #b91c1c;
}

.aivi-ai-note-list-item.is-correct .aivi-ai-note-list-type {
  background: #f0fdf4;
  color: #15803d;
}

.aivi-ai-note-list-item.is-review .aivi-ai-note-list-type {
  background: #fff7ed;
  color: #c2410c;
}

.aivi-ai-note-list-item.is-memory .aivi-ai-note-list-type {
  background: #eff6ff;
  color: #1d4ed8;
}

.aivi-ai-note-list-summary-body {
  display: grid;
  gap: .35rem;
  min-width: 0;
}

.aivi-ai-note-list-summary-body strong {
  color: #0f172a;
  font-size: .96rem;
  font-weight: 900;
  line-height: 1.45;
}

.aivi-ai-note-list-summary-body small,
.aivi-ai-note-list-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.aivi-ai-note-list-summary-body small span,
.aivi-ai-note-list-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #f1f5f9;
  padding: .2rem .55rem;
  color: #475569;
  font-size: .75rem;
  font-weight: 850;
}

.aivi-ai-note-list-open {
  color: #1d4ed8;
  font-size: .84rem;
  font-weight: 950;
  white-space: nowrap;
}

.aivi-ai-note-list-detail {
  display: grid;
  gap: .8rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: .95rem;
}

.aivi-ai-note-list-detail-section,
.aivi-ai-note-list-answer-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: .85rem;
}

.aivi-ai-note-list-detail-section span,
.aivi-ai-note-list-answer-grid span {
  display: block;
  margin-bottom: .35rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 900;
}

.aivi-ai-note-list-detail-section p,
.aivi-ai-note-list-answer-grid strong {
  margin: 0;
  color: #0f172a;
  font-size: .94rem;
  font-weight: 820;
  line-height: 1.58;
  white-space: pre-wrap;
}

.aivi-ai-note-list-choices {
  display: grid;
  gap: .45rem;
}

.aivi-ai-note-list-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: .65rem .75rem;
}

.aivi-ai-note-list-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: .8rem;
  font-weight: 900;
}

.aivi-ai-note-list-choice strong {
  color: #0f172a;
  font-size: .92rem;
  font-weight: 760;
}

.aivi-ai-note-list-answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.aivi-ai-note-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.aivi-ai-note-list-actions .aivi-btn[disabled] {
  cursor: not-allowed;
  opacity: .68;
}

.aivi-ai-note-integrated-status {
  margin: 0 0 .75rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: .75rem .9rem;
  color: #64748b;
  font-size: .86rem;
  font-weight: 850;
}

.aivi-ai-note-integrated-status[data-state="error"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.aivi-ai-note-integrated-list {
  display: grid;
  gap: .75rem;
  margin-bottom: .9rem;
}

.aivi-ai-note-integrated-card {
  border-color: #bfdbfe !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.aivi-ai-note-integrated-card .note-icon {
  background: #eff6ff;
  color: #1d4ed8;
}

.aivi-ai-note-integrated-card .review-badge {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.aivi-ai-note-integrated-card .review-badge-wrong {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.aivi-ai-note-integrated-card .review-badge-correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.aivi-ai-note-integrated-actions {
  justify-content: center;
}

.aivi-ai-note-disabled-action[disabled] {
  cursor: not-allowed;
  opacity: .72;
}

.aivi-ai-note-filter-panel {
  margin-top: 0;
}

.aivi-ai-note-filter-panel .aivi-ai-note-filter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.aivi-ai-note-filter-panel .review-workspace-main {
  min-width: 0;
}

/* Inline style block 1 from review.html line 9 */
  /* 정답노트가 별도 aivi-workspace로 렌더링되며 생기는 큰 공백 제거 */
  #correctNotePanel {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  #correctNotePanel.aivi-workspace {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #correctNotePanel .correct-note-shell {
    padding-top: 0 !important;
  }

  /* 오답/정답 탭 바로 아래에 패널이 붙도록 보정 */
  .review-note-tabs {
    margin-bottom: 1rem !important;
  }

  /* 정답노트 탭일 때도 기존 review-shell 폭 안에서 보이도록 */
  .review-shell > #correctNotePanel {
    width: 100%;
  }

  .review-page-shell {
    --review-gap: 1.25rem;
    --review-side-width: 330px;
    width: 100%;
    max-width: 1440px;
  }

  .review-tab-panel {
    width: 100%;
    min-width: 0;
  }

  .review-filter-shell {
    margin-bottom: 1.25rem;
  }

  #wrongNotePanel .review-legacy-category-panel,
  #correctNotePanel .review-legacy-category-panel {
    display: none !important;
  }

  .review-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--review-side-width, 330px);
    gap: var(--review-gap, 1.25rem);
    align-items: start;
    width: 100%;
    min-width: 0;
  }

  .review-workspace-main,
  .review-workspace-side {
    min-width: 0;
  }

  .review-page-shell.is-memory-mode .note-filter-shell {
    display: none;
  }

  @media (max-width: 1280px) {
    .review-workspace {
      grid-template-columns: 1fr;
    }
  }

/* Inline style block 2 from review.html line 37 */
  /* Note UI Recovery: preview 구조 우선 적용 */
  .note-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0;
  }

  .note-summary-card {
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    background: #fff;
    padding: .85rem;
    min-width: 0;
  }

  .note-summary-label {
    color: #64748b;
    font-size: .74rem;
    font-weight: 900;
  }

  .note-summary-value {
    margin-top: .2rem;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 950;
  }

  .note-summary-action {
    justify-content: center;
    margin-top: .7rem;
    width: 100%;
  }

  .note-basket-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    margin: 1rem 0 1.1rem;
    padding: .95rem 1rem;
    border-radius: 1.1rem;
    background: #020617;
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(2, 6, 23, .18);
  }

  .note-basket-bar-main {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
  }

  .note-basket-badge {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: .9rem;
    background: #ffffff;
    color: #020617;
    font-size: 1rem;
    font-weight: 950;
    flex: 0 0 auto;
  }

  .note-basket-copy {
    min-width: 0;
  }

  .note-basket-title {
    font-weight: 950;
    color: #ffffff;
  }

  .note-basket-sub {
    margin-top: .15rem;
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.55;
  }

  .note-basket-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .note-basket-actions .aivi-btn {
    white-space: nowrap;
  }

  .note-basket-actions .aivi-btn.note-basket-primary {
    background: #ffffff;
    color: #020617;
    border-color: #ffffff;
  }

  .review-shell #wrongNotePanel > main.review-panel,
  .correct-note-shell .correct-note-layout > main.review-panel {
    min-width: 0;
  }

  .review-shell #wrongNotePanel .review-card,
  .correct-note-shell .correct-note-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 260px 250px;
    align-items: center;
    gap: 18px;
    min-height: 154px;
    overflow: hidden;
    padding: 1rem;
  }

  .review-shell #wrongNotePanel .note-rank-wrap,
  .correct-note-shell .note-rank-wrap {
    min-height: 100px;
    border-right: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
    align-self: stretch;
  }

  .review-shell #wrongNotePanel .note-rank,
  .correct-note-shell .note-rank {
    font-size: 29px;
    font-weight: 950;
    line-height: 1;
  }

  .review-shell #wrongNotePanel .note-icon,
  .correct-note-shell .note-icon {
    width: 38px;
    height: 38px;
    margin-top: 10px;
    border-radius: 14px;
    font-size: 18px;
    display: grid;
    place-items: center;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 950;
  }

  .review-shell #wrongNotePanel .note-card-main,
  .correct-note-shell .note-card-main {
    min-width: 0;
    writing-mode: horizontal-tb;
  }

  .review-shell #wrongNotePanel .review-card-title,
  .correct-note-shell .correct-note-card-title {
    font-size: 20px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .review-shell #wrongNotePanel .review-card-summary,
  .correct-note-shell .correct-note-card-summary,
  .review-shell #wrongNotePanel .review-card-meta,
  .correct-note-shell .review-card-meta {
    min-width: 0;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    writing-mode: horizontal-tb;
  }

  .review-shell #wrongNotePanel .review-card-summary,
  .correct-note-shell .correct-note-card-summary {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.5;
    color: #0f172a;
  }

  .review-shell #wrongNotePanel .review-card-meta,
  .correct-note-shell .review-card-meta {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
    color: #64748b;
  }

  .review-shell #wrongNotePanel .review-badges,
  .correct-note-shell .review-badges {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .review-shell #wrongNotePanel .review-badge,
  .correct-note-shell .review-badge {
    font-size: 12px;
    height: 26px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
  }

  .review-shell #wrongNotePanel .note-metric-grid,
  .correct-note-shell .note-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    border-left: 1px solid #e2e8f0;
    padding-left: 18px;
    align-self: stretch;
    align-content: center;
  }

  .review-shell #wrongNotePanel .note-metric-card,
  .correct-note-shell .note-metric-card {
    min-height: 57px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    text-align: center;
  }

  .review-shell #wrongNotePanel .note-metric-label,
  .correct-note-shell .note-metric-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 950;
  }

  .review-shell #wrongNotePanel .note-metric-value,
  .correct-note-shell .note-metric-value {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 950;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .review-shell #wrongNotePanel .note-card-actions,
  .correct-note-shell .note-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border-left: 1px solid #e2e8f0;
    padding-left: 18px;
    align-self: stretch;
    align-content: center;
  }

  .review-shell #wrongNotePanel .note-card-actions .aivi-btn,
  .correct-note-shell .note-card-actions .aivi-btn {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .review-panel.review-detail-col,
  .review-panel.correct-note-detail-col {
    position: sticky;
    top: 14px;
    min-width: 0;
  }

  @media (max-width: 1280px) {
    .note-basket-bar {
      position: static;
    }

    .review-shell #wrongNotePanel.review-layout,
    .correct-note-shell .correct-note-layout {
      grid-template-columns: 220px minmax(0, 1fr);
    }

    .review-panel.review-detail-col,
    .review-panel.correct-note-detail-col {
      position: static;
      grid-column: 1 / -1;
    }

    .review-shell #wrongNotePanel .review-card,
    .correct-note-shell .correct-note-card {
      grid-template-columns: 60px minmax(0, 1fr);
      min-height: auto;
    }

    .review-shell #wrongNotePanel .note-metric-grid,
    .correct-note-shell .note-metric-grid,
    .review-shell #wrongNotePanel .note-card-actions,
    .correct-note-shell .note-card-actions {
      grid-column: 1 / -1;
      border-left: 0;
      border-top: 1px solid #e2e8f0;
      padding-left: 0;
      padding-top: 14px;
    }

    .review-shell #wrongNotePanel .review-card-title,
    .correct-note-shell .correct-note-card-title {
      white-space: normal;
    }
  }

  @media (max-width: 900px) {
    .review-page-header {
      align-items: stretch;
      padding: 1rem;
    }

    .review-page-header .exam-builder-actions {
      justify-content: stretch;
      width: 100%;
    }

    .review-page-header .exam-builder-btn {
      flex: 1 1 180px;
    }

    .note-summary-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-shell #wrongNotePanel.review-layout,
    .correct-note-shell .correct-note-layout {
      grid-template-columns: 1fr;
    }

    .review-shell #wrongNotePanel .review-card,
    .correct-note-shell .correct-note-card {
      grid-template-columns: 42px minmax(0, 1fr);
      padding: 14px;
    }

    .review-shell #wrongNotePanel .note-rank-wrap,
    .correct-note-shell .note-rank-wrap {
      min-height: auto;
      border-right: 0;
      padding-right: 0;
    }

    .review-shell #wrongNotePanel .note-card-actions,
    .correct-note-shell .note-card-actions {
      grid-template-columns: 1fr;
    }

    .note-basket-bar {
      flex-direction: column;
      align-items: stretch;
    }

    .note-basket-actions {
      justify-content: stretch;
    }
  }

/* Inline style block 3 from review.html line 404 */
  .review-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px 2rem;
  }

  .review-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
    padding: 1.15rem 1.25rem;
  }

  .review-page-header .exam-builder-title {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
  }

  .review-page-header .exam-builder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1d4ed8;
  }

  .review-page-header .exam-builder-icon svg {
    width: 21px;
    height: 21px;
  }

  .review-page-header h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 900;
    color: #0f172a;
  }

  .review-page-header p {
    margin-top: .35rem;
    color: #64748b;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.55;
  }

  .review-page-header .exam-builder-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
  }

  .review-page-header .exam-builder-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 40px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    padding: .58rem .88rem;
    color: #0f172a;
    font-size: .86rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
  }

  .review-page-header .exam-builder-btn:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
  }

  .review-page-header .exam-builder-btn svg {
    width: 16px;
    height: 16px;
  }

  .review-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 380px;
    gap: 1rem;
    align-items: start;
  }

  .review-panel {
    border: 1px solid #dbe3ef;
    border-radius: 1.1rem;
    background: #ffffff;
    padding: 1rem;
  }

  .review-panel-title {
    font-size: .95rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: .75rem;
  }

  .review-nav {
    display: flex;
    flex-direction: column;
    gap: .45rem;
  }

  .review-nav-btn {
    border: 1px solid transparent;
    background: transparent;
    border-radius: .8rem;
    padding: .7rem .75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #334155;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
  }

  .review-nav-btn:hover {
    background: #f8fafc;
    border-color: #dbe3ef;
  }

  .review-nav-btn.is-active {
    background: #0f172a;
    color: #ffffff;
  }

  .review-nav-count {
    font-size: .78rem;
    opacity: .8;
  }

  .review-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
  }

  .review-list-title {
    font-size: 1rem;
    font-weight: 900;
    color: #111827;
  }

  .review-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
  }

  .review-card {
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    background: #fff;
    padding: .95rem;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  }

  .review-card:hover {
    background: #f8fafc;
    border-color: #94a3b8;
  }

  .review-card.is-active {
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, .08);
  }

  .review-card.is-hidden {
    display: none;
  }

  .review-card-top {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: flex-start;
    margin-bottom: .45rem;
  }

  .review-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
  }

  .review-badge {
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: .16rem .52rem;
    font-size: .74rem;
    font-weight: 900;
  }

  .review-card-title {
    font-size: .98rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: .28rem;
  }

  .review-card-summary {
    color: #334155;
    line-height: 1.55;
    font-weight: 650;
  }

  .review-card-meta {
    margin-top: .35rem;
    color: #64748b;
    font-size: .86rem;
  }

  .review-detail-empty {
    border: 1px dashed #dbe3ef;
    background: #f8fafc;
    border-radius: .95rem;
    padding: 1rem;
    color: #64748b;
    line-height: 1.7;
  }

  .review-detail-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: .35rem;
  }

  .review-detail-sub {
    color: #64748b;
    margin-bottom: .9rem;
  }

  .review-box {
    border: 1px solid #dbe3ef;
    border-radius: .9rem;
    background: #f8fafc;
    padding: .8rem .9rem;
    margin-bottom: .65rem;
  }

  .review-label {
    color: #64748b;
    font-size: .78rem;
    font-weight: 900;
    margin-bottom: .22rem;
  }

  .review-value {
    color: #111827;
    line-height: 1.6;
    font-weight: 700;
  }

  .review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .9rem;
  }

  .review-ai-box {
    margin-top: .85rem;
    border: 1px solid #dbe3ef;
    border-radius: .9rem;
    background: #f8fafc;
    padding: .9rem;
  }

  .review-ai-title {
    font-weight: 900;
    color: #111827;
    margin-bottom: .35rem;
  }

  .review-ai-body {
    color: #475569;
    line-height: 1.7;
  }

  .review-side-note {
    border: 1px dashed #dbe3ef;
    border-radius: .95rem;
    background: #f8fafc;
    padding: .9rem;
    color: #64748b;
    line-height: 1.7;
    margin-top: 1rem;
  }

  @media (max-width: 1180px) {
    .review-layout {
      grid-template-columns: 200px minmax(0, 1fr);
    }

    .review-detail-col {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 820px) {
    .review-layout {
      grid-template-columns: 1fr;
    }
  }

  .review-retry-box {
    margin-top: .85rem;
    border: 1px solid #dbe3ef;
    border-radius: .9rem;
    background: #f8fafc;
    padding: .9rem;
  }

  .review-retry-title {
    font-weight: 900;
    color: #111827;
    margin-bottom: .55rem;
  }

  .review-retry-choice-list {
    display: flex;
    flex-direction: column;
    gap: .45rem;
  }

  .review-retry-choice {
    border: 1px solid #dbe3ef;
    border-radius: .75rem;
    background: #ffffff;
    padding: .62rem .7rem;
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    cursor: pointer;
  }

  .review-retry-choice:hover {
    border-color: #94a3b8;
    background: #f8fafc;
  }

  .review-retry-choice input {
    margin-top: .25rem;
  }

  .review-retry-choice-text {
    color: #111827;
    font-weight: 650;
    line-height: 1.55;
  }

  .review-retry-result {
    margin-top: .7rem;
    line-height: 1.7;
    font-size: .93rem;
  }

  .review-detail-choice-list {
    display: flex;
    flex-direction: column;
    gap: .45rem;
  }

  .review-detail-choice {
    border: 1px solid #dbe3ef;
    border-radius: .75rem;
    background: #ffffff;
    padding: .6rem .75rem;
  }

  .review-detail-choice.is-correct {
    border-color: #16a34a;
    background: #f0fdf4;
  }

  .review-detail-choice.is-mine {
    border-color: #111827;
    background: #f8fafc;
  }

  .review-detail-choice-meta {
    font-size: .78rem;
    color: #64748b;
    font-weight: 900;
    margin-bottom: .2rem;
  }

  .review-detail-choice-text {
    color: #111827;
    font-weight: 700;
    line-height: 1.55;
  }

  .review-note-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    width: 100%;
    border: 1px solid #dbe3ef;
    background: #fff;
    border-radius: 999px;
    padding: .28rem;
    margin: 0 0 1.1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
  }

  .review-note-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 999px;
    padding: .65rem 1rem;
    font-size: .88rem;
    font-weight: 900;
    color: #475569;
    cursor: pointer;
  }

  .review-note-tab.is-active {
    border-color: #0f172a;
    background: #0f172a;
    color: #ffffff;
  }

  .aivi-ai-note-tab-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.05rem 1.15rem;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
  }

  .aivi-ai-note-tab-intro h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.18rem;
    font-weight: 950;
    letter-spacing: 0;
  }

  .aivi-ai-note-tab-intro p {
    margin: .35rem 0 0;
    color: #64748b;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.6;
  }

  .aivi-ai-note-tab-intro span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    padding: .35rem .75rem;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 950;
    white-space: nowrap;
  }

  .review-page-shell .note-summary-grid {
    margin: 0 0 1rem;
  }

  .note-search-bar {
    margin: 1rem 0;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
    padding: 1rem;
    display: grid;
    gap: .85rem;
  }

  .note-search-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .55rem;
    align-items: center;
  }

  .note-search-input {
    min-width: 0;
    width: 100%;
    height: 40px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: .9rem;
    font-weight: 800;
    padding: 0 .85rem;
    outline: none;
  }

  .note-search-input:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .08);
    background: #fff;
  }

  .note-search-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
  }

  .note-search-filters label {
    min-width: 0;
    display: grid;
    gap: .3rem;
    color: #64748b;
    font-size: .74rem;
    font-weight: 950;
  }

  .note-search-filters select {
    min-width: 0;
    width: 100%;
    height: 38px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: .84rem;
    font-weight: 850;
    padding: 0 .7rem;
  }

  .note-search-result {
    color: #64748b;
    font-size: .82rem;
    font-weight: 850;
  }

  .note-search-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: .9rem;
    font-weight: 850;
    padding: 1rem;
    text-align: center;
  }

  .review-card.is-search-hidden,
  .correct-note-card.is-search-hidden {
    display: none !important;
  }

  .correct-note-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
  }

  .correct-note-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 380px;
    gap: 1rem;
    align-items: start;
  }

  .correct-note-card {
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    background: #fff;
    padding: .95rem;
    cursor: pointer;
  }

  .correct-note-card:hover {
    background: #f8fafc;
    border-color: #94a3b8;
  }

  .correct-note-card.is-active {
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, .08);
  }

  .correct-note-card-title {
    font-weight: 900;
    color: #111827;
    margin-bottom: .35rem;
  }

  .correct-note-card-summary {
    color: #334155;
    font-weight: 650;
    line-height: 1.6;
  }

  .correct-note-empty {
    border: 1px dashed #dbe3ef;
    background: #f8fafc;
    border-radius: .95rem;
    padding: 1rem;
    color: #64748b;
    line-height: 1.7;
  }

  @media (max-width: 1180px) {
    .correct-note-layout {
      grid-template-columns: 200px minmax(0, 1fr);
    }

    .correct-note-detail-col {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 820px) {
    .correct-note-layout {
      grid-template-columns: 1fr;
    }
  }

  /* Review page layout baseline retained for migrated note sections. */
  .review-shell {
    max-width: 1440px;
    padding: 0 16px 2.5rem;
  }

  .review-shell *,
  .review-shell *::before,
  .review-shell *::after {
    box-sizing: border-box;
  }

  .note-basket-bar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    margin: 1rem 0 1.1rem;
    padding: .95rem 1rem;
    border-radius: 18px;
    background: #020617;
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(2, 6, 23, .18);
  }

  .note-basket-bar-main {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
  }

  .note-basket-badge {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: .9rem;
    background: #ffffff;
    color: #020617;
    font-size: 1rem;
    font-weight: 950;
    flex: 0 0 auto;
  }

  .note-basket-copy {
    min-width: 0;
  }

  .note-basket-title {
    color: #ffffff;
    font-weight: 950;
  }

  .note-basket-sub {
    margin-top: .15rem;
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.55;
  }

  .note-basket-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .note-basket-actions .aivi-btn {
    white-space: nowrap;
  }

  .note-basket-actions .aivi-btn.note-basket-primary {
    background: #ffffff;
    color: #020617;
    border-color: #ffffff;
  }

  .review-shell #wrongNotePanel.review-layout,
  .review-shell #correctNotePanel .correct-note-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 1.25rem;
    align-items: start;
  }

  .review-shell #wrongNotePanel.review-layout > aside:first-child,
  .review-shell #correctNotePanel .correct-note-layout > aside:first-child {
    display: none;
  }

  .review-shell #wrongNotePanel > main.review-panel,
  .review-shell #correctNotePanel .correct-note-layout > main.review-panel {
    min-width: 0;
    overflow: hidden;
  }

  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 226px;
    align-items: center;
    gap: 16px;
    min-height: 150px;
    max-height: 190px;
    min-width: 0;
    overflow: hidden;
    padding: 15px 16px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
  }

  .review-shell #wrongNotePanel .note-rank-wrap,
  .review-shell #correctNotePanel .note-rank-wrap {
    min-height: 118px;
    align-self: stretch;
    display: grid;
    place-items: center;
    border-right: 1px solid #e2e8f0;
    min-width: 0;
  }

  .review-shell #wrongNotePanel .note-rank,
  .review-shell #correctNotePanel .note-rank {
    color: #020617;
    font-size: 29px;
    font-weight: 950;
    line-height: 1;
    text-align: center;
  }

  .review-shell #wrongNotePanel .note-icon,
  .review-shell #correctNotePanel .note-icon {
    width: 38px;
    height: 38px;
    margin: 10px auto 0;
    border-radius: 14px;
    font-size: 18px;
  }

  .review-shell #wrongNotePanel .note-card-main,
  .review-shell #correctNotePanel .note-card-main,
  .review-shell #wrongNotePanel .review-card-summary,
  .review-shell #correctNotePanel .correct-note-card-summary,
  .review-shell #wrongNotePanel .review-card-meta,
  .review-shell #correctNotePanel .review-card-meta {
    min-width: 0;
    max-width: 100%;
    writing-mode: horizontal-tb;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .review-shell #wrongNotePanel .review-card-title,
  .review-shell #correctNotePanel .correct-note-card-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    margin-top: 7px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 950;
  }

  .review-shell #wrongNotePanel .review-card-summary,
  .review-shell #correctNotePanel .correct-note-card-summary {
    display: -webkit-box;
    margin-top: 4px;
    max-height: 3em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #0f172a;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.5;
  }

  .review-shell #wrongNotePanel .review-card-meta,
  .review-shell #correctNotePanel .review-card-meta {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
  }

  .review-shell #wrongNotePanel .note-card-main .aivi-wrong-card-meta-v133,
  .review-shell #correctNotePanel .note-card-main .aivi-wrong-card-meta-v133 {
    margin-top: 6px;
    padding-top: 0;
    border-top: 0;
  }

  .review-shell #wrongNotePanel .note-card-main .aivi-wrong-card-tags-v133,
  .review-shell #correctNotePanel .note-card-main .aivi-wrong-card-tags-v133 {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .review-shell #wrongNotePanel .note-card-main .aivi-wrong-card-tag-v133,
  .review-shell #correctNotePanel .note-card-main .aivi-wrong-card-tag-v133 {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    height: 24px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
  }

  .review-shell #wrongNotePanel .note-card-main .aivi-wrong-card-note-v133,
  .review-shell #correctNotePanel .note-card-main .aivi-wrong-card-note-v133,
  .review-shell .note-card-memo-summary {
    display: -webkit-box;
    margin-top: 7px;
    max-height: 3.9em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 11px;
    background: #f8fafc;
    padding: 7px 9px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .review-shell .note-card-memo-summary strong,
  .review-shell #wrongNotePanel .note-card-main .aivi-wrong-card-note-v133 strong,
  .review-shell #correctNotePanel .note-card-main .aivi-wrong-card-note-v133 strong {
    color: #111827;
    font-weight: 950;
  }

  .review-shell #wrongNotePanel .review-badges,
  .review-shell #correctNotePanel .review-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 0;
    max-height: 58px;
    overflow: hidden;
  }

  .review-shell #wrongNotePanel .review-badge,
  .review-shell #correctNotePanel .review-badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
  }

  .review-shell #wrongNotePanel .note-metric-grid,
  .review-shell #correctNotePanel .note-metric-grid {
    grid-column: 2 / 3;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin-top: 8px;
    border-left: 0;
    padding-left: 0;
  }

  .review-shell #wrongNotePanel .note-metric-card,
  .review-shell #correctNotePanel .note-metric-card {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 26px;
    max-width: 100%;
    padding: 0 9px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
  }

  .review-shell #wrongNotePanel .note-metric-card::after,
  .review-shell #correctNotePanel .note-metric-card::after {
    content: "";
    display: none;
  }

  .review-shell #wrongNotePanel .note-metric-label,
  .review-shell #correctNotePanel .note-metric-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
  }

  .review-shell #wrongNotePanel .note-metric-value,
  .review-shell #correctNotePanel .note-metric-value {
    margin-top: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 950;
  }

  .review-shell #wrongNotePanel .note-card-actions,
  .review-shell #correctNotePanel .note-card-actions {
    grid-column: 3 / 4;
    grid-row: 1 / span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    align-self: stretch;
    align-content: center;
    min-width: 0;
    width: 226px;
    border-left: 1px solid #e2e8f0;
    padding-left: 14px;
  }

  .review-shell #wrongNotePanel .note-card-actions .aivi-btn,
  .review-shell #correctNotePanel .note-card-actions .aivi-btn {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 9px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

.review-shell .review-panel.review-detail-col,
.review-shell .review-panel.correct-note-detail-col {
  position: sticky;
  top: 14px;
  min-width: 0;
  transition: margin-top .16s ease;
}

  @media (max-width: 1280px) {
    .note-basket-bar {
      position: static;
    }

    .review-shell #wrongNotePanel.review-layout,
    .review-shell #correctNotePanel .correct-note-layout {
      grid-template-columns: minmax(0, 1fr);
    }

    .review-shell .review-panel.review-detail-col,
    .review-shell .review-panel.correct-note-detail-col {
      position: static;
      grid-column: 1 / -1;
    }

    .review-shell #wrongNotePanel .review-card,
    .review-shell #correctNotePanel .correct-note-card {
      grid-template-columns: 60px minmax(0, 1fr);
      min-height: auto;
    }

    .review-shell #wrongNotePanel .note-metric-grid,
    .review-shell #correctNotePanel .note-metric-grid {
      grid-column: 1 / -1;
      border-left: 0;
      border-top: 1px solid #e2e8f0;
      padding-left: 0;
      padding-top: 14px;
    }

    .review-shell #wrongNotePanel .note-card-actions,
    .review-shell #correctNotePanel .note-card-actions {
      grid-column: 1 / -1;
      grid-row: auto;
      border-left: 0;
      border-top: 1px solid #e2e8f0;
      padding-left: 0;
      padding-top: 14px;
      width: 100%;
    }

    .review-shell #wrongNotePanel .review-card-title,
    .review-shell #correctNotePanel .correct-note-card-title {
      white-space: normal;
    }
  }

  @media (max-width: 900px) {
    .note-summary-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-filter-bar {
      grid-template-columns: minmax(0, 1fr);
    }

    .review-shell #wrongNotePanel .review-card,
    .review-shell #correctNotePanel .correct-note-card {
      grid-template-columns: 42px minmax(0, 1fr);
      padding: 14px;
    }

    .review-shell #wrongNotePanel .note-rank-wrap,
    .review-shell #correctNotePanel .note-rank-wrap {
      min-height: auto;
      border-right: 0;
    }

    .review-shell #wrongNotePanel .note-card-actions,
    .review-shell #correctNotePanel .note-card-actions {
      grid-template-columns: minmax(0, 1fr);
    }

    .note-basket-bar {
      flex-direction: column;
      align-items: stretch;
    }

    .note-basket-actions {
      justify-content: stretch;
    }
  }

  /* Legacy compact-card stability rules retained for compatibility. */
  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 226px;
    gap: 16px;
    align-items: stretch;
    min-height: 164px;
    max-height: none;
    overflow: visible;
  }

  .review-shell #wrongNotePanel .note-rank-wrap,
  .review-shell #correctNotePanel .note-rank-wrap,
  .review-shell #wrongNotePanel .note-card-main,
  .review-shell #correctNotePanel .note-card-main,
  .review-shell #wrongNotePanel .note-metric-grid,
  .review-shell #correctNotePanel .note-metric-grid,
  .review-shell #wrongNotePanel .note-card-actions,
  .review-shell #correctNotePanel .note-card-actions {
    min-width: 0;
  }

  .review-shell #wrongNotePanel .note-card-main,
  .review-shell #correctNotePanel .note-card-main {
    align-self: start;
    display: flex;
    min-height: 0;
    flex-direction: column;
    justify-content: flex-start;
  }

  .review-shell #wrongNotePanel .review-card-summary,
  .review-shell #correctNotePanel .correct-note-card-summary,
  .review-shell #wrongNotePanel .review-card-meta,
  .review-shell #correctNotePanel .review-card-meta,
  .review-shell #wrongNotePanel .note-card-main .aivi-wrong-card-note-v133,
  .review-shell #correctNotePanel .note-card-main .aivi-wrong-card-note-v133,
  .review-shell .note-card-memo-summary {
    writing-mode: horizontal-tb;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .review-shell #wrongNotePanel .note-card-main .aivi-wrong-card-note-v133,
  .review-shell #correctNotePanel .note-card-main .aivi-wrong-card-note-v133,
  .review-shell .note-card-memo-summary {
    flex: 0 0 auto;
    max-height: 3.35em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .review-shell #wrongNotePanel .note-card-memo-summary,
  .review-shell #correctNotePanel .note-card-memo-summary {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    margin-top: 8px;
    max-height: 3.35em;
  }

  .review-shell #wrongNotePanel .note-metric-grid,
  .review-shell #correctNotePanel .note-metric-grid {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    align-self: end;
    margin-top: 9px;
    overflow: hidden;
  }

  .review-shell #wrongNotePanel .note-card-actions,
  .review-shell #correctNotePanel .note-card-actions {
    grid-column: 3 / 4;
    grid-row: 1 / span 3;
    align-self: stretch;
    align-content: center;
    width: 226px;
    max-width: 226px;
    overflow: hidden;
  }

  .review-shell #wrongNotePanel .note-card-actions .aivi-btn,
  .review-shell #correctNotePanel .note-card-actions .aivi-btn {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  @media (max-width: 1280px) {
    .review-shell #wrongNotePanel .review-card,
    .review-shell #correctNotePanel .correct-note-card {
      grid-template-columns: 60px minmax(0, 1fr);
      overflow: visible;
    }

    .review-shell #wrongNotePanel .note-card-actions,
    .review-shell #correctNotePanel .note-card-actions {
      grid-column: 1 / -1;
      grid-row: auto;
      width: 100%;
      max-width: none;
    }
  }

  @media (max-width: 900px) {
    .review-shell #wrongNotePanel .review-card,
    .review-shell #correctNotePanel .correct-note-card {
      grid-template-columns: 42px minmax(0, 1fr);
    }
  }

/* Inline style block 4 from review.html line 3226 */
  #wrongNotePanel .review-card.is-hidden {
    display: none !important;
  }

/* Inline style block 5 from review.html line 3659 */
  #correctNotePanel .correct-note-card.is-hidden {
    display: none !important;
  }

/* Inline style block 6 from review.html line 4331 */
  .aivi-wrong-meta-v133-mount {
    margin-top: .75rem;
    margin-bottom: .75rem;
  }

  .aivi-wrong-meta-v133-wrap {
    border: 1px solid #dbe3ef;
    border-radius: .95rem;
    background: #ffffff;
    padding: .9rem;
  }

  .aivi-wrong-meta-v133-title {
    font-size: .95rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: .25rem;
  }

  .aivi-wrong-meta-v133-sub {
    color: #64748b;
    font-size: .82rem;
    line-height: 1.55;
    margin-bottom: .65rem;
  }

  .aivi-wrong-meta-v133-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .65rem;
  }

  .aivi-wrong-meta-v133-tag {
    border: 1px solid #dbe3ef;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: .28rem .55rem;
    font-size: .76rem;
    font-weight: 900;
  }

  .aivi-wrong-meta-v133-tag.empty {
    background: #f8fafc;
    color: #64748b;
  }

  .aivi-wrong-meta-v133-reason {
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    border-radius: .8rem;
    padding: .65rem .75rem;
    color: #475569;
    font-size: .82rem;
    line-height: 1.6;
    margin-bottom: .75rem;
  }

  .aivi-wrong-meta-v133-note-label {
    font-size: .78rem;
    font-weight: 900;
    color: #64748b;
    margin-bottom: .35rem;
  }

  .aivi-wrong-meta-v133-note {
    width: 100%;
    min-height: 76px;
    border: 1px solid #dbe3ef;
    border-radius: .8rem;
    padding: .65rem .75rem;
    color: #111827;
    font-size: .9rem;
    line-height: 1.55;
    resize: vertical;
    outline: none;
  }

  .aivi-wrong-meta-v133-note:focus {
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, .08);
  }

  .aivi-wrong-meta-v133-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .65rem;
  }

  .aivi-wrong-meta-v133-btn {
    border: 0;
    background: #0f172a;
    color: #ffffff;
    border-radius: .7rem;
    padding: .55rem .85rem;
    font-size: .82rem;
    font-weight: 900;
    cursor: pointer;
  }

  .aivi-wrong-meta-v133-btn.secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #dbe3ef;
  }

  .aivi-wrong-meta-v133-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
  }

  .aivi-wrong-meta-v133-status {
    margin-top: .55rem;
    font-size: .82rem;
    font-weight: 800;
    color: #64748b;
  }

  .aivi-wrong-meta-v133-status.ok {
    color: #15803d;
  }

  .aivi-wrong-meta-v133-status.error {
    color: #dc2626;
  }

  .review-card > .aivi-meta-v9-card-badges,
  .review-card > .aivi-wrong-card-meta-v13,
  .review-card > .aivi-wrong-card-meta-v131,
  .review-card > .aivi-wrong-card-meta-v132,
  .review-card > .aivi-wrong-card-meta-v133,
  .correct-note-card > .aivi-wrong-card-meta-v133 {
    display: none !important;
  }

  .aivi-wrong-card-meta-v133 {
    margin-top: .7rem;
    padding-top: .55rem;
    border-top: 1px dashed rgba(148, 163, 184, .45);
  }

  .aivi-wrong-card-tags-v133 {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
  }

  .aivi-wrong-card-tag-v133 {
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: .72rem;
    font-weight: 900;
    padding: .18rem .48rem;
  }

  .aivi-wrong-card-note-v133 {
    margin-top: .42rem;
    color: #475569;
    font-size: .78rem;
    line-height: 1.5;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: .7rem;
    padding: .45rem .55rem;
  }

  .aivi-wrong-card-note-v133 strong {
    color: #111827;
  }

/* Inline style block 7 from review.html line 5093 */
  #btnReviewReopenLegacy {
    display: none !important;
  }

  #btnReviewToggleComplete.is-completed {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
  }

  #btnReviewToggleComplete:disabled {
    opacity: .55;
    cursor: not-allowed;
  }

  #reviewCompleteFeedback.aivi-ok,
  #detailFeedback.aivi-ok {
    color: #15803d;
    font-weight: 800;
  }

  #reviewCompleteFeedback.aivi-error,
  #detailFeedback.aivi-error {
    color: #dc2626;
    font-weight: 800;
  }

/* Legacy compact-card rules retained below the migrated layout block. */
.review-shell #wrongNotePanel .review-card,
.review-shell #correctNotePanel .correct-note-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 226px;
  gap: 16px;
  align-items: stretch;
  overflow: hidden;
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.review-shell #wrongNotePanel .review-card:hover,
.review-shell #correctNotePanel .correct-note-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
  transform: translateY(-1px);
}

.review-shell #wrongNotePanel .review-card.is-active,
.review-shell #correctNotePanel .correct-note-card.is-active {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12), 0 14px 34px rgba(15, 23, 42, .07);
}

.review-shell #wrongNotePanel .note-rank-wrap,
.review-shell #correctNotePanel .note-rank-wrap {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #e2e8f0;
  padding-right: 12px;
  display: grid;
  place-items: center;
  align-self: stretch;
}

.review-shell #wrongNotePanel .note-rank,
.review-shell #correctNotePanel .note-rank {
  color: #0f172a;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.review-shell #wrongNotePanel .note-icon,
.review-shell #correctNotePanel .note-icon {
  width: 38px;
  height: 38px;
  margin: 10px auto 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.review-shell #wrongNotePanel .note-card-main,
.review-shell #correctNotePanel .note-card-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto auto;
  align-content: center;
  gap: 7px;
  writing-mode: horizontal-tb;
}

.review-shell #wrongNotePanel .note-card-question-row,
.review-shell #correctNotePanel .note-card-question-row {
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow: hidden;
  writing-mode: horizontal-tb;
}

.review-shell #wrongNotePanel .review-card-top,
.review-shell #correctNotePanel .review-card-top {
  min-width: 0;
  margin: 0;
}

.review-shell #wrongNotePanel .review-badges,
.review-shell #correctNotePanel .review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 58px;
  margin: 0;
  overflow: hidden;
}

.review-shell #wrongNotePanel .review-badge,
.review-shell #correctNotePanel .review-badge {
  max-width: 160px;
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-shell #wrongNotePanel .review-card-title,
.review-shell #correctNotePanel .correct-note-card-title {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.32;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-shell #wrongNotePanel .review-card-summary,
.review-shell #correctNotePanel .correct-note-card-summary {
  min-width: 0;
  margin: 2px 0 0;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-shell #wrongNotePanel .review-card-meta,
.review-shell #correctNotePanel .review-card-meta {
  min-width: 0;
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-shell #wrongNotePanel .note-metric-grid,
.review-shell #correctNotePanel .note-metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.review-shell #wrongNotePanel .note-metric-card,
.review-shell #correctNotePanel .note-metric-card {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 24px;
  max-width: 170px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}

.review-shell #wrongNotePanel .note-metric-label,
.review-shell #correctNotePanel .note-metric-label,
.review-shell #wrongNotePanel .note-metric-value,
.review-shell #correctNotePanel .note-metric-value {
  min-width: 0;
  margin: 0;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-shell #wrongNotePanel .note-metric-label,
.review-shell #correctNotePanel .note-metric-label {
  color: #64748b;
  font-weight: 950;
}

.review-shell #wrongNotePanel .note-metric-value,
.review-shell #correctNotePanel .note-metric-value {
  color: #0f172a;
  font-weight: 950;
}

.review-shell #wrongNotePanel .note-card-memo-summary,
.review-shell #correctNotePanel .note-card-memo-summary {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  max-height: 3.15em;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-shell #wrongNotePanel .note-card-memo-summary.is-empty,
.review-shell #correctNotePanel .note-card-memo-summary.is-empty {
  background: #fbfdff;
  color: #94a3b8;
  font-weight: 750;
}

.review-shell #wrongNotePanel .note-card-memo-row,
.review-shell #correctNotePanel .note-card-memo-row {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  align-self: stretch;
  grid-row: 4;
}

.review-shell #wrongNotePanel .note-card-memo-editor,
.review-shell #correctNotePanel .note-card-memo-editor {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  gap: 8px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}

.review-shell #wrongNotePanel .note-card-memo-editor textarea,
.review-shell #correctNotePanel .note-card-memo-editor textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 72px;
  max-height: 120px;
  box-sizing: border-box;
  overflow: auto;
  resize: vertical;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
  padding: 8px 10px;
  outline: none;
}

.review-shell #wrongNotePanel .note-card-memo-editor textarea:focus,
.review-shell #correctNotePanel .note-card-memo-editor textarea:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .08);
  background: #fff;
}

.review-shell #wrongNotePanel .note-card-memo-editor-actions,
.review-shell #correctNotePanel .note-card-memo-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  flex-wrap: nowrap;
}

.review-shell #wrongNotePanel .note-card-memo-editor-actions .aivi-btn,
.review-shell #correctNotePanel .note-card-memo-editor-actions .aivi-btn {
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.review-shell #wrongNotePanel .note-card-memo-feedback,
.review-shell #correctNotePanel .note-card-memo-feedback {
  min-height: 1em;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.review-shell #wrongNotePanel .note-card-actions,
.review-shell #correctNotePanel .note-card-actions {
  min-width: 0;
  width: 226px;
  max-width: 226px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-self: stretch;
  align-content: center;
  border-left: 1px solid #e2e8f0;
  padding-left: 14px;
  overflow: hidden;
}

.review-shell #wrongNotePanel .note-card-actions .aivi-btn,
.review-shell #correctNotePanel .note-card-actions .aivi-btn {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1280px) {
  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .review-shell #wrongNotePanel .note-card-actions,
  .review-shell #correctNotePanel .note-card-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
    padding-left: 0;
    padding-top: 12px;
  }
}

@media (max-width: 900px) {
  .note-search-input-wrap,
  .note-search-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 14px;
  }

  .review-shell #wrongNotePanel .note-rank-wrap,
  .review-shell #correctNotePanel .note-rank-wrap {
    border-right: 0;
    padding-right: 0;
  }

  .review-shell #wrongNotePanel .note-card-actions,
  .review-shell #correctNotePanel .note-card-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Memory mode UI-only panel. Isolated from review/correct note card actions. */
.memory-mode-panel {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: #0f172a;
}

.memory-mode-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}

.memory-mode-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0;
}

.memory-mode-head p {
  margin: .25rem 0 0;
  color: #64748b;
  font-size: .9rem;
  line-height: 1.55;
}

.memory-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1rem;
}

.memory-summary-card,
.memory-filter-bar,
.memory-card,
.memory-side-box {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.memory-summary-card {
  min-width: 0;
  padding: 13px 16px;
}

.memory-summary-card span,
.memory-card-field span,
.memory-card-type,
.memory-side-box h3,
.memory-progress dt {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.memory-summary-card strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.memory-filter-bar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(150px, .32fr) minmax(150px, .32fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 12px;
}

.memory-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.memory-filter,
.memory-filter-select,
.memory-filter-search,
.memory-action,
.memory-quick-actions button {
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.memory-filter,
.memory-action,
.memory-quick-actions button {
  min-height: 36px;
  padding: 0 11px;
  cursor: pointer;
}

.memory-filter.is-active,
.memory-filter[aria-pressed="true"] {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.memory-filter-select,
.memory-filter-search {
  width: 100%;
  height: 38px;
  padding: 0 12px;
}

.memory-mode-layout {
  width: 100%;
  min-width: 0;
}

.memory-card {
  min-width: 0;
  padding: 18px;
}

.memory-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.memory-card-top h3 {
  margin: 6px 0 0;
  color: #0f172a;
  font-size: 1.18rem;
  line-height: 1.35;
  font-weight: 950;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.memory-card-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  padding: 8px 12px;
}

.memory-card-desc {
  margin: 0 0 14px;
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.memory-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 12px;
}

.memory-card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  padding: 0 9px;
}

.memory-choice-box {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 11px 12px;
}

.memory-choice-box > span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.memory-choice-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.memory-choice-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px;
}

.memory-choice-no {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 950;
}

.memory-choice-text {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.memory-choice-item.is-correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.memory-choice-item.is-correct .memory-choice-no {
  background: #dcfce7;
  color: #166534;
}

.memory-choice-item.is-selected-wrong {
  border-color: #fed7aa;
  background: #fff7ed;
}

.memory-choice-item.is-selected-wrong .memory-choice-no {
  background: #ffedd5;
  color: #9a3412;
}

.memory-card-field {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 11px 12px;
}

.memory-card-field strong,
.memory-card-field p {
  display: block;
  margin: 6px 0 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.55;
}

.memory-answer-box.is-visible,
.memory-explanation-box.is-visible {
  border-color: #94a3b8;
  background: #ffffff;
}

.memory-card-empty {
  margin-top: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 18px;
  color: #475569;
  line-height: 1.7;
}

.memory-card-empty strong {
  color: #0f172a;
}

.memory-card-empty p {
  margin: 6px 0 0;
}

.memory-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.memory-action-row {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.memory-action-row-main {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.memory-action-row-result {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.memory-action-row-flags {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memory-action {
  width: 100%;
}

.memory-action.is-active {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.memory-action.is-result-active {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, .18);
}

.memory-action-known {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.memory-action-unsure {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.memory-action-unknown {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.memory-card-state {
  min-height: 20px;
  margin-top: 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
}

.memory-result-panel {
  margin-top: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
}

.memory-result-title {
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.memory-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.memory-result-grid div {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.memory-result-grid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.memory-result-grid strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
}

.memory-result-panel p {
  margin: 10px 0 0;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.memory-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.memory-result-actions button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.memory-side-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.memory-side-box {
  padding: 16px;
}

.memory-side-box h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
}

.memory-progress {
  display: grid;
  gap: 8px;
  margin: 0;
}

.memory-progress div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px 11px;
}

.memory-progress dd {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.memory-submit-button {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid #0f172a;
  border-radius: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
}

.memory-submit-button:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

.memory-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.memory-quick-actions button.is-active {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.memory-quick-actions .memory-quick-flag {
  border-color: #cbd5e1;
  background: #f8fafc;
}

@media (max-width: 1280px) {
  .memory-mode-layout,
  .memory-filter-bar {
    grid-template-columns: 1fr;
  }

  .memory-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .memory-summary-grid,
  .memory-result-grid,
  .memory-result-actions,
  .memory-quick-actions {
    grid-template-columns: 1fr;
  }

  .memory-action-row-main,
  .memory-action-row-result,
  .memory-action-row-flags {
    grid-template-columns: 1fr;
  }

  .memory-card {
    padding: 18px;
  }

  .memory-card-top {
    display: grid;
  }
}

/* =========================================================
   Review final compact card styles
   =========================================================
   Active source of truth for review card layout.
*/

.review-shell #correctNotePanel .correct-note-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.review-shell #wrongNotePanel .review-card,
.review-shell #correctNotePanel .correct-note-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 248px 218px;
  gap: 10px;
  align-items: start;
  box-sizing: border-box;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  overflow: hidden;
}

.review-shell #wrongNotePanel .review-card:hover,
.review-shell #correctNotePanel .correct-note-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  transform: translateY(-1px);
}

.review-shell #wrongNotePanel .review-card.is-active,
.review-shell #correctNotePanel .correct-note-card.is-active {
  border-color: #020617;
  box-shadow: 0 0 0 3px rgba(2, 6, 23, .08), 0 12px 26px rgba(15, 23, 42, .065);
}

.review-shell #wrongNotePanel .note-rank-wrap,
.review-shell #correctNotePanel .note-rank-wrap {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border-right: 1px solid #e2e8f0;
  padding: 0 10px 0 0;
  margin: 0;
}

.review-shell .note-rank-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
}

.review-shell #wrongNotePanel .note-rank,
.review-shell #correctNotePanel .note-rank {
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  color: #020617;
}

.review-shell #wrongNotePanel .note-icon,
.review-shell #correctNotePanel .note-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 7px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.review-shell #wrongNotePanel .note-card-main,
.review-shell #correctNotePanel .note-card-main {
  grid-column: 2 / 3;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: start;
  padding: 0;
  margin: 0;
}

.review-shell #wrongNotePanel .note-card-question-row,
.review-shell #correctNotePanel .note-card-question-row {
  display: block;
  min-width: 0;
}

.review-shell #wrongNotePanel .review-badges,
.review-shell #correctNotePanel .review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 22px;
  margin-bottom: 1px;
  overflow: hidden;
}

.review-shell #wrongNotePanel .review-badge,
.review-shell #correctNotePanel .review-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.review-shell #wrongNotePanel .review-card-title,
.review-shell #correctNotePanel .correct-note-card-title {
  margin: 0 0 2px;
  color: #020617;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-shell #wrongNotePanel .review-card-summary,
.review-shell #correctNotePanel .correct-note-card-summary {
  display: -webkit-box;
  margin: 0 0 2px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.38;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.review-shell #wrongNotePanel .review-card-meta,
.review-shell #correctNotePanel .review-card-meta {
  margin: 0;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.3;
}

.review-shell #wrongNotePanel .note-answer-preview,
.review-shell #correctNotePanel .note-answer-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin-top: 4px;
  min-width: 0;
}

.review-shell #wrongNotePanel .note-answer-preview > div,
.review-shell #correctNotePanel .note-answer-preview > div {
  min-width: 0;
  padding: 3px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-shell #wrongNotePanel .note-answer-correct,
.review-shell #correctNotePanel .note-answer-correct {
  background: #fff;
  color: #0f172a;
}

.review-shell #wrongNotePanel .note-metric-grid,
.review-shell #correctNotePanel .note-metric-grid {
  display: grid;
  grid-column: 3 / 4;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  align-self: start;
  margin: 0;
  padding: 0;
  border: 0;
}

.review-shell #wrongNotePanel .note-metric-card,
.review-shell #correctNotePanel .note-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f8fafc;
  text-align: center;
  min-width: 0;
}

.review-shell #wrongNotePanel .note-metric-label,
.review-shell #correctNotePanel .note-metric-label {
  margin: 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.review-shell #wrongNotePanel .note-metric-value,
.review-shell #correctNotePanel .note-metric-value {
  margin-top: 1px;
  color: #020617;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.review-shell .note-card-main .note-card-memo-summary,
.review-shell .note-card-main .aivi-wrong-card-note-v133,
.review-shell #wrongNotePanel .note-card-memo-summary,
.review-shell #correctNotePanel .note-card-memo-summary {
  grid-column: 2 / 4;
  grid-row: 2;
  display: -webkit-box;
  align-self: start;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.review-shell .note-card-main .note-card-memo-summary.is-empty,
.review-shell .note-card-main .aivi-wrong-card-note-v133.is-empty,
.review-shell #wrongNotePanel .note-card-memo-summary.is-empty,
.review-shell #correctNotePanel .note-card-memo-summary.is-empty {
  display: -webkit-box;
  color: #94a3b8;
}

.review-shell .note-card-main .note-card-memo-editor,
.review-shell #wrongNotePanel .note-card-memo-editor,
.review-shell #correctNotePanel .note-card-memo-editor {
  grid-column: 2 / 4;
  grid-row: 2;
  margin-top: 2px;
  padding: 8px;
  border: 1px solid #94a3b8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
}

.review-shell .note-card-main .note-card-memo-textarea,
.review-shell #wrongNotePanel .note-card-memo-textarea,
.review-shell #correctNotePanel .note-card-memo-textarea {
  width: 100%;
  min-height: 56px;
  max-height: 96px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
}

.review-shell .note-card-main .note-card-memo-editor-actions,
.review-shell #wrongNotePanel .note-card-memo-editor-actions,
.review-shell #correctNotePanel .note-card-memo-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 7px;
}

.review-shell .note-card-main .note-card-memo-editor-actions .aivi-btn,
.review-shell #wrongNotePanel .note-card-memo-editor-actions .aivi-btn,
.review-shell #correctNotePanel .note-card-memo-editor-actions .aivi-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.review-shell #wrongNotePanel .note-card-right,
.review-shell #correctNotePanel .note-card-right {
  grid-column: 4 / 5;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  box-sizing: border-box;
  width: 218px;
  max-width: 218px;
  margin: 0;
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
}

.review-shell .note-card-aux-tags {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  width: 100%;
  max-height: 21px;
  margin-bottom: 2px;
  overflow: hidden;
}

.review-shell .note-card-aux-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 19px;
  padding: 0 5px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-shell #wrongNotePanel .note-card-right .note-card-actions,
.review-shell #correctNotePanel .note-card-right .note-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, 30px);
  grid-auto-rows: 30px;
  gap: 5px;
  align-content: flex-start;
  justify-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border-left: 0;
  min-width: 0;
}

.review-shell #wrongNotePanel .note-card-actions .aivi-btn,
.review-shell #correctNotePanel .note-card-actions .aivi-btn {
  width: 100%;
  height: 30px;
  padding: 0 5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s, border-color .15s;
}

.review-shell #wrongNotePanel .note-card-actions .aivi-btn:hover,
.review-shell #correctNotePanel .note-card-actions .aivi-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.review-detail-col #reviewDetailView > .review-actions,
.correct-note-detail-col #correctDetailView > .review-actions,
.review-detail-col .aivi-wrong-meta-v133-mount,
.correct-note-detail-col .aivi-meta-v8-mount,
#reviewCompleteFeedback,
#detailFeedback,
#correctDetailFeedback {
  display: none !important;
}

.review-shell .review-panel.review-detail-col,
.review-shell .review-panel.correct-note-detail-col {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
  padding: 20px;
}

.review-shell .review-detail-title {
  margin-bottom: 4px;
  color: #020617;
  font-size: 18px;
  font-weight: 950;
}

.review-shell .review-detail-sub {
  margin-bottom: 16px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.review-shell .review-box {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.review-shell .review-label {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
}

.review-shell .review-value {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.note-search-bar {
  gap: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
  padding: 18px;
}

.note-search-input-wrap {
  gap: 8px;
}

.note-search-input,
.note-search-filters select {
  height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.note-search-input {
  font-size: 14px;
}

.note-search-filters select {
  font-size: 13px;
}

#noteSearchButton,
#noteSearchResetButton {
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  padding: 0 16px;
}

@media (max-width: 1280px) {
  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    grid-template-columns: 92px minmax(0, 1fr) 248px;
    min-height: 0;
    padding: 14px;
  }

  .review-shell #wrongNotePanel .note-card-right,
  .review-shell #correctNotePanel .note-card-right {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    max-width: none;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
    padding-left: 0;
    padding-top: 12px;
    margin-top: 8px;
  }

  .review-shell .note-card-aux-tags {
    justify-content: flex-start;
  }

  .review-shell #wrongNotePanel .note-metric-grid,
  .review-shell #correctNotePanel .note-metric-grid {
    grid-column: 3 / 4;
    grid-row: 1;
  }

  .review-shell #wrongNotePanel .note-card-memo-summary,
  .review-shell #correctNotePanel .note-card-memo-summary {
    grid-column: 2 / 4;
  }

  .review-shell #wrongNotePanel .note-card-right .note-card-actions,
  .review-shell #correctNotePanel .note-card-right .note-card-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto;
  }
}

@media (max-width: 900px) {
  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 12px;
  }

  .review-shell #wrongNotePanel .note-card-main,
  .review-shell #correctNotePanel .note-card-main,
  .review-shell #wrongNotePanel .note-rank-wrap,
  .review-shell #correctNotePanel .note-rank-wrap,
  .review-shell #wrongNotePanel .note-metric-grid,
  .review-shell #correctNotePanel .note-metric-grid,
  .review-shell #wrongNotePanel .note-card-memo-summary,
  .review-shell #correctNotePanel .note-card-memo-summary,
  .review-shell #wrongNotePanel .note-card-right,
  .review-shell #correctNotePanel .note-card-right {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .review-shell #wrongNotePanel .note-rank-wrap,
  .review-shell #correctNotePanel .note-rank-wrap {
    justify-content: flex-start;
    border-right: 0;
    padding-right: 0;
  }

  .review-shell #wrongNotePanel .note-rank,
  .review-shell #correctNotePanel .note-rank {
    font-size: 24px;
  }

  .review-shell #wrongNotePanel .note-metric-grid,
  .review-shell #correctNotePanel .note-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-shell #wrongNotePanel .note-card-right .note-card-actions,
  .review-shell #correctNotePanel .note-card-right .note-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Review card finish: shared shadcn-style cards for wrong/correct notes. */
.review-shell #wrongNotePanel .review-card,
.review-shell #correctNotePanel .correct-note-card {
  grid-template-columns: 56px minmax(0, 1fr) 176px;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
}

.review-shell #wrongNotePanel .note-rank-wrap,
.review-shell #correctNotePanel .note-rank-wrap {
  grid-column: 1;
  grid-row: 1;
  min-height: 100%;
  padding-right: 12px;
  border-right: 1px solid #e2e8f0;
}

.review-shell #wrongNotePanel .note-rank,
.review-shell #correctNotePanel .note-rank {
  font-size: 24px;
}

.review-shell #wrongNotePanel .note-icon,
.review-shell #correctNotePanel .note-icon {
  width: 34px;
  height: 34px;
}

.review-shell #wrongNotePanel .note-icon {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.review-shell #correctNotePanel .note-icon {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.review-shell #wrongNotePanel .note-card-main,
.review-shell #correctNotePanel .note-card-main {
  grid-column: 2;
  grid-row: 1;
  gap: 9px;
}

.review-shell #wrongNotePanel .review-badges,
.review-shell #correctNotePanel .review-badges {
  max-height: none;
  margin-bottom: 2px;
  gap: 6px;
}

.review-shell #wrongNotePanel .review-badge,
.review-shell #correctNotePanel .review-badge {
  height: 24px;
  padding: 0 9px;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
}

.review-shell #wrongNotePanel .review-badge-wrong {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.review-shell #correctNotePanel .review-badge-correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.review-shell #wrongNotePanel .review-badge-count {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.review-shell #wrongNotePanel .review-card-title,
.review-shell #correctNotePanel .correct-note-card-title {
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.25;
}

.review-shell #wrongNotePanel .review-card-summary,
.review-shell #correctNotePanel .correct-note-card-summary {
  margin-bottom: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.45;
}

.review-shell #wrongNotePanel .note-answer-preview,
.review-shell #correctNotePanel .note-answer-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.review-shell #wrongNotePanel .note-answer-preview > .note-answer-box,
.review-shell #correctNotePanel .note-answer-preview > .note-answer-box {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 9px 11px;
  border-radius: 12px;
  white-space: normal;
}

.review-shell #wrongNotePanel .note-answer-box > span,
.review-shell #correctNotePanel .note-answer-box > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
}

.review-shell #wrongNotePanel .note-answer-box > strong,
.review-shell #correctNotePanel .note-answer-box > strong {
  display: block;
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-shell #wrongNotePanel .note-answer-box-wrong,
.review-shell #correctNotePanel .note-answer-box-wrong {
  border-color: #fed7aa;
  background: #fff7ed;
}

.review-shell #wrongNotePanel .note-answer-box-correct,
.review-shell #correctNotePanel .note-answer-box-correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.review-shell #wrongNotePanel .note-status-chips,
.review-shell #correctNotePanel .note-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.review-shell #wrongNotePanel .note-status-chip,
.review-shell #correctNotePanel .note-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.review-shell #wrongNotePanel .note-status-chip .note-metric-label,
.review-shell #correctNotePanel .note-status-chip .note-metric-label {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.review-shell #wrongNotePanel .note-status-chip .note-metric-value,
.review-shell #correctNotePanel .note-status-chip .note-metric-value {
  margin: 0;
  color: #0f172a;
  font-size: inherit;
  font-weight: 950;
}

.review-shell #wrongNotePanel .note-chip-icon,
.review-shell #correctNotePanel .note-chip-icon {
  color: #64748b;
  font-size: 12px;
  line-height: 1;
}

.review-shell #wrongNotePanel .note-status-rate,
.review-shell #correctNotePanel .note-status-rate {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.review-shell #wrongNotePanel .note-status-important,
.review-shell #correctNotePanel .note-status-important {
  border-color: #fde68a;
  background: #fefce8;
}

.review-shell #wrongNotePanel .note-status-review,
.review-shell #correctNotePanel .note-status-review,
.review-shell #wrongNotePanel .note-status-date,
.review-shell #correctNotePanel .note-status-date {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.review-shell #wrongNotePanel .note-status-basket,
.review-shell #correctNotePanel .note-status-basket {
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.review-shell #wrongNotePanel .note-status-date.is-muted,
.review-shell #correctNotePanel .note-status-date.is-muted {
  color: #94a3b8;
}

.review-shell #wrongNotePanel .note-card-memo-summary,
.review-shell #correctNotePanel .note-card-memo-summary {
  display: -webkit-box;
  grid-column: auto;
  grid-row: auto;
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

.review-shell #wrongNotePanel .note-card-memo-summary.is-empty,
.review-shell #correctNotePanel .note-card-memo-summary.is-empty {
  color: #94a3b8;
}

.review-shell #wrongNotePanel .note-card-right,
.review-shell #correctNotePanel .note-card-right {
  grid-column: 3;
  grid-row: 1;
  width: 176px;
  max-width: 176px;
  align-self: stretch;
  padding-left: 14px;
}

.review-shell #wrongNotePanel .note-card-right .note-card-actions,
.review-shell #correctNotePanel .note-card-right .note-card-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.review-shell #wrongNotePanel .note-card-action-pair,
.review-shell #correctNotePanel .note-card-action-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.review-shell #wrongNotePanel .note-card-actions .aivi-btn,
.review-shell #correctNotePanel .note-card-actions .aivi-btn {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 850;
}

@media (max-width: 1280px) {
  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .review-shell #wrongNotePanel .note-card-right,
  .review-shell #correctNotePanel .note-card-right {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    max-width: none;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }

  .review-shell #wrongNotePanel .note-card-right .note-card-actions,
  .review-shell #correctNotePanel .note-card-right .note-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-shell #wrongNotePanel .note-card-action-pair,
  .review-shell #correctNotePanel .note-card-action-pair {
    display: contents;
  }
}

@media (max-width: 900px) {
  .aivi-ai-note-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aivi-ai-note-draft-head,
  .aivi-ai-note-list-head,
  .aivi-ai-note-draft-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .aivi-ai-note-draft-answer-grid,
  .aivi-ai-note-list-answer-grid {
    grid-template-columns: 1fr;
  }

  .aivi-ai-note-list-summary {
    grid-template-columns: 1fr;
  }

  .review-shell #wrongNotePanel .review-card,
  .review-shell #correctNotePanel .correct-note-card {
    grid-template-columns: 1fr;
  }

  .review-shell #wrongNotePanel .note-rank-wrap,
  .review-shell #wrongNotePanel .note-card-main,
  .review-shell #wrongNotePanel .note-card-right,
  .review-shell #correctNotePanel .note-rank-wrap,
  .review-shell #correctNotePanel .note-card-main,
  .review-shell #correctNotePanel .note-card-right {
    grid-column: 1;
  }

  .review-shell #wrongNotePanel .note-rank-wrap,
  .review-shell #correctNotePanel .note-rank-wrap {
    align-items: flex-start;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 0 10px;
  }

  .review-shell #wrongNotePanel .note-rank-top,
  .review-shell #correctNotePanel .note-rank-top {
    flex-direction: row;
    gap: 10px;
  }

  .review-shell #wrongNotePanel .note-icon,
  .review-shell #correctNotePanel .note-icon {
    margin-top: 0;
  }

  .review-shell #wrongNotePanel .note-answer-preview,
  .review-shell #correctNotePanel .note-answer-preview {
    grid-template-columns: 1fr;
  }

  .review-shell #wrongNotePanel .note-card-right .note-card-actions,
  .review-shell #correctNotePanel .note-card-right .note-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .aivi-ai-note-context-grid {
    grid-template-columns: 1fr;
  }

  .aivi-ai-note-draft-card,
  .aivi-ai-note-list-card {
    padding: .85rem;
  }
}

.review-page-shell .review-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.review-page-shell [data-review-side-panel] {
  display: none !important;
}

.review-page-shell .review-card,
.review-page-shell .correct-note-card {
  align-items: start;
}

.review-page-shell .review-card[aria-expanded="true"],
.review-page-shell .correct-note-card[aria-expanded="true"] {
  border-color: #bfdbfe;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}

.aivi-ai-note-accordion-detail {
  grid-column: 1 / -1;
  border-top: 1px solid #e2e8f0;
  margin-top: .95rem;
  padding-top: 1rem;
}

.aivi-ai-note-accordion-message {
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.55;
  padding: .75rem .85rem;
  margin-bottom: .8rem;
}

.aivi-ai-note-accordion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.aivi-ai-note-accordion-section {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: .85rem;
}

.aivi-ai-note-accordion-section.is-wide,
.aivi-ai-note-accordion-section.is-question {
  grid-column: 1 / -1;
}

.aivi-ai-note-accordion-section span {
  display: block;
  color: #64748b;
  font-size: .76rem;
  font-weight: 950;
  margin-bottom: .35rem;
}

.aivi-ai-note-accordion-section p {
  margin: 0;
  color: #0f172a;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.aivi-ai-note-accordion-choices {
  display: grid;
  gap: .55rem;
}

.aivi-ai-note-accordion-choice {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: .7rem .75rem;
}

.aivi-ai-note-accordion-choice span {
  color: #64748b;
  font-size: .76rem;
  font-weight: 950;
  margin-bottom: .25rem;
}

.aivi-ai-note-accordion-choice p {
  color: #111827;
  font-size: .9rem;
  font-weight: 700;
}

.aivi-ai-note-accordion-choice.is-mine {
  border-color: #fed7aa;
  background: #fff7ed;
}

.aivi-ai-note-accordion-choice.is-correct {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

@media (max-width: 900px) {
  .aivi-ai-note-accordion-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .aivi-ai-note-accordion-section.is-wide,
  .aivi-ai-note-accordion-section.is-question {
    grid-column: auto;
  }
}
