/* V106 · five-part, decision-first recap cells.
 *
 * Each card is a reading decision, not an equal-height paper sheet:
 * intact 16:10 evidence → identity → field conclusion → full short summary →
 * three topics and two exits. No fixed-height filler and no caption over art. */

.notes-screen .curated-note__identity,
.notes-screen .curated-note__bottom {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.notes-screen .curated-note__verdict {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 9px 11px 10px;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--notes-ink);
}

.notes-screen .curated-note__verdict--green {
  border-color: color-mix(in srgb, var(--place, #147d69) 18%, transparent);
  background: color-mix(in srgb, var(--place, #147d69) 8%, var(--notes-card));
}

.notes-screen .curated-note__verdict--plum {
  border-color: color-mix(in srgb, var(--notes-purple) 16%, transparent);
  background: color-mix(in srgb, var(--notes-purple) 7%, var(--notes-card));
}

.notes-screen .curated-note__verdict > span {
  font: 760 9px/1.25 "Instrument Local", "PingFang SC", sans-serif;
  letter-spacing: .07em;
}

.notes-screen .curated-note__verdict--green > span {
  color: color-mix(in srgb, var(--place, #147d69) 88%, var(--notes-ink));
}

.notes-screen .curated-note__verdict--plum > span {
  color: color-mix(in srgb, var(--notes-purple) 86%, var(--notes-ink));
}

.notes-screen .curated-note__verdict > strong {
  color: color-mix(in srgb, var(--notes-ink) 92%, transparent);
  font: 660 12.5px/1.5 "Instrument Local", "PingFang SC", sans-serif;
}

/* Source relation and credit stay in data attributes and alt text. The card
 * action reaches the source; a black strip must never cover the photograph. */
.notes-screen .curated-note__media figcaption {
  display: none !important;
}

.notes-screen .curated-note__media-source-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  max-width: calc(100% - 16px);
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: #fff;
  background: rgba(25, 32, 28, .72);
  font: 650 9px/1.2 "Instrument Local", "PingFang SC", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.notes-screen .curated-note__source {
  border-bottom: 0;
}

@media (min-width: 720px) {
  .notes-screen .notes-section-head {
    min-height: 58px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-notes__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note,
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note:nth-child(even):not(.curated-note--text-only) {
    display: grid;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    align-self: start;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "media"
      "identity"
      "verdict"
      "summary"
      "bottom";
    grid-template-rows: auto auto auto auto auto;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--notes-v88-line);
    border-radius: 12px 12px 0 0;
    grid-area: media;
    place-items: center;
    background: color-mix(in srgb, var(--notes-paper) 90%, #d8d2c8 10%);
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media-frame,
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media--portrait .curated-note__media-frame {
    position: relative;
    display: grid;
    width: min(100%, 384px);
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
    place-items: center;
    overflow: hidden;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media img,
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media--portrait img {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    min-height: 0;
    margin: 0 auto;
    inset: 0;
    object-fit: contain;
    object-position: var(--artwork-focus, 50% 50%);
    image-rendering: auto;
    transform: none;
    background: color-mix(in srgb, var(--notes-paper) 92%, #d8d2c8 8%);
  }

  /* This source photograph is 640px wide. At DPR=2 it must remain within a
   * 320 CSS-pixel rendering budget even when the evidence mat is wider. */
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media img[width="640"] {
    width: min(100%, 320px);
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__identity {
    margin: 11px 14px 0;
    grid-area: identity;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__meta {
    display: flex;
    min-width: 0;
    margin: 0 0 6px;
    gap: 6px;
    overflow: visible;
    flex-wrap: wrap;
    font-size: 9px;
    line-height: 1.3;
    letter-spacing: .035em;
    white-space: normal;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__meta > * {
    overflow: visible;
    text-overflow: clip;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__identity h2 {
    display: block;
    margin: 0 0 4px;
    overflow: visible;
    color: var(--notes-ink);
    font-size: 19px;
    line-height: 1.28;
    letter-spacing: -.025em;
    -webkit-line-clamp: unset;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__identity .curated-note__byline {
    display: block;
    margin: 0 0 9px;
    overflow: visible;
    color: var(--notes-muted);
    font-size: 11px;
    line-height: 1.42;
    -webkit-line-clamp: unset;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__verdict {
    margin: 0 14px 9px;
    grid-area: verdict;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__summary {
    display: block;
    margin: 0 14px 9px;
    overflow: visible;
    color: color-mix(in srgb, var(--notes-ink) 80%, transparent);
    font: 400 12.5px/1.55 "Instrument Local", "PingFang SC", sans-serif;
    text-align: left;
    grid-area: summary;
    -webkit-line-clamp: unset;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__bottom {
    margin: 0 14px 7px;
    grid-area: bottom;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__tags {
    display: flex;
    max-height: none;
    margin: 0 0 6px;
    gap: 4px;
    overflow: visible;
    flex-wrap: wrap;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__tags li {
    min-width: 0;
    padding: 3px 6px;
    overflow: visible;
    font-size: 8.5px;
    white-space: normal;
    text-overflow: clip;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__footer {
    min-height: 44px;
    margin: 0;
    padding-top: 4px;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__read,
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__source {
    font-size: 10px;
    white-space: nowrap;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .personal-notes {
    margin-top: 12px;
  }

}

@media (min-width: 1200px) {
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-notes__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1680px) {
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-notes__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* A common laptop/browser shape is very wide but only about 785 CSS pixels
 * tall. Keep all four editorial cells above the fixed matrix footer without
 * shrinking any text or clipping a module; only the evidence stage and the
 * section's outer rhythm become slightly tighter. */
@media (min-width: 1680px) and (max-height: 900px) {
  .notes-screen .notes-main {
    padding-top: 22px;
  }

  .notes-screen .notes-section-head {
    min-height: 54px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media-frame,
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media--portrait .curated-note__media-frame {
    width: min(100%, 304px);
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .personal-notes {
    margin-top: 10px;
  }
}

@media (max-width: 719px) {
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-notes__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__identity {
    display: flex;
    margin: 15px 18px 0;
    grid-area: meta;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__bottom {
    display: flex;
    margin: 0 18px;
    grid-area: tags;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__verdict {
    margin: 0 18px 10px;
    grid-area: quote;
  }

  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media img,
  .notes-screen .notes-index[data-notes-layout="grid"] .curated-note__media--portrait img {
    object-fit: contain;
    background: color-mix(in srgb, var(--notes-paper) 92%, #d8d2c8 8%);
  }
}

html[data-theme="dark"] .notes-screen .curated-note__verdict--green {
  border-color: color-mix(in srgb, var(--place, #147d69) 42%, var(--notes-v88-line));
  background: color-mix(in srgb, var(--place, #147d69) 18%, var(--notes-card));
}

html[data-theme="dark"] .notes-screen .curated-note__verdict--plum {
  border-color: color-mix(in srgb, var(--notes-purple) 42%, var(--notes-v88-line));
  background: color-mix(in srgb, var(--notes-purple) 18%, var(--notes-card));
}

@media (forced-colors: active) {
  .notes-screen .curated-note__verdict {
    border-color: CanvasText;
    color: CanvasText;
    background: Canvas;
  }
}
