/* Collections: the More menu's picker, /collections, and a collection's page
   (thread cards and the Latest activity timeline). */

/* Forms inside gradient popups: a white pill field and a mint Save */

.collection-form { margin: 0; }

.collection-form__input {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 15.4px;
  border: 0;
  border-radius: 22px;
  background: var(--color-sheet);
  color: var(--color-ink);
  font: 400 15.4px/21.56px var(--font);
}

.collection-form__input:focus { outline: none; box-shadow: 0 0 0 2px rgb(var(--sheet-rgb) / 0.5); }

.collection-form__actions { display: flex; align-items: center; gap: 8.8px; margin-top: 11px; }

.collection-form__save {
  padding: 5.28px 14.08px;
  border: 0;
  border-radius: 33px;
  background: var(--color-accent);
  color: #fff;
  font: 500 15.4px/21.56px var(--font);
  cursor: pointer;
}

.collection-form__save:hover { filter: brightness(1.05); }

.collection-form__cancel {
  padding: 5.28px 8.8px;
  border: 0;
  background: none;
  color: var(--popup-ink);
  font: 500 15.4px/21.56px var(--font);
  cursor: pointer;
  opacity: 0.8;
}

.collection-form__cancel:hover { opacity: 1; }

/* The picker (More → Add thread to Collection) */

.collection-picker__bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8.8px; margin: 0 0 4.4px; }

.collection-picker__filter {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  border: 1px solid rgb(var(--sheet-rgb) / 0.7);
  border-radius: 33px;
  background: rgb(var(--sheet-rgb) / 0.12);
}

.collection-picker__filter:focus-within { border-color: var(--color-sheet); background: rgb(var(--sheet-rgb) / 0.2); }
.collection-picker__filter-icon { position: absolute; left: 11px; width: 16px; height: 16px; pointer-events: none; }

.collection-picker__filter-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 11px 0 33px;
  border: 0;
  background: none;
  color: var(--popup-ink);
  font: 500 15.4px/21.56px var(--font);
  -webkit-appearance: none;
  appearance: none;
}

.collection-picker__filter-input::placeholder { color: var(--popup-muted); }
.collection-picker__filter-input:focus { outline: none; }
.collection-picker__filter-input::-webkit-search-cancel-button { display: none; }

.collection-picker__new {
  height: 34px;
  border: 0;
  border-radius: 33px;
  background: var(--color-sheet);
  color: var(--color-accent);
  font: 500 15.4px/21.56px var(--font);
  cursor: pointer;
}

.collection-picker__new:hover { background: var(--color-soft); color: var(--popup-ink); }

.collection-picker__create[hidden], [data-collection-picker-target="list"][hidden] { display: none; }

.collection-picker__form { display: contents; }
.collection-picker__form[hidden] { display: none; }

.topic-more .collection-picker__row { height: 36px; }
.collection-picker__row--chosen, .topic-more .collection-picker__row--chosen { background: rgb(var(--shade-rgb) / 0.12); }
.collection-picker__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.collection-picker__empty { margin: 4.4px 8.9px 6.6px; color: var(--popup-muted); }
.collection-picker__empty[hidden] { display: none; }

/* /collections: a narrow sheet with the + New pill at its top right */

.sheet.collections-sheet { width: min(704px, 100%); }

.collections-sheet__title { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 29.48px; }
/* Measured 2026-10-18: the reference's icon is drawn 33px in a 33px footprint,
   11px from the text, its middle 24.6px below the title's top */
.collections-sheet__title-icon { flex: none; width: 40.7px; height: 40.7px; margin: 0 -3.85px 0 7.15px; translate: 0 3px; } /* and 11px before it, as the reference */

.collections-new { position: absolute; top: 22px; right: 22px; z-index: 2; }
.collections-new > summary { list-style: none; }
.collections-new > summary::-webkit-details-marker { display: none; }

.collections-new__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 37px;
  padding: 5.28px 14.08px 5.28px 38.72px;
  border: 1px solid var(--color-accent);
  border-radius: 33px;
  background: transparent;
  color: var(--color-accent);
  font-size: 17.6px;
  line-height: 24.64px;
  font-weight: 500;
  cursor: pointer;
}

.collections-new__pill:hover, .collections-new[open] .collections-new__pill { background: var(--color-soft); color: var(--color-ink); }
.collections-new__pill:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.collections-new__icon { position: absolute; left: 9.65px; width: 24.7px; height: 24.7px; } /* the plus drawn 16.5px */

