/* Copyright (C) Rein Ytterberg */
.evaluation {
  background: #f7f8fb;
}
.evaluation-header {
  background: #151b2b;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 4vw;
  gap: 20px;
}
.evaluation-header img {
  display: block;
}
.evaluation-header span {
  font-size: 14px;
}
.evaluation .opening {
  max-width: 1500px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 28px;
  padding: 12px 4vw 0;
}
.evaluation .opening > img {
  width: 100%;
  height: auto;
  display: block;
  grid-column: 2;
  grid-row: 1;
}
.opening-copy {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}
.evaluation h1 {
  font-size: clamp(25px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.6px;
  margin: 0;
}
.question-column {
  min-width: 0;
}
.evaluation .evaluation-subtitle {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}
.evaluation .question-column > .privacy {
  font-size: 13px;
  margin: 12px 0 0;
}
.evaluation h2 {
  font-size: 25px;
  line-height: 1.2;
  margin: 0 0 10px;
}
.evaluation h3 {
  font-size: 18px;
  margin: 0;
}
.evaluation p {
  margin: 8px 0 16px;
}
.evaluation button {
  font: inherit;
  cursor: pointer;
  border-radius: 3px;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 700;
}
.evaluation button:focus-visible,
.evaluation a:focus-visible,
.evaluation input:focus-visible,
.evaluation textarea:focus-visible {
  outline: 3px solid #144bdd;
  outline-offset: 3px;
}
.evaluation .primary {
  background: #ed4b0a;
  color: white;
  border: 2px solid #ed4b0a;
  text-decoration: none;
  display: inline-block;
}
.evaluation .secondary {
  border: 1px solid #8a98ad;
  background: white;
  color: #151b2b;
  box-shadow: 0 2px 0 #d7dce5;
}
.evaluation button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}
.evaluation .quiet {
  border: 0;
  background: transparent;
  text-decoration: underline;
  padding: 3px;
  font-size: 13px;
}
.evaluation .privacy {
  font-size: 14px;
  margin-top: 20px;
}
.workspace {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
  padding: 24px 4vw 48px;
  align-items: start;
  scroll-margin-top: 15px;
}
.questions {
  background: white;
  padding: 24px;
  border-top: 4px solid #ed4b0a;
}
.step-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 13px;
}
.choices {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.evaluation .choice {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  background: white;
  border: 1px solid #a4afbf;
  box-shadow: 0 2px 0 #dce1ea;
  font-weight: 400;
  padding: 12px;
}
.choice .symbol {
  font-size: 25px;
  width: 34px;
  flex-shrink: 0;
  text-align: center;
}
.choice .tick {
  margin-left: auto;
  width: 23px;
  height: 23px;
  border: 1px solid #9ca8b9;
  text-align: center;
  flex-shrink: 0;
}
.evaluation .choice[aria-pressed="true"] {
  background: #172a46;
  border-color: #172a46;
  color: white;
}
.choice[aria-pressed="true"] .tick {
  background: #ed4b0a;
  border-color: #ed4b0a;
}
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}
.hint {
  font-size: 13px;
  color: #4d5b70;
}
.board {
  background: #e8edf3;
  padding: 20px;
  border: 1px solid #cad3df;
}
.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.board-heading h2 {
  font-size: 21px;
}
.board-heading p {
  font-size: 13px;
}
.findings {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  padding: 4px;
}
.findings > .hint {
  grid-column: 1 / -1;
}
.evaluation .finding {
  position: relative;
  min-width: 0;
  height: 74px;
  min-height: 74px;
  padding: 6px 3px;
  border: 1px solid #d4b766;
  border-top: 3px solid #dca528;
  background: #fff3c8;
  box-shadow: 0 2px 1px #00000018;
  font-size: 12px;
  line-height: 1.2;
  color: #151b2b;
  text-align: center;
  hyphens: auto;
  overflow-wrap: anywhere;
}
.evaluation .finding:nth-child(3n + 2) {
  background: #e4f2fd;
  border-color: #69a5cf;
}
.evaluation .finding:nth-child(3n + 3) {
  background: #e7f4e9;
  border-color: #6eae7a;
}
.evaluation .finding:hover {
  border-color: #151b2b;
  box-shadow: 0 3px 3px #00000028;
}
.note-indicator {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 13px;
}
.evaluation #board-dialog {
  max-width: 850px;
}
.review-details {
  margin-top: 24px;
}
.review-details summary {
  cursor: pointer;
  font-weight: 700;
}
#review-answers > div {
  padding: 10px 0;
  border-bottom: 1px solid #ccd5e0;
}
#review-answers dt {
  font-weight: 700;
}
#review-answers dd {
  margin: 5px 0 0;
  white-space: pre-line;
}
.board-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.board-actions button {
  flex: 1;
  font-size: 14px;
}
.ephemeral {
  font-size: 12px;
  margin-bottom: 0 !important;
}
.status {
  text-align: center;
}
.evaluation dialog {
  border: 0;
  border-radius: 4px;
  padding: 24px;
  max-width: 650px;
  width: calc(100% - 24px);
  max-height: 90dvh;
  overflow: auto;
  color: #151b2b;
}
.evaluation dialog::backdrop {
  background: #101c30bb;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.evaluation .close {
  background: #eef1f5;
  border: 0;
  font-size: 24px;
  line-height: 1;
}
.evaluation label {
  display: block;
  font-weight: 700;
  margin: 18px 0 6px;
  font-size: 15px;
}
.evaluation input:not([type="checkbox"]),
.evaluation textarea {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-size: 16px;
  border: 1px solid #8998ac;
  border-radius: 3px;
  background: white;
  color: #151b2b;
}
.evaluation textarea {
  resize: vertical;
}
.evaluation .check {
  display: flex;
  gap: 10px;
  align-items: start;
  font-weight: 400;
}
.check input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.note-tag {
  font-size: 12px;
  font-weight: 400;
  margin-left: 10px;
}
.share-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.arrival {
  animation: arrival 0.5s ease-out;
}
@keyframes arrival {
  from {
    transform: translate(-45px, 15px) rotate(-3deg);
    opacity: 0.1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.flight {
  position: fixed;
  background: #fff3c8;
  color: #151b2b;
  border: 1px solid #dca528;
  padding: 10px 14px;
  z-index: 9;
  pointer-events: none;
  font-size: 14px;
  max-width: 240px;
}
#expand-board {
  display: none;
}
@media (min-width: 850px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .board {
    position: sticky;
    top: 15px;
    max-height: calc(100dvh - 30px);
    overflow: auto;
  }
  .choices {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 849px) {
  .workspace {
    padding: 0 12px 24px;
    gap: 14px;
  }
  .board {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 12px;
  }
  .board-heading h2 {
    font-size: 16px;
  }
  .board-heading p {
    margin: 2px 0;
  }
  #expand-board {
    display: block;
    padding: 4px 10px;
    font-size: 12px;
    min-height: 36px;
  }
  .findings {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .board:not(.expanded) .findings {
    max-height: 80px;
    overflow-y: auto;
    margin-top: 8px;
  }
  .board:not(.expanded) .board-actions,
  .board:not(.expanded) .ephemeral {
    display: none;
  }
  .board.expanded {
    max-height: 65dvh;
    overflow: auto;
  }
  .questions {
    padding: 18px;
  }
  .choices {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .evaluation .choice {
    padding: 10px 8px;
    font-size: 14px;
    gap: 6px;
  }
  .choice .symbol {
    width: 22px;
    font-size: 20px;
  }
  .choice .tick {
    width: 18px;
    height: 18px;
  }
  .evaluation-header span {
    font-size: 12px;
    max-width: 115px;
  }
  .evaluation h2 {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Keep the board unobstructed; global site headers are sticky by default. */
.evaluation-header {
  position: relative;
  top: auto;
  z-index: 1;
}
@media (min-width: 850px) {
  .board {
    overflow: visible;
  }
  .findings {
    max-height: calc(100dvh - 290px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (min-width: 850px) and (max-width: 1050px) {
  .board .findings {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 370px) {
  .findings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#email-details {
  margin-top: 18px;
}
#email-details summary {
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 849px) {
  .evaluation .opening {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 12px 0;
  }
  .evaluation .opening .opening-copy {
    order: -1;
  }
  .evaluation .opening > img {
    width: 100%;
    max-width: 440px;
  }
  .evaluation .workspace {
    padding-top: 20px;
  }
  .evaluation .evaluation-subtitle {
    font-size: 17px;
  }
}

/* Keep the homepage navigation from covering the evaluation board. */
.home-with-evaluation > site-header {
  position: relative;
}

@media (max-width: 849px) {
  .board.empty #findings,
  .board.empty #board-count {
    display: none;
  }
  .evaluation .board-heading h2 {
    font-size: 16px;
    margin: 0;
  }
}

/* Compact desktop opening: preserve the whole image without letting its
   intrinsic height create an empty column above or below the introduction. */
@media (min-width: 850px) {
  .evaluation .opening > img {
    width: auto;
    max-width: 100%;
    max-height: 220px;
    justify-self: end;
  }
  .evaluation .workspace {
    padding-top: 16px;
  }
}

/* The customs checklist is essential content: never shrink it into a thumbnail.
   Keep the opening in one column, without empty space beside the title. */
.evaluation .opening {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding-top: 12px;
}
.evaluation .opening .opening-copy {
  order: -1;
  align-self: stretch;
}
.evaluation .opening h1 {
  font-size: clamp(25px, 2.3vw, 34px);
  line-height: 1.15;
  margin: 0;
}
.evaluation .opening > img {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  display: block;
}
.evaluation .workspace { padding-top: 16px; }
