/* Ideas: the board (head, quick capture, toolbar, the masonry of cards), a
   card, the top bar parts (.ideas-chrome), topics (chips, the picker, the
   topics sheet) and the panel an idea opens in (.ideas-panel: its dimmed
   page, size and motion; what's inside it is ideas-detail.css). Built from
   app.css's tokens and recipes, so dark mode follows them. */

/* ------------------------------------------------------------------- page */

.ideas {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.ideas__main {
  min-width: 0;
}

.ideas-board {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding-top: 8px;
}

/* -------------------------------------------------------------------- head */

/* The title and counts on the left; the sort, the archive and the view on the right. */
.ideas-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  min-width: 0;
}

.ideas-head__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ideas-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.ideas-head__title {
  font-size: 26px;
  font-weight: 510;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.ideas-head__count {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ideas-head__filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* With no filter on, the line (a live region) stays on the page, out of sight, so its first words are announced. */
.ideas-head__filter:has(.ideas-head__filter-text:empty) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ideas-head__clear {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--soft-2);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.ideas-head__clear:hover {
  background: var(--soft-3);
}

/* ----------------------------------------------------------------- toolbar */

.ideas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-width: 0;
}

.ideas-topics {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ideas-toolbar__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ideas-toolbar__menu.is-on,
.ideas-toolbar__archived.is-on {
  border-color: transparent;
  background: var(--soft-2);
}

.ideas-toolbar__archived svg,
.ideas-toolbar__sort > svg:first-child {
  width: 17px;
  height: 17px;
}

.ideas-toolbar__views .segmented__btn {
  padding: 0 12px;
}

.ideas-toolbar__views .segmented__btn svg {
  width: 17px;
  height: 17px;
}

/* ------------------------------------------------------------------- chips */

.ideas-chip {
  --topic: var(--ink);
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--topic) 9%, transparent);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.16s var(--ease-std), box-shadow 0.16s var(--ease-std), transform 0.16s var(--ease);
}

button.ideas-chip {
  cursor: pointer;
}

button.ideas-chip:hover {
  background: color-mix(in srgb, var(--topic) 16%, transparent);
}

button.ideas-chip:active {
  transform: scale(0.97);
}

.ideas-chip.is-active {
  background: color-mix(in srgb, var(--topic) 18%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--topic);
}

.ideas-chip__dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--topic);
}

.ideas-chip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ideas-chip__count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ideas-chip > svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

/* All: the ink itself, filled when on. */
.ideas-chip--all {
  background: var(--soft-2);
}

.ideas-chip--all.is-active {
  background: var(--ink);
  box-shadow: none;
  color: var(--bg);
}

.ideas-chip--all.is-active .ideas-chip__count {
  color: color-mix(in srgb, var(--bg) 65%, transparent);
}

.ideas-chip--add {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--muted);
}

button.ideas-chip--add:hover {
  background: var(--soft-1);
  color: var(--ink);
}

.ideas-chip--quiet {
  background: transparent;
  color: var(--muted);
}

button.ideas-chip--quiet:hover {
  background: var(--soft-2);
  color: var(--ink);
}

.ideas-chip--input {
  width: 160px;
  padding: 0 14px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent);
  outline: none;
}

.ideas-chip--input::placeholder {
  color: var(--faint);
}

.ideas-chip--small {
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

.ideas-chip--small .ideas-chip__dot {
  width: 7px;
  height: 7px;
}

.ideas-chip--more {
  background: var(--soft-2);
  color: var(--muted);
}

.ideas-chip.has-remove {
  padding-right: 4px;
}

.ideas-chip__x {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: -2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.ideas-chip--small .ideas-chip__x {
  width: 18px;
  height: 18px;
}

.ideas-chip__x:hover {
  background: color-mix(in srgb, var(--topic) 22%, transparent);
  color: var(--ink);
}

.ideas-chip__x svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------- the body */

.ideas-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
  padding-top: 6px;
}

/* Cards are measured here, at the columns' width, before they're placed. */
.ideas-masonry__measure {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--ideas-col-w, 300px);
  visibility: hidden;
  pointer-events: none;
}

.ideas-masonry__measure:empty {
  display: none;
}

.ideas-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ideas-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ideas-section__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 510;
  line-height: 1.2;
}

.ideas-section__title svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.ideas-section__count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* The cards in the board's order, each placed at its column (--x) and its height in it (--y). */
.ideas-masonry {
  position: relative;
  min-width: 0;
  height: var(--ideas-masonry-h, auto);
}