.collections-new__menu { right: 0; }

.collections-list { display: flex; flex-direction: column; gap: 2.2px; margin-inline: -17.6px; padding-bottom: 55px; }

.collections-list__item { position: relative; display: flex; align-items: center; }

.collections-list__row {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 11px;
  width: 100%;
  min-height: 60px;
  padding: 14.52px 58.52px 14.52px 66px;
  border-radius: 8.8px;
  color: var(--color-ink);
  font-size: 22px;
  line-height: 30.8px;
  font-weight: 500;
  text-decoration: none;
}

.collections-list__row:hover { background: rgb(48 114 221 / 0.05); }
.collections-list__row:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }
.collections-list__icon { position: absolute; top: 50%; left: 16.5px; width: 33px; height: 33px; translate: 0 -50%; color: var(--color-ink); } /* drawn 24.8px */
.collections-list__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.collections-list__delete-form { position: absolute; right: 15.4px; margin: 0; }

.collections-list__delete {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.collections-list__delete svg { width: 21.2px; height: 21.2px; } /* drawn 15.4px tall */
.collections-list__delete:hover { background: rgb(var(--ink-rgb) / 0.06); color: rgb(201 36 0); }
.collections-list__delete:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }

.collections-blank { display: flex; justify-content: center; padding: 22px 0 55px; }

.collections-blank__card {
  width: min(534px, 100%);
  margin: 0;
  padding: 61.6px;
  border-radius: 46.2px;
  background: var(--color-sheet);
  box-shadow: rgb(var(--warm-rgb) / 0.3) 0 0 33px 0;
  font-size: 30.8px;
  line-height: 43.12px;
  font-weight: 400;
  text-align: center;
}

/* A collection's page */

.collection { padding-bottom: 88px; }

.collection__header { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.collection__header > .avatar { --avatar-size: 40px; font-size: 15px; }

.collection__rename, .collection__options { position: relative; }
.collection__rename > summary, .collection__options > summary { list-style: none; cursor: pointer; }
.collection__rename > summary::-webkit-details-marker, .collection__options > summary::-webkit-details-marker { display: none; }

.collection__summary { border-radius: 13.2px; }
.collection__summary:hover .collection__name span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.collection__summary:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }

.collection__name {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  font-size: 44px;
  line-height: 44px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

/* As the reference's: 11px, the cube drawn 33px tall in a 33px footprint, 11px, the name */
.collection__name-icon { flex: none; width: 41.7px; height: 41.7px; margin: 0 -4.35px 0 6.65px; translate: 0 2.4px; color: var(--color-ink); }

.collection__menu { left: 50%; right: auto; translate: -50% 0; }

/* Options, alone in a toolbar pinned to the bottom, as HEY's */
.topic-toolbar.collection-toolbar { width: auto; }
.collection-toolbar .topic-toolbar__content > details { flex: none; width: 77px; }
.collection__options-menu { min-width: 292px; }

/* Caps divider and divider heading */

.collection__caps {
  position: relative;
  margin: 29px 0 17px;
  font-size: 15.4px;
  line-height: 15.4px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.collection__caps::before { content: ""; position: absolute; inset: 7.7px 0 auto; height: 1px; background: var(--color-rule); }
.collection__caps span { position: relative; padding: 0 7.7px; background: var(--color-sheet); }

.collection__divider {
  position: relative;
  margin: 29px 0 45px;
  font-size: 15.4px;
  line-height: 15.4px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.collection__divider::before { content: ""; position: absolute; inset: 7.7px 0 auto; height: 1px; background: var(--color-rule); }
.collection__divider span { position: relative; padding: 0 7.7px; background: var(--color-sheet); }

/* Thread cards */

.collection__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }

.collection-card {
  position: relative;
  width: 209px;
  height: 118px;
  border-radius: 11px;
  background: var(--color-sheet);
  box-shadow: rgb(var(--warm-rgb) / 0.5) 0 0 22px 0;
}

.collection-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14.8px 30.8px 14.8px 14.8px;
  border-radius: inherit;
  color: var(--color-ink);
  text-decoration: none;
}

.collection-card__link:hover .collection-card__title { text-decoration: underline; text-underline-offset: 3px; }
.collection-card__link:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }

.collection-card__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 17.6px;
  line-height: 21.12px;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.collection-card__count { font-size: 15.4px; line-height: 20.02px; }
