/* « Mes exercices » — the pupil's page (src/copies/page.ts), the parent's
   « Exercices envoyés » (src/copies/parent.ts) and the hub link's badge
   (play/copies.js). Theme tokens only; the form reuses grades.css. */

.cp-box,
.cp-list {
  margin: 14px 0;
}
textarea.cp-note-input {
  min-height: 4.5em;
  max-width: 100%;
  padding: 0.5rem 0.7rem;
  resize: vertical;
  font: inherit;
  font-size: 1.05rem; /* ≥16px: no iOS zoom on focus */
  color: var(--text-main);
  background: color-mix(in srgb, var(--overlay) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--overlay) 25%, transparent);
  border-radius: calc(var(--radius-k, 1px) * 8);
  box-sizing: border-box;
}
textarea.cp-note-input:focus {
  outline: none;
  border-color: var(--primary-neon);
}
.cp-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cp-pick {
  min-height: 48px;
}
.cp-tip {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cp-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.cp-thumb {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--radius-k, 1px) * 10);
  background: var(--glass-bg);
  color: var(--text-main);
  text-decoration: none;
}
.cp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cp-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 6px;
  font-size: 0.8rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.cp-thumb figcaption {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
}
.cp-drop {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.cp-progress {
  width: 100%;
  height: 10px;
  accent-color: var(--primary-neon);
}
.cp-progress[hidden],
.cp-problem[hidden],
.cp-toast[hidden] {
  display: none;
}

.cp-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--radius-k, 1px) * 12);
  background: var(--glass-bg);
}
.cp-item.cp-corrige {
  border-color: color-mix(
    in srgb,
    var(--good, #2e9d5b) 55%,
    var(--glass-border)
  );
}
.cp-item.cp-en_cours {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--glass-border));
}
.cp-item > * {
  margin: 0;
}
.cp-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.cp-subject {
  font-size: 0.8rem;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.cp-title {
  overflow-wrap: anywhere;
}
.cp-status {
  font-weight: 600;
}
.cp-note {
  color: var(--text-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.cp-result {
  padding: 10px 12px;
  border-radius: calc(var(--radius-k, 1px) * 10);
  background: color-mix(in srgb, var(--good, #2e9d5b) 10%, transparent);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.cp-train {
  align-self: flex-start;
  text-decoration: none;
}
.cp-item .gr-secondary {
  align-self: flex-start;
}
.cp-waiting {
  font-weight: 600;
  color: var(--gold);
}

/* Hub: « Mes exercices » link (hub.html .hub-links) and its badge. */
.copies-badge {
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--good, #2e9d5b);
  color: var(--on-accent, #fff);
  font-size: 0.75rem;
  font-weight: 700;
}
.copies-badge[hidden] {
  display: none;
}