.ideas-masonry > .ideas-card {
  position: absolute;
  top: var(--y, 0);
  left: var(--x, 0);
  width: var(--ideas-col-w);
}

/* -------------------------------------------------------------------- card */

/* A hairline card that lifts like Home's; its cover sits inset with its own radius.
   Every card is the same size, whatever it holds: the notes take the room the rest leaves. */
.ideas-card {
  --ideas-card-h: 420px;
  --ideas-cover-h: 150px;
  position: relative;
  height: var(--ideas-card-h);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg);
  color: var(--ink);
  transition: transform 0.24s var(--ease), border-color 0.2s var(--ease), box-shadow 0.24s var(--ease), background 0.2s var(--ease);
}

@media (hover: hover) {
  .ideas-card:hover {
    z-index: 2;
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-tile);
  }
}

.ideas-card:has(details[open]) {
  z-index: 6;
}

.ideas-card:has(.ideas-card__link:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--ink) 55%, transparent);
  outline-offset: 2px;
  box-shadow: var(--shadow-tile);
}

.ideas-card.is-drop {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 5%, var(--bg));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent);
}

.ideas-card.is-entering {
  animation: ideas-card-in 0.5s var(--ease) both;
}

@keyframes ideas-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

.ideas-card__link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 14px 10px 12px;
  overflow: hidden;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
  -webkit-touch-callout: none;
}

.ideas-card__link:focus-visible {
  outline: none;
}

.ideas-card__link:active {
  transform: scale(0.995);
}

.ideas-card__cover {
  position: relative;
  flex: 0 0 auto;
  height: var(--ideas-cover-h);
  overflow: hidden;
  border-radius: 14px;
  background: var(--tile);
}

.ideas-card__img {
  width: 100%;
  height: 100%;
  /* The whole picture, never cropped: the band's tint shows around it. */
  object-fit: contain;
}

/* A PDF's first page shows from its top, on paper. */
.ideas-card__cover.is-pdf {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.ideas-card__tag,
.ideas-card__extra {
  position: absolute;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ideas-card__tag {
  left: 10px;
}

.ideas-card__extra {
  right: 10px;
}

.ideas-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  transform: translate(-50%, -50%);
}

.ideas-card__play svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
  fill: currentColor;
}

/* The title first, with up to two topics small at its right. */
.ideas-card__head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 8px;
  padding: 0 6px;
}

.ideas-card__title {
  display: -webkit-box;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 510;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.ideas-card__title.is-untitled {
  color: var(--faint);
}

/* The notes as they look, small, filling what the card has left and cut with a fade. */
.ideas-card__notes {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 0 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ideas-card__notes.is-long {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent);
}

.ideas-note {
  display: flex;
  gap: 7px;
  min-width: 0;
  padding-left: calc(var(--d, 0) * 16px);
}

.ideas-note__text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.ideas-note--h {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.ideas-note--h:not(:first-child) {
  margin-top: 4px;
}

.ideas-note--quote {
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  font-style: italic;
}

.ideas-note__mark {
  flex: 0 0 auto;
  min-width: 1em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ideas-note--number .ideas-note__mark {
  min-width: 1.3em;
  text-align: right;
}

.ideas-note__box {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-top: 0.2em;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
}

.ideas-note__box.is-done {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.ideas-note__box svg {
  width: 10px;
  height: 10px;
}

.ideas-note.is-done .ideas-note__text {
  color: var(--faint);
  text-decoration: line-through;
}

.ideas-note .is-b {
  color: var(--ink);
  font-weight: 600;
}

.ideas-note .is-i {
  font-style: italic;
}

.ideas-note .is-u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ideas-note .is-s {
  text-decoration: line-through;
}

.ideas-note .is-u.is-s {
  text-decoration: underline line-through;
}

.ideas-note .is-code {
  padding: 0 4px;
  border-radius: 6px;
  background: var(--soft-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.ideas-note .is-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--whisper);
  text-underline-offset: 2px;
}

.ideas-card__topics {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 4px;
  max-width: 62%;
  margin-top: 1px;
}

/* One row: a long name shortens rather than stacking the chips. */
.ideas-card__topics .ideas-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 112px;
}

.ideas-card__topics .ideas-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* How many files, when it was edited; room at the right for the pin and the ⋯. */
.ideas-card__meta {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  margin-top: auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 30px;
  padding: 0 76px 0 6px;
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ideas-card__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ideas-card__count svg {
  width: 13px;
  height: 13px;
}

.ideas-card__upload {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.ideas-card__upload i {
  position: relative;
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--soft-2);
}

.ideas-card__upload i::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--p, 0) * 100%);
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.3s var(--ease);
}

.ideas-card__upload.is-failed {
  color: var(--danger);
}

.ideas-card__upload.is-failed i {
  display: none;
}

/* The pin and the ⋯ at the card's bottom right: on hover (always on touch), the pin always once pinned. */
.ideas-card__actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.ideas-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow-pill);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s var(--ease), background 0.16s, transform 0.16s var(--ease);
}