.collection-card__people { position: absolute; left: 9.9px; bottom: 11px; display: flex; }
.collection-card__people .avatar { --avatar-size: 17.8px; font-size: 7px; line-height: 1; box-shadow: var(--color-sheet) 0 0 0 1px; }
.collection-card__people .avatar + .avatar { margin-left: -4.95px; }

.avatar--collection { --avatar-size: 26.4px; font-size: 10px; box-shadow: var(--color-sheet) 0 0 0 2px; }

.collection-card__remove-form { position: absolute; top: 6.6px; right: 6.6px; margin: 0; }

.collection-card__remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-muted);
  font: 400 19.8px/1 var(--font);
  cursor: pointer;
  opacity: 0;
}

.collection-card:hover .collection-card__remove, .collection-card__remove:focus-visible { opacity: 1; }
.collection-card__remove:hover { background: rgb(var(--ink-rgb) / 0.06); color: var(--color-ink); }
.collection-card__remove:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }

@media (hover: none) { .collection-card__remove { opacity: 1; } }

/* Latest activity: a central line, a purple blob per day, cards alternating sides */

.collection-timeline, .collection-timeline__entries { margin: 0; padding: 0; list-style: none; }

.collection-timeline { position: relative; display: flex; flex-direction: column; gap: 33px; }
.collection-timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #3072dd; }

.collection-timeline__day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 19px; }

