.learning-card {
  padding: clamp(16px, 3vw, 28px);
  margin: 18px 0;
  text-align: left;
  min-width: 0;
}
.learning-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.learning-heading h2,
.learning-heading h1 {
  margin: 0;
}
.learning-heading p {
  margin: 5px 0;
  color: #625d55;
}
.learning-heading img {
  object-fit: contain;
}
.learning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.learning-grid strong,
.learning-grid small {
  display: block;
}
.learning-grid strong {
  margin: 6px 0;
}
.learning-grid p {
  font-size: 0.92rem;
  line-height: 1.5;
}
.learning-help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.learning-help details,
.learning-entry {
  padding: 14px;
  border: 1px solid #ddd5c8;
  border-radius: var(--radius-limit, 14px);
}
.learning-help summary {
  cursor: pointer;
  font-weight: 650;
}
.learning-help p {
  font-size: 0.92rem;
  line-height: 1.55;
}
.learning-filters,
.learning-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.learning-card button:not(.board-square):not(.button),
.learning-dialog button:not(.board-square):not(.button):not(.coach-analysis-step),
.concept-page button:not(.button) {
  cursor: pointer;
  border: 1px solid #d4cbbd;
  border-radius: 10px;
  background: #fffaf0;
  color: #36372c;
  padding: 9px 13px;
  font: inherit;
  font-weight: 700;
}
.learning-filters [aria-pressed="true"] {
  background: #e7eddc;
  border-color: #71805a;
}
.learning-card select,
.learning-card textarea,
.concept-page input {
  max-width: 100%;
  font: inherit;
  padding: 10px;
  border: 1px solid #cbc4b8;
  border-radius: 10px;
  background: #fff;
}
.learning-entry {
  margin-top: 12px;
}
.learning-entry h3 {
  margin: 0 0 8px;
}
.learning-entry textarea {
  display: block;
  width: 100%;
  min-height: 80px;
  box-sizing: border-box;
}
.learning-entry p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.learning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.learning-table th,
.learning-table td {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid #e0d9cd;
}
.learning-table td:last-child {
  text-align: right;
}
.learning-coverage {
  font-size: 0.83rem;
  color: #655e52;
  line-height: 1.5;
}
.learning-dialog {
  width: min(92vw, 580px);
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid #d8d0c3;
  border-radius: var(--radius-limit, 14px);
  padding: 20px;
  background: #fbf8f3;
  color: #302e29;
  box-sizing: border-box;
}
.learning-dialog::backdrop {
  background: #221f1a88;
}
.learning-dialog h2 {
  margin: 0;
  font-size: 1.35rem;
}
.learning-dialog .learning-board {
  margin: 16px auto;
  width: min(100%, 420px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 8px;
}
.learning-board button:focus-visible {
  outline: 3px solid #8f4c13;
  outline-offset: -3px;
  z-index: 1;
}
.learning-dialog p {
  line-height: 1.5;
}
.learning-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.learning-result-actions > :not(.button) {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid #cfc7ba;
  border-radius: min(12px, var(--radius-limit, 14px));
  background: #fff9ee;
  color: #333;
  text-decoration: none;
  cursor: pointer;
}
.concept-page {
  max-width: 1050px;
  margin: 25px auto;
  padding: 20px;
}
.concept-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.concept-list article {
  background: #fffdf7;
  border: 1px solid #e0d8ca;
  border-radius: var(--radius-limit, 14px);
  padding: 18px;
}
.concept-list h2 {
  font-size: 1.2rem;
}
.concept-list p {
  line-height: 1.5;
}
.learning-dialog [hidden],
.learning-card [hidden] {
  display: none !important;
}
.learning-dialog-close {
  margin-left: auto;
}
.learning-dialog .learning-heading {
  position: sticky;
  top: -20px;
  background: #fbf8f3;
  padding: 10px 0;
  z-index: 2;
}
.learning-heading label {
  flex-shrink: 0;
}
.learning-card a {
  overflow-wrap: anywhere;
}
.learning-status-error {
  color: #913f2a;
}
@media (max-width: 720px) {
  .learning-grid,
  .learning-help {
    grid-template-columns: 1fr;
  }
  .learning-grid > div + div {
    border-top: 1px solid #e0d8ca;
    padding-top: 12px;
  }
  .learning-heading {
    flex-wrap: wrap;
  }
  .learning-heading img {
    width: 48px;
    height: 48px;
  }
  .concept-list {
    grid-template-columns: 1fr;
  }
  .learning-table {
    font-size: 0.83rem;
  }
  .learning-dialog {
    padding: 14px;
  }
  .learning-card {
    margin: 12px 0;
  }
  .learning-heading label {
    width: 100%;
  }
}
#learning-summary .learning-heading {
  justify-content: flex-start;
}
#learning-summary .learning-heading > div {
  flex: 1;
  min-width: 0;
}
#learning-summary .learning-heading > img {
  flex: none;
}
.learning-concept-link {
  font: inherit;
  font-size: 0.82rem;
  border: 0;
  background: transparent;
  color: #536139;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
}
.learning-focus-details {
  font-size: 0.8rem;
  margin-top: 6px;
}
.learning-focus-details summary {
  cursor: pointer;
}
.learning-focus-details p {
  line-height: 1.45;
}