.ideas-card__btn:hover {
  background: var(--glass-hover);
}

.ideas-card__btn:active {
  transform: scale(0.94);
}

.ideas-card__btn svg {
  width: 17px;
  height: 17px;
}

.ideas-card__more .dropdown__caret {
  display: none;
}

.ideas-card:hover .ideas-card__btn,
.ideas-card:focus-within .ideas-card__btn,
.ideas-card__actions details[open] > .ideas-card__btn,
.ideas-card__pin.is-on {
  opacity: 1;
}

.ideas-card__pin.is-on {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}

.ideas-card__pin.is-on:hover {
  background: color-mix(in srgb, var(--ink) 85%, transparent);
}

.ideas-card__pin.is-on svg {
  fill: currentColor;
}

.ideas-card__actions .menu__panel {
  top: auto;
  bottom: calc(100% + 6px);
  min-width: 220px;
}

@media (hover: none) {
  .ideas-card__btn {
    opacity: 1;
  }
}

/* ------------------------------------------------------------------ empties */

.ideas-empty {
  padding: 72px 24px;
}

.ideas-empty .empty__actions .btn svg {
  width: 18px;
  height: 18px;
}

/* A quiet picture: three small cards fanned out, a bulb on the front one. */
.ideas-empty__art {
  position: relative;
  width: 150px;
  height: 96px;
}

.ideas-empty__art span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 72px;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-tile);
  transform: translateX(-50%) rotate(var(--r, 0deg)) translateX(var(--x, 0px));
}

.ideas-empty__art span:nth-child(1) {
  --r: -10deg;
  --x: -34px;
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
}

.ideas-empty__art span:nth-child(3) {
  --r: 10deg;
  --x: 34px;
  background: color-mix(in srgb, #2f9e44 10%, var(--surface));
}

.ideas-empty__art span:nth-child(2) {
  z-index: 1;
  top: 0;
  background:
    radial-gradient(circle at 50% 38%, var(--blue) 0 9px, transparent 10px),
    linear-gradient(var(--line-strong), var(--line-strong)) 14px 62px / 44px 4px no-repeat,
    linear-gradient(var(--line), var(--line)) 14px 70px / 30px 4px no-repeat,
    var(--surface);
}

/* --------------------------------------------------------------- skeleton */

.ideas-skel {
  display: block;
  border-radius: 999px;
  background: var(--soft-2);
  animation: ideas-shimmer 1.4s ease-in-out infinite;
}

.ideas-skel--title {
  width: 140px;
  height: 30px;
}

.ideas-skel--pill {
  width: 96px;
  height: 36px;
}

.ideas-skel-grid {
  columns: 4 260px;
  column-gap: 16px;
}

.ideas-skel--card {
  height: var(--h, 200px);
  margin-bottom: 16px;
  border-radius: 22px;
  break-inside: avoid;
}

@keyframes ideas-shimmer {
  50% {
    opacity: 0.5;
  }
}

/* ------------------------------------------------------------- the top bar */

.ideas-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 8px 0 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, color-mix(in srgb, var(--bg) 80%, transparent));
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  color: var(--ink);
  transition: background 0.2s var(--ease), box-shadow 0.4s var(--ease-std);
}

.ideas-search:hover {
  background: var(--glass-hover);
}

html.is-scrolled .ideas-search,
.ideas-search:focus-within {
  background: var(--glass);
  box-shadow: var(--shadow-pill);
}

.ideas-search__icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}

.ideas-search:focus-within .ideas-search__icon {
  color: var(--ink);
}

.ideas-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.ideas-search__input::placeholder {
  color: color-mix(in srgb, var(--ink) 60%, transparent);
}

.ideas-search__input::-webkit-search-cancel-button,
.ideas-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.ideas-search__clear {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.ideas-search__clear:hover {
  background: var(--soft-2);
  color: var(--ink);
}

.ideas-search__clear svg {
  width: 16px;
  height: 16px;
}

.ideas-search__kbd {
  flex: 0 0 auto;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--faint);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.ideas-search:focus-within .ideas-search__kbd,
.ideas-search__input:not(:placeholder-shown) ~ .ideas-search__kbd {
  display: none;
}

/* The round button the search folds into on a phone. */
.ideas-search__open {
  position: relative;
  display: none;
}

.ideas-search.has-value .ideas-search__open::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px var(--bg);
}