.collection-timeline__date {
  position: relative;
  min-width: 99px;
  padding: 4px 19.8px;
  border-radius: 22px;
  background: #3072dd;
  color: #fff;
  font-size: 19.8px;
  line-height: 19px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.collection-timeline__entries { display: flex; flex-direction: column; gap: 22px; width: 100%; }

.collection-timeline__entry { position: relative; width: 465px; max-width: calc(50% - 19px); }
.collection-timeline__entry--left { align-self: flex-start; }
.collection-timeline__entry--right { align-self: flex-end; }

/* An email on the timeline, as HEY's: from/to, the subject, and the message
   itself clipped at 550px with See more… */
.collection-entry {
  padding: 41.8px 19.8px 19.8px;
  border-radius: 29.7px;
  background: var(--color-sheet);
  box-shadow: rgb(var(--warm-rgb) / 0.5) 0 0 33px 0;
  color: var(--color-ink);
}

.collection-entry__header { display: flex; align-items: flex-start; }
.collection-entry__avatar { flex: none; width: 59px; }
.collection-entry__avatar .avatar { --avatar-size: 50px; font-size: 18px; box-shadow: none; }
.collection-entry__who { flex: 1; min-width: 0; padding: 5px 0 19.8px; color: rgb(var(--ink-rgb) / 0.66); font-size: 15.4px; line-height: 20.02px; overflow-wrap: anywhere; }
.collection-entry__from, .collection-entry__to { display: block; }
.collection-entry__who a { color: inherit; text-decoration: none; }
.collection-entry__who a:hover { text-decoration: underline; }
.collection-entry__time { flex: none; margin: 2px 0 0 8.8px; color: rgb(var(--ink-rgb) / 0.66); font-size: 17.6px; line-height: 24.64px; }

.collection-entry__body { position: relative; }
.collection-entry__clip { max-height: 550px; padding-bottom: 55px; }
.collection-entry__body.feed-item--expanded .collection-entry__clip { max-height: none; }

.collection-entry__subject { display: block; margin-bottom: 20px; color: inherit; font-size: 19.8px; line-height: 23.76px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.collection-entry__subject:hover { text-decoration: underline; text-underline-offset: 3px; }

.collection-entry__expander { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 12.375px 0 6.19px; }
.collection-entry__body.feed-item--expanded .collection-entry__expander { position: static; }

.collection-entry__more {
  padding: 4.62px 12.32px;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 33px;
  background: var(--color-sheet);
  color: rgb(var(--ink-rgb) / 0.66);
  font: 500 15.4px/21.56px var(--font);
  cursor: pointer;
}

.collection-entry__more[hidden] { display: none; }
.collection-entry__more:hover { color: var(--color-ink); }
.collection-entry__more:focus-visible { outline: none; box-shadow: 0 0 0 2px #a4d2ff; }

/* Below ~900px the timeline runs down the left in a single column */

@media (max-width: 900px) {
  .collection-timeline::before { left: 13px; }
  .collection-timeline__day { align-items: flex-start; }
  .collection-timeline__date { min-width: 0; }
  .collection-timeline__entry, .collection-timeline__entry--left, .collection-timeline__entry--right {
    align-self: stretch;
    width: auto;
    max-width: none;
    margin-left: 33px;
  }
}

/* Collection notes, as HEY's: the green note form under Latest activity
   (the Options toolbar steps aside while it's open), and notes on the
   timeline as full-width pale blue cards. */
.collection:has(#collection_note_composer form) .collection-toolbar { display: none; }
.collection-note-composer { display: block; }
.collection-note-form { position: relative; display: flex; gap: 9px; margin: 0 0 22px; padding: 17.6px 17.6px 17.6px 0; }
.collection-note-form::before { content: ""; position: absolute; inset: 0 0 0 33px; z-index: 0; border-radius: 0 33px; background: linear-gradient(135deg, rgb(41 152 80 / 0.25) 0%, rgb(214 211 209 / 0.1) 100%); }
.collection-note-form > * { position: relative; z-index: 1; }
.collection-note-form > .avatar { --avatar-size: 50px; flex: none; font-size: 18px; }
.collection-note-form__main { flex: 1; min-width: 0; }
.collection-note-form trix-toolbar { display: none; }
.collection-note-form__editor { min-height: 165px; padding: 16.5px 9.9px 9.9px; border: 0; border-radius: 0 27.5px 27.5px; background: transparent; font-size: 19.8px; line-height: 27.72px; }
.collection-note-form__editor:focus { outline: none; box-shadow: 0 0 0 2px rgb(164 210 255); }
.collection-note-form__editor:empty::before { color: rgb(var(--ink-rgb) / 0.6); }
.collection-note-form__help { margin: 11px 0; font-size: 17.6px; line-height: 24.64px; }
.collection-note-form__actions { display: flex; align-items: center; justify-content: space-between; }
.collection-note-form__discard { display: grid; place-items: center; width: 40px; height: 40px; box-sizing: border-box; border: 1px solid var(--popup-line); border-radius: 50%; color: var(--color-ink); }
.collection-note-form__discard svg { width: 20px; height: 20px; }

/* A posted note, as the reference's (measured): an email-sized green card
   centred on the timeline line, square at the bottom right */
.collection-timeline__entry--note { align-self: center; }
.collection-note { position: relative; box-sizing: border-box; width: 464.6px; max-width: 100%; padding: 41.8px 20.8px 19.8px; border-radius: 33px 33px 0 33px; background: linear-gradient(135deg, rgb(215 239 222) 0%, rgb(242 253 249) 100%); box-shadow: rgb(var(--warm-rgb) / 0.5) 0 0 33px 0; color: var(--color-ink); }
.collection-note__header { display: flex; align-items: flex-start; gap: 10.9px; }
.collection-note__header > .avatar { --avatar-size: 49.5px; flex: none; margin-top: 1px; font-size: 18px; box-shadow: none; }
.collection-note__who { flex: 1; min-width: 0; padding-top: 1px; color: rgb(var(--ink-rgb) / 0.66); font-size: 15.4px; line-height: 20px; }
.collection-note__sender { font-weight: 400; }
.collection-note__sender a { color: inherit; text-decoration: none; }
.collection-note__meta { display: flex; align-items: center; gap: 6.6px; margin-top: 5px; color: rgb(var(--ink-rgb) / 0.66); font-size: 17.6px; line-height: 20.5px; }
.collection-note__menu { position: relative; }
.collection-note__more { display: grid; place-items: center; width: 26px; height: 20.5px; color: rgb(var(--ink-rgb) / 0.66); list-style: none; cursor: pointer; }
.collection-note__more::-webkit-details-marker { display: none; }
.collection-note__more svg { width: 20px; height: 20px; }
.collection-note__popup { top: calc(100% + 8px); right: -40px; left: auto; width: 330px; }
.collection-note__body { margin-top: 10.3px; font-size: 19.8px; line-height: 24.64px; }

@media (max-width: 640px) {
  .collection__name { font-size: 32px; line-height: 38px; }
  .collection__name-icon { width: 26px; height: 34px; }
  .collection__cards { gap: 13.2px; }
  .collection-card { width: calc(50% - 6.6px); min-width: 150px; }
  .collection-entry { padding: 22px 15.4px 15.4px; border-radius: 22px; }
  .collections-new { top: 16px; right: 16px; }
  .collections-sheet__title { margin-top: 22px; }
  .collections-list__row { padding: 11px 50px 11px 50px; font-size: 19.8px; }
  .collections-list__icon { left: 11.5px; }
  .collections-list__delete-form { right: 11px; }
  .collections-blank__card { padding: 33px 24px; border-radius: 30px; font-size: 22px; line-height: 31px; }
}
