.tags {
    margin: 5px;
}

.tag-button {
    background-color: var(--myred);
    color: white;
    border-radius: 999px;
    padding: 6px 14px;
}

.texlivenet-block {
  width: 100%;
  flex: 0 0 auto;
}

.statement {
  font-size: x-large;
  padding: 0.5em;
}

.statement ol,
.solution ol,
.rubric ol,
.problem-info ol {
  margin: 0.45em 0 0.75em;
  padding-left: 1.25em;
  list-style-position: outside;
}

.statement ol li,
.solution ol li,
.rubric ol li,
.problem-info ol li {
  margin: 0.2em 0;
  padding-left: 0.1em;
}

.statement ol li::marker,
.solution ol li::marker,
.rubric ol li::marker,
.problem-info ol li::marker {
  content: counter(list-item, lower-alpha) ") ";
}

.statement dl.enumerate-enumitem,
.solution dl.enumerate-enumitem,
.rubric dl.enumerate-enumitem,
.problem-info dl.enumerate-enumitem {
  margin: 0.45em 0 0.75em;
}

.statement dl.enumerate-enumitem dt,
.solution dl.enumerate-enumitem dt,
.rubric dl.enumerate-enumitem dt,
.problem-info dl.enumerate-enumitem dt {
  float: left;
  clear: left;
  width: 2.1em;
  margin: 0;
  white-space: nowrap;
  font-weight: 600;
}

.statement dl.enumerate-enumitem dd,
.solution dl.enumerate-enumitem dd,
.rubric dl.enumerate-enumitem dd,
.problem-info dl.enumerate-enumitem dd {
  margin: 0 0 0.35em 2.1em;
  padding: 0;
}

.statement img,
.solution img,
.rubric img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.problem-score-delta {
  margin-left: 6px;
  font-size: 0.72em;
  font-weight: 600;
}

.problem-score-delta-positive {
  color: #2a9d57;
}

.problem-score-delta-negative {
  color: #b42318;
}

.problem-subscore-badge {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 4px;
  padding: 4px 10px;
  background-color: #ffffff;
  color: #333;
  border: 1px solid #e8ddd8;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.problem-subscore-delta {
  margin-left: 4px;
  font-size: 0.8em;
  font-weight: 700;
}

.problem-subpart-disabled {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.problem-subpart-disabled .problem-subscore-badge {
  background-color: #f4f0ee;
}


.solution {
  font-size: x-large;
  display: none;
}

.rubric {
  font-size: x-large;
  display: none;
}

.collection-side-panel p {
  margin: 0 0 12px;
}

.collection-side-controls {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #eadad4;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdfa 0%, #fff6f1 100%);
}

.collection-side-checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #4a2c28;
  font-weight: 600;
}

.collection-side-checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: #8b1e16;
}

/* .solution-box {
} */

.problem-pdf-tools {
  margin: 1rem 0 0;
}

.collection-side-panel .problem-pdf-tools {
  margin-top: 0.9rem;
}

.problem-pdf-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.collection-side-panel .problem-pdf-toolbar {
  justify-content: flex-start;
}

.problem-seed-input {
  width: 6.5rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(139, 30, 22, 0.3);
  border-radius: 6px;
  font-size: 0.82rem;
  color: #2a2a2a;
  background: #fff;
  transition: border-color 0.15s;
  vertical-align: middle;
}

.problem-seed-input:focus {
  outline: none;
  border-color: #c0392b;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

/* hide number spinner arrows */
.problem-seed-input::-webkit-outer-spin-button,
.problem-seed-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.problem-seed-input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.problem-random-indicator-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  line-height: 1;
  transition: transform 0.15s;
}

.problem-random-indicator-button:hover {
  transform: rotate(-20deg) scale(1.15);
}

.problem-random-indicator-button:active {
  transform: rotate(25deg) scale(0.95);
}

.problem-variable-indicator-button:hover {
  transform: rotate(12deg) scale(1.12);
}

.problem-variable-indicator-button:active {
  transform: rotate(-10deg) scale(0.95);
}

.problem-variable-dialog {
  border: 1px solid rgba(139, 30, 22, 0.28);
  border-radius: 10px;
  width: min(28rem, calc(100vw - 2rem));
  padding: 0.7rem 0.8rem 0.85rem;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.25);
}

.problem-variable-dialog::backdrop {
  background: rgba(0, 0, 0, 0.3);
}

