/* Comments pinned to passages of a student's writing, in the grader (teacher/writing-comments.js; W6). */

.grader-work-pages {
  position: relative;
}
/* The column's room beside the sheet while it shows (GraderView takes it from the fit). */
.grader-work-sheet.is-writing[data-col] {
  margin-right: 264px;
}
.grader-work-pages.fit-all .grader-work-sheet.is-writing[data-col] {
  margin-right: 0;
}
.grader-work-pages.fit-all .wc-col {
  display: none;
}

/* A comment's words, and its number after them. */
.wc-mark {
  background: rgba(255, 149, 0, 0.18);
  border-radius: 2px;
  color: inherit;
  padding: 0;
  cursor: pointer;
  transition: background 150ms var(--ease-out);
}
.wc-mark.is-lit {
  background: rgba(255, 149, 0, 0.38);
}
.wc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15em;
  height: 1.15em;
  margin-left: 2px;
  padding: 0 0.25em;
  border-radius: 999px;
  background: #ffe3b8;
  color: #7a4100;
  font-size: 0.62em;
  font-weight: 700;
  line-height: 1;
  vertical-align: 0.45em;
  cursor: pointer;
  user-select: none;
}
.wc-num.is-lit {
  background: #ffc46b;
}

/* While Comment is on: the sentence under the pointer, drawn over its lines. */
.grader-work-writing.is-picking {
  cursor: pointer;
}
.wc-hover {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: var(--active-light);
  box-shadow: inset 0 -2px 0 var(--active);
  border-radius: 2px;
}

/* The Comment button by a selection. */
.wc-float {
  position: absolute;
  z-index: 5;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--divider-strong),
    var(--shadow-md);
}

/* The column of cards beside the sheet, each level with its words. */
.wc-col {
  position: absolute;
  top: 0;
  width: 248px;
}
.wc-card {
  position: absolute;
  left: 0;
  width: 248px;
  box-sizing: border-box;
  padding: var(--space-3);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-family: var(--font-base);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
  transition:
    top 180ms var(--ease-out),
    box-shadow 150ms var(--ease-out);
}
.wc-card.is-lit {
  box-shadow:
    0 0 0 2px var(--active),
    var(--shadow-md);
}
.wc-card.is-editing {
  cursor: default;
}
.wc-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 28px;
  margin-bottom: var(--space-1);
}
.wc-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ffe3b8;
  color: #7a4100;
  font-size: 12px;
  font-weight: 700;
}
.wc-gap {
  flex: 1;
}
.wc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.wc-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}
.wc-close {
  margin-left: auto;
}
.wc-card-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wc-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  font: inherit;
  color: var(--text);
  resize: vertical;
}
.wc-field:focus {
  outline: 2px solid var(--active);
  outline-offset: 0;
}
.wc-field::placeholder {
  color: var(--text-2);
}
.wc-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.wc-bank-btn {
  padding: 6px 0;
  white-space: nowrap;
  border: 0;
  background: transparent;
  color: var(--active-fill);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.wc-save {
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
  border: 0;
  border-radius: 10px;
  background: var(--active-fill);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.wc-bank-btn:focus-visible,
.wc-save:focus-visible,
.wc-icon:focus-visible,
.wc-bank-item:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}

/* From the Bank: a menu above the card, most used first. */
.wc-bank-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-1) 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--divider-strong),
    var(--shadow-md);
}
.wc-bank-menu.is-below {
  top: calc(100% + 8px);
  bottom: auto;
}
.wc-bank-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.wc-bank-item:hover,
.wc-bank-item:focus {
  background: var(--active-light);
}
.wc-bank-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

@media (prefers-reduced-motion: reduce) {
  .wc-card,
  .wc-mark {
    transition: none;
  }
}