/* Keep learning surfaces consistent with the app's warm paper cards. */
.learning-card.paper-card {
  border: 1px solid var(--line, #dfd9d2);
  border-radius: var(--radius-limit, 14px);
  background: var(--surface, #fffdfa);
  box-shadow: var(--shadow-soft, 0 6px 18px #3f302514);
}
.learning-heading h2 { font-size: clamp(20px, 3vw, 25px); line-height: 1.2; }
.learning-heading > div { min-width: 0; }
.learning-heading > button { flex-shrink: 0; }
.learning-grid > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e5dccf;
  border-radius: var(--radius-limit, 14px);
  background: #fff7ea;
}
.learning-grid small { color: #6c5845; font-weight: 700; font-size: 12px; }
.learning-grid strong { font-size: 18px; line-height: 1.35; }
.learning-grid p { margin: 8px 0 14px; }
.learning-help details { background: #fffaf4; }
.learning-help summary,
.learning-focus-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  font-weight: 700;
}
.learning-help summary::-webkit-details-marker,
.learning-focus-details summary::-webkit-details-marker { display: none; }
.learning-help summary::after,
.learning-focus-details summary::after { content: '+'; flex: none; font-size: 20px; line-height: 1; }
.learning-help details[open] > summary::after,
.learning-focus-details[open] > summary::after { content: '−'; }
.learning-help details[open] { border-color: #b9a58b; }
.daily-plan-focus .learning-focus-details {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #bcd7cd;
  border-radius: 10px;
  background: #edf7f1;
  color: #24584a;
  font-size: 12px;
}
.daily-plan-focus.daily-plan-focus .learning-focus-details p {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: #344d43;
}
.learning-card button:not(.square):not(.button),
.learning-dialog button:not(.square):not(.button):not(.coach-analysis-step),
.concept-page button:not(.button) {
  min-height: 42px;
  font-weight: 700;
  border-color: #cfc1af;
  background: linear-gradient(#fffdf9, #fff3e2);
  box-shadow: 0 3px 0 #d5c7b6, 0 5px 10px #3f30250d;
}
#learning-notebook .learning-filters button[aria-pressed="true"] {
  background: #e2efe5;
  border-color: #769780;
  color: #24543b;
  box-shadow: 0 3px 0 #a8bfae;
}
.learning-card :is(button, a, select, textarea, summary):focus-visible,
.learning-dialog button:not(.square):focus-visible,
.concept-page :is(button, input):focus-visible,
.learning-focus-details summary:focus-visible {
  outline: 3px solid #9d622e;
  outline-offset: 3px;
}
.learning-card button:disabled, .learning-dialog button:disabled { opacity: .55; cursor: default; }
.learning-entry { background: #fffaf4; }
.learning-entry textarea { margin: 12px 0; font-weight: 550; resize: vertical; }
.learning-table th { color: #6c5845; background: #fff7ea; }
.learning-table th, .learning-table td { overflow-wrap: anywhere; }
.learning-dialog { box-shadow: 0 24px 80px #32271f47; }
.concept-list article { display: flex; flex-direction: column; box-shadow: 0 4px 12px #3f30250a; }
.concept-list h2 { margin: 0; }
.concept-list button { margin-top: auto; align-self: flex-start; }
.concept-page input { width: min(100%, 480px); min-height: 44px; }
@media (max-width: 720px) {
  .learning-grid { gap: 12px; }
  .learning-heading > button { width: 100%; }
  .learning-card.paper-card { border-radius: var(--radius-limit, 14px); }
  .learning-dialog .learning-heading { top: -14px; }
}

/* These sections belong beneath both columns of the Progress overview. */
.progress-overview-row > .learning-card {
  grid-column: 1 / -1;
  margin: 0;
}

/* Saved positions follow the Coach library's compact board-and-copy cards. */
#learning-notebook-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#learning-notebook-content > .learning-actions,
#learning-notebook-content > p { grid-column: 1 / -1; }
.learning-entry { margin: 0; padding: 18px; background: var(--sheet, #fffdfa); border-color: var(--line); }
.learning-entry-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.learning-entry-heading > div:last-child { min-width: 0; }
.learning-entry-heading small { color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.learning-entry-heading h3 { margin: 5px 0; font-size: 18px; line-height: 1.3; }
.learning-entry-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.learning-entry-preview.chessboard { flex: 0 0 128px; width: 128px; border-width: 4px; border-radius: 10px; pointer-events: none; }
.learning-entry-preview .coord { display: none; }
.learning-note-label { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.learning-entry textarea { margin: 7px 0 0; min-height: 66px; font-size: 14px; background: var(--paper); }
.learning-entry .learning-actions { align-items: center; margin: 16px 0 4px; }
.learning-entry .learning-actions > button:not(.button) { padding: 7px 9px; min-height: 36px; font-size: 12px; box-shadow: none; background: transparent; }
.learning-result-actions { justify-content: center; align-items: center; gap: 12px; padding: 6px 0; }
.learning-result-actions > .button { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.learning-result-actions > [role="status"] { flex-basis: 100%; text-align: center; }
.learning-dialog .learning-board.chessboard { border-radius: min(12px, var(--radius-limit, 14px)); }
@media (max-width: 900px) { #learning-notebook-content { grid-template-columns: 1fr; } }
@media (max-width: 400px) {
  .learning-entry { padding: 12px; }
  .learning-entry-heading { gap: 12px; }
  .learning-entry-preview.chessboard { flex-basis: 96px; width: 96px; }
  .learning-entry-heading h3 { font-size: 16px; }
}

/* The notebook library stays compact; editing belongs inside an opened position. */
.notebook-site .learning-entry-heading { margin: 0; justify-content: space-between; }
.notebook-site .learning-entry-heading > div { flex: 1; }
.notebook-site .learning-entry-heading > button { flex: none; }
.notebook-site .learning-entry { align-self: start; }
.learning-entry-options { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.learning-entry-options textarea { display: block; box-sizing: border-box; width: 100%; min-height: 80px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: min(12px, var(--radius-limit, 14px)); background: var(--sheet); font: inherit; }
.puzzle-explanation-bubble .learning-result-actions,
.puzzle-task-fox-bubble .learning-result-actions { justify-content: flex-start; margin: 10px 0 0; padding: 0; }
.puzzle-explanation-bubble .learning-result-actions .button,
.puzzle-task-fox-bubble .learning-result-actions .button { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.puzzle-explanation-bubble .learning-result-actions.learning-note-actions .button {
 display: flex; align-items: center; justify-content: center; gap: 5px;
 min-height: 46px; padding: 5px 12px; border: 1px solid #d5bba7;
 border-radius: 10px; background: #fffaf5; box-shadow: 0 3px 0 #c7ad99;
 color: #654633; font: 800 12px/1.3 var(--sans); text-decoration: none;
}
.learning-note-actions .button img { flex: none; width: 34px; height: 34px; object-fit: contain; }
.puzzle-explanation-bubble .learning-note-actions .button { min-width: 110px; }
.learning-note-actions .button.is-saving img { animation: notebook-saving .7s ease-in-out infinite alternate; }
.learning-note-actions .button.is-saved img { animation: notebook-saved .55s ease both; }
.learning-note-actions .button.is-saved:disabled { opacity: 1; }
.learning-note-actions .button.is-saved span { color: #286346; }
@keyframes notebook-saving { to { transform: translateY(-3px) rotate(-8deg); } }
@keyframes notebook-saved { 0% { transform: scale(.8); } 45% { transform: scale(1.2) rotate(-8deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
 .learning-note-actions .button.is-saving img,
 .learning-note-actions .button.is-saved img { animation: none; }
}
.puzzle-explanation-bubble .learning-result-actions.learning-note-actions .button:hover { background: #fff4e7; }
.puzzle-explanation-bubble .learning-result-actions.learning-note-actions .button:focus-visible { outline: 3px solid #d78044; outline-offset: 3px; }
.puzzle-explanation-bubble .learning-result-actions.learning-note-actions .button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #c7ad99; }
.learning-dialog .coach-analysis-controls { width: 100%; display: flex; align-items: center; justify-content: center; gap: 16px; }
.learning-dialog .coach-analysis-controls .coach-analysis-step { width: 50px; height: 50px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; }
@media (max-width: 520px) {
 .notebook-site .learning-entry-heading { flex-wrap: wrap; gap: 12px; }
 .notebook-site .learning-entry-heading > div { flex-basis: 100%; }
}

.coach-analysis-controls :is(.coach-analysis-step, .coach-analysis-jump) {
    position: relative;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.coach-analysis-step::before,
.coach-analysis-jump::before {
    position: absolute;
    top: 3px;
    left: 5px;
    width: 40px;
    height: 40px;
    border: 1px solid #dc513f;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .55) 0 8%, transparent 9%),
        linear-gradient(145deg, #ff9d7d 0%, #f5715e 52%, #dc4938 100%);
    box-shadow:
        inset 0 2px 1px rgba(255, 255, 255, .7),
        inset 0 -4px 4px rgba(156, 39, 26, .2),
        0 4px 0 #bd3c2e,
        0 7px 9px rgba(126, 49, 38, .24);
    content: "";
    transition: filter .14s ease, transform .09s ease, box-shadow .09s ease;
}

.coach-analysis-step::after {
    position: absolute;
    z-index: 1;
    top: 14px;
    left: 19px;
    width: 14px;
    height: 18px;
    background: linear-gradient(90deg, #fff7eb, #fff);
    clip-path: polygon(10% 0, 100% 50%, 10% 100%);
    content: "";
    filter: drop-shadow(0 1px 1px rgba(116, 39, 29, .42));
    transform: translateX(1px);
    transition: transform .09s ease;
}

.coach-analysis-step.previous::after {
    transform: translateX(-1px) rotate(180deg);
}

.coach-analysis-double-arrow {
    position: absolute;
    z-index: 1;
    top: 15px;
    left: 15px;
    display: flex;
    width: 20px;
    height: 16px;
    align-items: center;
    justify-content: center;
    transform: translateY(0) rotate(0deg);
    transition: transform .09s ease;
}

.coach-analysis-double-arrow i {
    display: block;
    width: 10px;
    height: 16px;
    flex: 0 0 10px;
    background: linear-gradient(90deg, #fff2db, #fffaf0);
    clip-path: polygon(8% 0, 100% 50%, 8% 100%);
    filter: drop-shadow(0 1px 1px rgba(116, 39, 29, .36));
}

.coach-analysis-jump.first .coach-analysis-double-arrow {
    transform: translateY(0) rotate(180deg);
}

.coach-analysis-controls :is(.coach-analysis-step, .coach-analysis-jump):hover::before {
    filter: saturate(1.06) brightness(1.03);
}

.coach-analysis-controls :is(.coach-analysis-step, .coach-analysis-jump):focus-visible {
    box-shadow: 0 0 0 3px rgba(234, 118, 95, .28);
    outline: 0;
}

.coach-analysis-controls :is(.coach-analysis-step, .coach-analysis-jump):active::before {
    box-shadow:
        inset 0 3px 5px rgba(129, 31, 21, .26),
        inset 0 1px 1px rgba(255, 255, 255, .32),
        0 1px 0 #bd3c2e,
        0 2px 3px rgba(126, 49, 38, .18);
    filter: saturate(1.04) brightness(.98);
    transform: translateY(4px);
}

.coach-analysis-step:active::after {
    transform: translate(1px, 4px);
}

.coach-analysis-step.previous:active::after {
    transform: translate(-1px, 4px) rotate(180deg);
}

.coach-analysis-jump:active .coach-analysis-double-arrow {
    transform: translateY(4px) rotate(0deg);
}

.coach-analysis-jump.first:active .coach-analysis-double-arrow {
    transform: translateY(4px) rotate(180deg);
}


/* Coach's board-preview library, with the complete card acting as its link. */
.notebook-library { margin: 18px 0; }
.notebook-library > .learning-heading { margin-bottom: 20px; }
#learning-notebook-content.coach-game-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.notebook-position-card { text-decoration: none; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); transition: transform .16s, box-shadow .16s; }
.notebook-position-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.notebook-position-card:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 4px; }
.notebook-position-card .notebook-card-board { width: 100%; border-width: 5px; border-radius: 10px; aspect-ratio: 1; overflow: hidden; pointer-events: none; box-shadow: none; }
.notebook-card-board .coord { display: none; }
.notebook-position-card .coach-game-copy { padding: 12px 5px 8px; }
.notebook-position-card .coach-game-copy h3 { margin: 0 0 8px; font-size: 16px; }
.notebook-position-card .coach-game-copy p { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.notebook-card-unavailable { display: grid; place-items: center; aspect-ratio: 1; padding: 18px; border-radius: 10px; background: var(--surface-soft); text-align: center; color: var(--muted); }
#notebook-practice { align-items: start; }
#notebook-practice > [role="status"] { grid-column: 1 / -1; }
.notebook-board-card .learning-board { position: relative; width: 100%; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); aspect-ratio: 1; overflow: hidden; }
.notebook-board-card > [role="status"] { margin: 16px 0; line-height: 1.5; }
.notebook-board-card .learning-actions { justify-content: center; }
.notebook-board-card .learning-actions:empty { display: none; }
.notebook-board-card .coach-analysis-controls { width: 100%; display: flex; justify-content: center; align-items: center; gap: 16px; }
.notebook-board-card .learning-actions > button,
.notebook-practice-story button { min-height: 40px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); color: var(--ink); font: 700 14px var(--sans); cursor: pointer; }
.notebook-practice-story .learning-entry-options { margin: 0; border: 0; padding: 0; }
.notebook-practice-story p { line-height: 1.6; }
.notebook-practice-story [hidden] { display: none; }
.notebook-practice-story h3 { margin: 0 0 12px; }
.notebook-practice-story .learning-entry-options textarea { resize: vertical; min-height: 110px; }
.notebook-moving-piece { position: absolute; z-index: 5; pointer-events: none; display: grid; place-items: center; }
.notebook-moving-piece .chess-piece { width: 88%; height: 88%; object-fit: contain; }
.notebook-moving-source > .chess-piece { visibility: hidden; }
.notebook-board-card .learning-board[aria-busy="true"] .board-square { pointer-events: none; }
@media (max-width: 1100px) { #learning-notebook-content.coach-game-list { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 760px) { #learning-notebook-content.coach-game-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .notebook-position-card { transition: none; } }

.notebook-practice-story a { display: inline-block; margin: 8px 10px 16px 0; }
#notebook-practice > #notebook-position-options { grid-column: 1 / -1; padding: 24px; background: var(--sheet); border-radius: var(--radius-limit, 14px); }
.notebook-library .learning-filters { margin-bottom: 20px; }

.notebook-cream-header { padding: clamp(18px,3vw,30px); border: 1px solid #ded6c8; border-radius: var(--radius-limit, 14px); background: #fff7ea; color: #263238; box-shadow: var(--panel-shadow); }
.notebook-cream-header p { margin: 10px 0 0; }
.notebook-tabs { display: flex; width: fit-content; max-width: 100%; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius-limit, 14px); background: var(--surface-soft); }
#learning-notebook .notebook-tabs [role="tab"] { min-height: 40px; padding: 9px 20px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--ink-soft); font: 700 14px var(--sans); cursor: pointer; }
#learning-notebook .notebook-tabs [aria-selected="true"] { background: var(--sheet); color: var(--accent-ink); box-shadow: 0 2px 5px #3f30251a; }
.notebook-tabs [role="tab"]:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
.notebook-practice-site .coach-back { display: inline-block; margin-bottom: 22px; }
.notebook-board-card .notebook-status-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px; min-height: 24px; }
.notebook-status-row .puzzle-task-rating { grid-column: 1; justify-self: start; font: 800 10px/1.2 var(--sans); color: var(--muted); cursor: default; }
.notebook-status-row .puzzle-board-prompt { grid-column: 2; text-align: center; }
.notebook-status-row .notebook-move-status { margin: 0; font: 700 15px/1.2 var(--sans); }
.notebook-status-row .puzzle-task-difficulty { grid-column: 3; justify-self: end; font: 800 10px/1.2 var(--sans); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; cursor: default; }
.notebook-status-row:has(.notebook-move-status:empty) { display: none; }
@media (max-width: 400px) {
 .notebook-status-row .puzzle-task-difficulty { font-size: 9px; letter-spacing: 0; }
}

/* Notebook practice uses Puzzle's directional arrows, Fox bubble and navigation. */
.notebook-move-arrow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; overflow: visible; }
@media (min-width: 621px) {
  .notebook-practice-site .home-hub-tabs-wrap { display: contents; }
}
.notebook-practice-site .home-hub-tabs { display: none; }
.notebook-site .nav-account-button { text-decoration: none; }
.notebook-practice-story .notebook-fox-guide { margin: 0 0 28px; }
.notebook-fox-guide .puzzle-explanation-bubble h3 { margin: 0 0 8px; font-size: 16px; }
.notebook-fox-guide .puzzle-explanation-bubble p { margin: 0 0 10px; }
.notebook-practice-story:has(.notebook-fox-guide:not([hidden])) { background: transparent; box-shadow: none; padding: 0; }
.notebook-practice-story:has(.notebook-fox-guide:not([hidden])) > #notebook-position-options { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-limit, 14px); background: var(--sheet); }

.notebook-board-card .notebook-board-tools { display: grid; grid-template-columns: repeat(4,minmax(0,110px)); justify-content: center; gap: 8px; margin-top: 10px; }

.notebook-board-card .notebook-board-tools button{display:grid;grid-template-columns:1fr;justify-items:center;align-items:center;justify-content:center;gap:5px;min-height:44px;padding:4px 10px;border:1px solid #d2c6bc;border-radius:min(11px, var(--radius-limit, 14px));background:#fffaf5;box-shadow:0 2px 0 #bfb2a7;color:var(--ink);font:800 11px/1 var(--sans);cursor:pointer}

.notebook-board-card .notebook-board-tools button img{display:block;width:34px;height:34px;object-fit:contain}

.notebook-board-card .notebook-board-tools button:hover,.notebook-board-card .notebook-board-tools button:focus-visible{border-color:#b9aaa0;background:#fff;outline:2px solid rgba(234,118,95,.24);outline-offset:1px}

.notebook-board-card .notebook-board-tools button:disabled{cursor:default;filter:grayscale(.7);opacity:.45}
.notebook-fox-guide .puzzle-explanation-bubble { box-shadow: inset 0 1px 0 rgba(255,255,255,.98), inset 0 -2px 5px rgba(153,91,61,.07), 0 5px 0 #cfa58d, 0 12px 23px rgba(68,43,32,.17); }
@media (max-width: 400px) { .notebook-board-card .notebook-board-tools { gap: 5px; } .notebook-board-card .notebook-board-tools button { padding: 4px 6px; gap: 3px; } .notebook-board-card .notebook-board-tools button img { width: 28px; height: 28px; } }

.notebook-back-icon { display: grid; place-items: center; width: 34px; height: 34px; font-size: 24px; }

@media (min-width: 1024px) {
    .notebook-practice-site .coach-main { padding-top: 24px; }
    .notebook-board-card .notebook-board-tools button {
        grid-template-columns: auto auto;
        gap: 7px;
        white-space: nowrap;
    }
}


.learning-entry-options .learning-actions { justify-content: center; }
.learning-entry-options .learning-actions > button.notebook-note-action {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    min-width: 0; width: auto; min-height: 44px; padding: 5px 9px; white-space: nowrap;
    border: 1px solid #d2c6bc; border-radius: 11px; background: #fffaf5;
    box-shadow: inset 0 1px 0 #fff, 0 3px 0 #bfb2a7, 0 5px 8px #68462018;
    color: var(--ink); font: 800 14px/1.3 var(--sans); cursor: pointer;
}
.learning-entry-options .notebook-note-action img { display: block; width: 34px; height: 34px; }
.learning-entry-options .learning-actions > button.notebook-note-action:hover { background: #fff4e7; }
.learning-entry-options .learning-actions > button.notebook-note-action:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff, 0 1px 0 #bfb2a7; }
.learning-entry-options .notebook-note-action:focus-visible { outline: 2px solid #d78044; outline-offset: 3px; }
.learning-entry-options .notebook-note-action:disabled { opacity: .5; cursor: default; }
.learning-entry-options textarea,
.notebook-practice-story .learning-entry-options textarea {
    min-height: 0; height: auto; padding: 10px 12px; font-size: 14px; line-height: 1.5;
    background: #fffaf5; border: 1px solid #cdbbad;
    box-shadow: inset 0 2px 5px #68462026, 0 1px 0 #fff; resize: none; overflow-y: hidden;
}
@media (max-width: 400px) {
    .learning-entry-options .learning-actions { gap: 5px; }
    .learning-entry-options .learning-actions > button.notebook-note-action { padding: 7px 8px; gap: 5px; font-size: 14px; }
    .learning-entry-options .notebook-note-action img { width: 24px; height: 24px; }
}

/* Keep notebook saving alongside the puzzle continuation action. */
#board-tactic-actions.has-puzzle-save { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#board-tactic-actions > .learning-result-actions { margin: 0; padding: 0; min-width: 0; align-items: stretch; gap: 6px; }
#board-tactic-actions > .learning-result-actions > .button { min-height: 50px; height: 100%; font-size: 14px; }
#board-tactic-actions > .learning-result-actions > [role="status"] { font-size: 12px; padding: 4px; }

/* Match the shared cream panels without adding depth to board squares or icon controls. */
.concept-list article,
.learning-card.paper-card,
.learning-entry,
.notebook-position-card { box-shadow: var(--panel-shadow); }
.notebook-position-card:hover { box-shadow: var(--panel-shadow); }
.learning-help details { background: var(--surface); box-shadow: var(--panel-shadow-shallow); }
#learning-notebook .notebook-tabs,
#notebook-practice > #notebook-position-options { box-shadow: var(--panel-shadow-inset); }

/* Confirm notebook changes with a compact, keyboard-accessible dialog. */
.notebook-confirm-dialog { width: min(92vw, 420px); padding: 24px; background: #fffaf5; font-family: var(--sans); }
.notebook-confirm-icon { display: block; margin-bottom: 16px; }
.notebook-confirm-dialog .learning-heading { position: static; padding: 0; background: transparent; }
.notebook-confirm-dialog .learning-heading > button { display: none; }
.notebook-confirm-dialog p { margin: 14px 0 24px; color: #65594f; line-height: 1.6; }
.notebook-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.notebook-confirm-dialog .notebook-confirm-actions button { flex: 1; min-height: 44px; padding: 11px 14px; border: 1px solid #d2c6bc; border-radius: 10px; background: #fff; color: #40362e; font: 800 14px/1.3 var(--sans); cursor: pointer; }
.notebook-confirm-dialog .notebook-confirm-actions .notebook-confirm-delete { border-color: #ad372b; background: #b63d30; color: #fff; }
.notebook-confirm-dialog .notebook-confirm-actions .notebook-confirm-archive { border-color: #985b2b; background: #985b2b; color: #fff; }
.notebook-confirm-actions button:hover { filter: brightness(.96); }
.notebook-confirm-actions button:focus-visible { outline: 3px solid #d78044; outline-offset: 3px; }

/* Concepts share the site's cream panels, typography and board navigation. */
.concept-page { width: min(1120px, calc(100% - 28px)); max-width: none; padding: 0; margin: 24px auto 72px; }
.concept-heading { padding: 24px; background: var(--surface); }
.concept-heading h1 { margin: 0 0 10px; font-size: clamp(28px, 5vw, 40px); }
.concept-heading p { margin: 0; color: var(--muted); }
.concept-search-panel { margin-top: 24px; }
.concept-search-panel label { display: block; margin-bottom: 8px; font-weight: 700; }
.concept-page input { background: var(--surface); border-color: var(--line); color: var(--ink); }
.concept-list article { background: var(--surface); border-color: var(--line); }
.concept-list p { color: var(--muted); }
.concept-dialog { background: var(--surface); color: var(--ink); font-family: var(--sans); }
.concept-dialog .learning-heading { flex-direction: row; align-items: center; gap: 12px; padding: 0; margin-bottom: 10px; background: var(--surface); }
.concept-dialog .learning-heading h2 { font-size: 18px; line-height: 1.3; }
.concept-dialog .learning-heading > .concept-close { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; padding: 0; margin-left: auto; border: 0; background: transparent; box-shadow: none; color: var(--ink); font: 500 26px/1 var(--sans); }
.concept-dialog .learning-heading > .concept-close:hover { background: var(--paper); }
.concept-dialog .learning-board { border-radius: min(12px, var(--radius-limit, 14px)); }
.concept-dialog > .button { display: flex; width: fit-content; margin: 16px auto 0; }
@media (max-width: 620px) {
 .concept-site { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
 .concept-page { width: calc(100% - 18px); margin-top: 12px; }
 .concept-heading { padding: 18px; }
 .concept-dialog { padding: 14px; }
}
.concept-dialog .coach-analysis-controls :is(.coach-analysis-step, .coach-analysis-jump) {
    position: relative;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.concept-dialog .coach-analysis-step::before,
.concept-dialog .coach-analysis-jump::before {
    position: absolute;
    top: 3px;
    left: 5px;
    width: 40px;
    height: 40px;
    border: 1px solid #dc513f;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .55) 0 8%, transparent 9%),
        linear-gradient(145deg, #ff9d7d 0%, #f5715e 52%, #dc4938 100%);
    box-shadow:
        inset 0 2px 1px rgba(255, 255, 255, .7),
        inset 0 -4px 4px rgba(156, 39, 26, .2),
        0 4px 0 #bd3c2e,
        0 7px 9px rgba(126, 49, 38, .24);
    content: "";
    transition: filter .14s ease, transform .09s ease, box-shadow .09s ease;
}

.concept-dialog .coach-analysis-step::after {
    position: absolute;
    z-index: 1;
    top: 14px;
    left: 19px;
    width: 14px;
    height: 18px;
    background: linear-gradient(90deg, #fff7eb, #fff);
    clip-path: polygon(10% 0, 100% 50%, 10% 100%);
    content: "";
    filter: drop-shadow(0 1px 1px rgba(116, 39, 29, .42));
    transform: translateX(1px);
    transition: transform .09s ease;
}

.concept-dialog .coach-analysis-step.previous::after {
    transform: translateX(-1px) rotate(180deg);
}

.notebook-analysis-panel { width: 100%; min-width: 0; text-align: center; }
.notebook-analysis-panel p { margin: 8px 0; font: 600 14px/1.5 var(--sans); }
.notebook-analysis-suggestion { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border: 1px solid #cdd9ce; border-radius: var(--radius-limit, 14px); background: #f4faf3; text-align: left; }
.notebook-analysis-suggestion > div { display: grid; gap: 3px; }
.notebook-analysis-suggestion small { color: var(--muted); font: 850 10px var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.notebook-analysis-suggestion > div > strong { font: 900 24px/1 var(--serif); }
.notebook-analysis-score { display: grid; place-items: center; min-width: 66px; height: 48px; padding: 0 8px; border: 1px solid #d5c8bd; border-radius: min(13px, var(--radius-limit, 14px)); background: #fffaf4; box-shadow: 0 3px 0 #c5b7ab; color: var(--ink); font: 900 19px/1 var(--sans); }
.notebook-analysis-panel .notebook-analysis-instruction { margin: 12px 0 0; color: var(--muted); font: 750 12px/1.5 var(--sans); }
.notebook-board-card .notebook-move-arrow { z-index: 5; }
.notebook-analysis-panel > button { min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); color: var(--ink); font: 700 14px var(--sans); cursor: pointer; }
.notebook-analysis-panel > button:disabled { opacity: .5; cursor: default; }
.notebook-analysis-panel [hidden] { display: none !important; }
.notebook-analysis-panel .coach-analysis-controls { margin-top: 12px; }

/* Contextual Fox artwork. */
.notebook-empty{grid-column:1/-1;display:grid;justify-items:center;padding:16px 12px;text-align:center}.notebook-empty-fox{display:block;width:112px;height:112px;object-fit:contain}.notebook-empty p{max-width:420px;margin:8px 0 0}@media(max-width:720px){.notebook-empty-fox{width:88px;height:88px}}