.problem-variable-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.problem-variable-dialog-close {
  border: 1px solid rgba(139, 30, 22, 0.24);
  border-radius: 6px;
  background: #fff;
  color: #8b1e16;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.problem-variable-editor-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5d2b26;
}

.problem-variable-editor-fields {
  display: grid;
  gap: 0.3rem;
}

.problem-variable-editor-row {
  display: grid;
  grid-template-columns: 1fr 7rem;
  gap: 0.45rem;
  align-items: center;
}

.problem-variable-editor-name {
  font-size: 0.74rem;
  color: #5d2b26;
}

.problem-variable-editor-input {
  width: 100%;
  padding: 0.2rem 0.35rem;
  border: 1px solid rgba(139, 30, 22, 0.35);
  border-radius: 5px;
  font-size: 0.78rem;
  color: #2a2a2a;
}

.problem-pdf-button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b1e16 0%, #c0392b 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(139, 30, 22, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
}

.problem-pdf-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(139, 30, 22, 0.28);
}

.problem-pdf-button-secondary {
  background: #fff;
  color: #8b1e16;
  border: 1px solid rgba(139, 30, 22, 0.18);
  box-shadow: 0 8px 20px rgba(139, 30, 22, 0.08);
  text-decoration: none;
}

.problem-pdf-button-secondary:hover {
  box-shadow: 0 12px 24px rgba(139, 30, 22, 0.14);
}

.problem-pdf-button-secondary .problem-pdf-button-icon {
  background: rgba(139, 30, 22, 0.1);
}

.problem-pdf-button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.problem-pdf-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.problem-pdf-button-icon-only {
  width: 3rem;
  height: 3rem;
  padding: 0;
  justify-content: center;
  gap: 0;
}

.problem-pdf-button-icon-only .problem-pdf-button-icon {
  width: 100%;
  height: 100%;
  background: transparent;
}

.problem-pdf-button-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.problem-pdf-status {
  margin: 0.85rem 0 0;
  text-align: right;
}

.collection-side-panel .problem-pdf-status {
  text-align: left;
}

.problem-latex-editor {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d9d9d9;
  border-radius: 16px;
  background: #fcf8f6;
}

.problem-latex-editor-label {
  display: block;
  margin-bottom: 0.55rem;
  color: #6f1c14;
  font-weight: 700;
}

.problem-latex-editor-textarea {
  width: 100%;
  min-height: 18rem;
  padding: 0.9rem 1rem;
  border: 1px solid #d8c7c1;
  border-radius: 12px;
  background: #fff;
  color: #2d201d;
  font: 0.95rem/1.45 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  resize: vertical;
}

.problem-latex-editor-textarea:focus {
  outline: 2px solid rgba(139, 30, 22, 0.18);
  border-color: #b94c3d;
}

.problem-pdf-status.is-error {
  color: #9f2d20;
}

.problem-pdf-viewer {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #f8f8f8;
}

.problem-pdf-viewer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.problem-pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.problem-pdf-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.problem-pdf-page canvas {
  width: 100%;
  max-width: 900px;
  height: auto;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.problem-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--myborder, #d3d3d3);
  background: var(--mybackground, #ffffff);
  color: var(--mytext, #333333);
  font-size: 19px;
  line-height: 1;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.problem-edit-button:hover {
  color: var(--myred, #800000);
  border-color: var(--myred, #800000);
  background: var(--mybackground, #ffffff);
}

.problem-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 1rem 0;
}

.problem-admin-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.problem-detail-actions .collection-add-wrapper,
.problem-detail-actions .collection-add-wrapper-superuser {
  position: relative;
  right: auto;
  bottom: auto;
}

.problem-detail-actions .visibility-icon {
  position: relative;
  right: auto;
  bottom: auto;
}

.problem-detail-actions .problem-edit-button,
.problem-detail-actions .problem-edit-button:hover {
  position: relative;
  right: auto;
  bottom: auto;
  margin-left: 0;
}

.problem-detail-actions .visibility-dropdown {
  bottom: 44px;
  right: 0;
}

@media (max-width: 720px) {
  .problem-detail-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .problem-pdf-toolbar {
    justify-content: stretch;
  }

  .problem-pdf-button {
    justify-content: center;
  }

  .problem-pdf-button:not(.problem-pdf-button-icon-only) {
    width: 100%;
  }

  .problem-pdf-status {
    text-align: left;
  }
}