.ideas-menu .menu__panel {
  width: 280px;
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ideas-menu .menu__foot {
  padding: 2px 16px 10px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ----------------------------------------------------------------- picker */

.ideas-picker {
  position: fixed;
  top: var(--y, 80px);
  bottom: var(--b, auto);
  left: var(--x, 16px);
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: var(--w, 320px);
  max-height: min(420px, calc(100dvh - 32px));
  padding: 6px;
  border-radius: 24px;
  background: var(--glass-menu);
  -webkit-backdrop-filter: blur(36px) saturate(150%);
  backdrop-filter: blur(36px) saturate(150%);
  box-shadow: var(--shadow-pill);
  color: var(--ink);
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.16s var(--ease), transform 0.2s var(--ease);
}

.ideas-picker.is-above {
  transform-origin: bottom left;
}

.ideas-picker.is-open {
  opacity: 1;
  transform: none;
}

.ideas-picker.is-leaving {
  opacity: 0;
  transform: scale(0.98);
  transition-duration: 0.12s;
}

.ideas-picker__field {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--soft-2);
}

.ideas-picker__field svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.ideas-picker__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.ideas-picker__input::placeholder {
  color: var(--faint);
}

.ideas-picker__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ideas-picker__row {
  --topic: var(--ink);
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.12s;
}

.ideas-picker__row:hover,
.ideas-picker__row.is-active {
  background: var(--soft-2);
}

.ideas-picker__row.is-create {
  color: var(--blue);
}

.ideas-picker__row.is-create svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.ideas-picker__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ideas-picker__name b {
  font-weight: 510;
}

.ideas-picker__tick {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  transition: background 0.12s, border-color 0.12s;
}

.ideas-picker__tick.is-on {
  border-color: var(--topic);
  background: var(--topic);
  color: #fff;
}

.ideas-picker__tick svg {
  width: 12px;
  height: 12px;
}

.ideas-picker__empty,
.ideas-picker__note {
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.ideas-picker__note {
  flex: 0 0 auto;
  padding: 4px 14px 6px;
  font-size: 13px;
}

/* ------------------------------------------------------------ topics sheet */

.ideas-topicset {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ideas-topicset__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ideas-topicset__list:empty {
  display: none;
}

.ideas-topicset__row {
  --topic: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.16s, border-radius 0.16s;
}

.ideas-topicset__row:has(.ideas-topicset__swatches:not([hidden])) {
  border-radius: 24px;
}

.ideas-topicset__row:focus-within {
  border-color: var(--line-strong);
}

.ideas-topicset__line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ideas-topicset__colour,
.ideas-topicset__remove {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.ideas-topicset__colour:hover,
.ideas-topicset__colour[aria-expanded='true'] {
  background: color-mix(in srgb, var(--topic) 14%, transparent);
}

.ideas-topicset__colour .ideas-chip__dot {
  width: 14px;
  height: 14px;
}

.ideas-topicset__remove:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.ideas-topicset__remove svg {
  width: 17px;
  height: 17px;
}

.ideas-topicset__name {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color 0.16s, background 0.16s;
}

.ideas-topicset__name:hover {
  background: var(--soft-1);
}

.ideas-topicset__name:focus {
  border-color: color-mix(in srgb, var(--ink) 40%, transparent);
  background: transparent;
}

.ideas-topicset__count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ideas-topicset__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px 8px 44px;
}

.ideas-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--topic);
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s;
}

.ideas-swatch:hover {
  transform: scale(1.1);
}

.ideas-swatch[aria-checked='true'] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--topic);
}

.ideas-topicset__empty {
  color: var(--muted);
  font-size: 15px;
}

.ideas-topicset__new {
  display: flex;
  gap: 8px;
}

.ideas-topicset__new-input {
  flex: 1 1 auto;
  height: 44px;
}

/* ----------------------------------------------------------------- panel */
/* One idea over the board: the page dims, and a large sheet (up to 960 px;
   the whole screen on a phone) rises from the card it opened, scrolling
   inside. Shown with dialog.show(), the board behind made inert. */

html.has-ideas-panel {
  overflow: hidden;
}

