.homework-desk {
  --hw-ink: #203f37;
  --hw-muted: #50685f;
  --hw-green: #185448;
  color: var(--hw-ink);
  width: min(100%, 68rem);
  margin-inline: auto;
}
.hw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(.1rem, 3vw, 2rem) 1rem;
}
.hw-header h1 { color: var(--hw-ink); line-height: 1; font-size: clamp(2.1rem, 5vw, 3.8rem); margin: 0 0 .55rem; }
.hw-header p, .hw-photo p, .hw-result p { margin: .4rem 0 1rem; color: var(--hw-muted); line-height: 1.5; }
.hw-portrait { flex: 0 0 clamp(5.8rem, 14vw, 10rem); aspect-ratio: 1; align-self: end; background: #f6df91; border-radius: 50%; overflow: hidden; }
.hw-portrait img { display: block; width: 120%; height: 140%; max-width: none; margin: 2% 0 0 -10%; object-fit: cover; object-position: top; }
.hw-columns { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(14rem, 1fr); gap: 1rem; align-items: start; }
.hw-paper, .hw-photo {
  min-width: 0; border: 1px solid #d7e0ce; border-radius: 1.4rem; background: #fffef8; padding: clamp(1.15rem, 3.5vw, 2.4rem);
}
.hw-paper { box-shadow: 0 4px 0 #e2e7d9; }
.hw-photo { background: #edf5ec; }
.hw-photo h2, .hw-step h2, .hw-result h2 { margin: .7rem 0; line-height: 1.2; font-size: clamp(1.4rem, 2.8vw, 2rem); }
.hw-photo h2 { margin-top: 0; font-size: 1.3rem; }
.homework-desk button, .hw-file, .hw-back {
  font: inherit; font-weight: 800; color: var(--hw-green); line-height: 1.2;
}
.homework-desk button, .hw-file {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem .9rem; border-radius: .8rem; border: 1px solid #b8cdbb; background: #fffef8; cursor: pointer;
}
.homework-desk button:hover, .hw-file:hover { background: #f1f5e8; }
.homework-desk :focus-visible, .hw-file:focus-within { outline: 3px solid #18718b; outline-offset: 3px; }
.homework-desk h2:focus:not(:focus-visible) { outline: 0; }
.hw-back { display: inline-block; margin-bottom: .6rem; padding: .4rem 0; }
.hw-subjects { display: inline-flex; padding: .22rem; background: #eaf0e3; border-radius: .85rem; margin-bottom: 1.4rem; }
.hw-subjects button { min-height: 44px; border-color: transparent; padding-inline: 1.2rem; border-radius: .65rem; background: transparent; }
.hw-subjects [aria-pressed="true"] { background: var(--hw-green); color: white; }
.hw-subjects [aria-pressed="true"]:hover { background: #104b40; }
.hw-paper label { display: block; font-weight: 850; font-size: 1.12rem; margin-bottom: .45rem; }
.hw-paper .hw-optional, .hw-paper .hw-answer-label { font-size: .98rem; }
.hw-paper .hw-optional { margin-top: .95rem; }
.hw-paper small { font-size: .88em; font-weight: 650; color: var(--hw-muted); }
.hw-paper input, .hw-paper textarea {
  display: block; width: 100%; max-width: 100%; min-height: 44px; border: 1.5px solid #a4bba9; border-radius: .8rem;
  color: var(--hw-ink); background: white; font: inherit; line-height: 1.45; padding: .7rem .85rem; box-sizing: border-box;
}
.hw-paper textarea { resize: vertical; }
.hw-paper input::placeholder, .hw-paper textarea::placeholder { color: #657b70; }
.hw-examples, .hw-choices, .hw-sounds, .hw-step-top { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.hw-examples { margin-top: .7rem; color: var(--hw-muted); font-size: .92rem; }
.hw-examples span { margin-inline-end: .2rem; }
.hw-examples button { font-size: .9rem; padding: .4rem .7rem; }
.hw-paper .hw-primary { margin-top: .9rem; background: var(--hw-green); border-color: var(--hw-green); color: white; padding: .72rem 1.1rem; }
.hw-paper .hw-primary:hover { background: #104b40; }
.hw-error:not(:empty), .hw-feedback:not(:empty) { color: #713d24; font-weight: 750; margin: .7rem 0 .1rem; }
.hw-error:empty, .hw-feedback:empty, [data-hw-photo-status]:empty { margin: 0; }
.hw-step-top { justify-content: space-between; color: var(--hw-muted); font-size: .88rem; font-weight: 800; }
.hw-step-top button { border: none; text-decoration: underline; background: transparent; }
.hw-equation, .hw-reading { margin: .8rem 0; padding: .9rem 1rem; border-radius: .85rem; overflow-wrap: anywhere; }
.hw-equation, .hw-result .hw-equation { background: #fff0bb; color: #4d3e19; font-size: clamp(1.5rem, 4vw, 2.15rem); font-weight: 900; }
.hw-reading, .hw-result .hw-reading { background: #f1f4e5; color: var(--hw-ink); font-size: 1.15rem; line-height: 1.55; }
.hw-reading-question { font-weight: 800; }
.hw-sounds { margin: .5rem 0 1rem; }
.hw-sounds button { min-width: 3rem; font-size: 1.3rem; }
.hw-sounds small { font-size: .7em; }
.hw-choices { margin-top: 1rem; }
.hw-hint { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid #dce3d6; }
.hw-hint p { margin: .7rem 0; line-height: 1.4; }
.hw-check { display: inline-grid; place-items: center; width: 3rem; height: 3rem; background: #dbefd8; border-radius: 50%; font-size: 1.5rem; }
.hw-result .hw-primary { margin-right: .5rem; }
.hw-result q, .hw-result strong, .hw-step q { overflow-wrap: anywhere; }
.hw-file { position: relative; width: fit-content; }
.hw-file input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.hw-photo [data-hw-photo-preview] img { width: 100%; max-height: 26rem; object-fit: contain; display: block; margin: .7rem 0; }
.hw-photo [data-hw-lines] button { margin: .35rem .2rem 0 0; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
@media (max-width: 650px) {
  .hw-columns { grid-template-columns: minmax(0, 1fr); }
  .hw-header { align-items: center; }
  .hw-header p { font-size: .95rem; }
  .hw-photo { padding: 1rem; }
  .hw-paper { padding: 1rem; }
}
.hw-photo button[hidden] { display: none; }
.hw-photo [data-hw-photo-preview] button { margin: .2rem .25rem .2rem 0; }