.ideas-panel {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 32px 24px;
  border: 0;
  background: color-mix(in srgb, #05070b 42%, transparent);
  color: var(--ink);
  overflow: hidden;
  opacity: 0;
  /* Quick: an idea should feel open the moment it's asked for. */
  transition: opacity 0.14s var(--ease);
}

.ideas-panel[open] {
  display: grid;
  place-items: center;
}

.ideas-panel.is-open {
  opacity: 1;
}

.ideas-panel__box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  height: 100%;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--bg);
  box-shadow: inset 0 1px 0 0 var(--glass-shine), 0 30px 90px rgba(0, 0, 0, 0.26);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.2s var(--ease);
}

.ideas-panel__box > * {
  flex: 1 0 auto;
  min-width: 0;
}

/* From the card: the sheet grows out of where the card was. */
.ideas-panel.has-origin .ideas-panel__box {
  transform: scale(0.95);
  transform-origin: calc(var(--from-x, 50vw) - (100vw - min(960px, 100vw - 48px)) / 2) calc(var(--from-y, 50vh) - 32px);
}

.ideas-panel.is-open .ideas-panel__box {
  transform: none;
}

.ideas-panel__box:focus {
  outline: none;
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 900px) {
  .ideas-head__title {
    font-size: 24px;
  }

  .ideas-search {
    padding: 0 6px 0 16px;
    background: var(--glass);
    box-shadow: var(--shadow-pill);
  }

  .ideas-search__kbd {
    display: none;
  }

  .ideas-search__input {
    font-size: 16px;
  }

  .ideas-skel-grid {
    columns: 2 200px;
    column-gap: 12px;
  }
}

@media (max-width: 640px) {
  .ideas-board {
    gap: 14px;
    padding-top: 4px;
  }

  /* The topics scroll sideways in one row, edge to edge. */
  .ideas-topics {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    margin: 0 -16px;
    padding: 2px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .ideas-topics::-webkit-scrollbar {
    display: none;
  }

  /* One row: the sort, the archive and the view show as icons. */
  .ideas-toolbar__end {
    position: relative;
    flex-wrap: nowrap;
    width: 100%;
  }

  .ideas-toolbar__end > * {
    flex-shrink: 0;
  }

  /* The sort's menu opens from the row's left edge, on screen (not from their buttons' right edges, off it). */
  .ideas-toolbar__end .dropdown {
    position: static;
  }

  .ideas-toolbar__end .dropdown .menu__panel {
    right: auto;
    left: 0;
  }

  .ideas-toolbar__end .dropdown[open] .menu__panel {
    transform-origin: top left;
  }

  .ideas-toolbar__archived span,
  .ideas-toolbar__views .segmented__btn span,
  .ideas-toolbar__sort .ideas-toolbar__label,
  .ideas-toolbar__sort .dropdown__caret {
    display: none;
  }

  .ideas-toolbar__sort {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .ideas-toolbar__archived {
    width: 44px;
    padding: 0;
  }

  .ideas-toolbar__views {
    margin-left: auto;
  }

  .ideas-empty {
    padding: 56px 16px;
  }

  .ideas-panel {
    padding: 0;
  }

  .ideas-panel__box {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(16px);
  }

  .ideas-panel.has-origin .ideas-panel__box {
    transform: translateY(16px);
  }

  .ideas-skel-grid {
    columns: 1;
  }
}

/* A phone: the search folds into a round button beside New idea, and opens across the bar. */
@media (max-width: 520px) {
  html[data-app='ideas'] .topbar__center {
    justify-content: flex-end;
  }

  .ideas-search:not(.is-expanded) {
    width: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .ideas-search:not(.is-expanded) > :not(.ideas-search__open) {
    display: none;
  }

  .ideas-search:not(.is-expanded) > .ideas-search__open {
    display: inline-flex;
  }

  .topbar.has-ideas-search > .topbar__group {
    visibility: hidden;
  }

  .ideas-search.is-expanded {
    position: absolute;
    top: 50%;
    right: 8px;
    left: 8px;
    z-index: 3;
    width: auto;
    transform: translateY(-50%);
  }
}

/* A narrow phone (360 px): a little less room between the head's controls. */
@media (max-width: 400px) {
  .ideas-toolbar__end {
    gap: 6px;
  }

  .ideas-toolbar__views .segmented__btn {
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ideas-card:hover,
  .ideas-card__link:active,
  .ideas-panel__box,
  .ideas-panel.has-origin .ideas-panel__box {
    transform: none;
  }

  .ideas-card.is-entering,
  .ideas-skel {
    animation: none;
  }
}
