/* SPEC-196 v1.1.0 FR-25 … FR-30: the launchpad's own parts. The shell, header, tabs, tiles, buttons, dialogs and the
   tokens come from the composite app kit (/kit/kit.css, SPEC-197); this file styles only what the launchpad alone has. */

/* FR-29: the search in the header */
.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.search input {
  width: 100%; font: inherit; padding: 8px 12px 8px 36px; border-radius: 999px; border: 1px solid var(--kit-line);
  background: var(--kit-bg); color: var(--kit-text);
}
.search-icon {
  position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%);
  fill: none; stroke: var(--kit-muted); stroke-width: 2; stroke-linecap: round;
}
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--kit-surface); border: 1px solid var(--kit-line); border-radius: 12px; box-shadow: var(--kit-shadow-hover); z-index: 30;
}
.search-hit { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.search-hit:hover, .search-hit.active { background: var(--kit-accent-soft); }
.search-hit .kit-icon { width: 32px; height: 32px; border-radius: 8px; }
.search-hit .kit-icon svg { width: 18px; height: 18px; }
.search-none { padding: 10px; color: var(--kit-muted); }

/* FR-26: a space's sections; the tile's text */
.section { margin: 8px 0 28px; }
#space-title { margin-bottom: 20px; }
.tile-name { font-weight: 650; font-size: 16px; line-height: 1.3; }
.tile-description {
  color: var(--kit-muted); font-size: 13px; margin-top: 4px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.kit-tile.wide .tile-description { -webkit-line-clamp: 4; line-clamp: 4; }
.kit-tile .kit-icon { margin-top: auto; }

/* FR-27: edit mode */
.kit-tile.editing { border-style: dashed; }
.tile-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; }
.tool {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--kit-line); background: var(--kit-bg); color: var(--kit-text);
  font: inherit; font-size: 14px; cursor: pointer;
}
.tool:hover:not(:disabled) { border-color: var(--kit-accent); color: var(--kit-accent); }
.tool.remove:hover { border-color: var(--kit-error); color: var(--kit-error); }
.tool:disabled { opacity: 0.35; cursor: default; }

/* FR-28: App Finder */
.filter { min-width: 240px; }
.finder-group { margin: 16px 0 24px; }
.finder-items {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px;
}
.finder-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; background: var(--kit-surface);
  border: 1px solid var(--kit-line); border-radius: 12px;
}
.finder-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: var(--kit-text); text-decoration: none; }
.finder-text { display: flex; flex-direction: column; min-width: 0; }
.finder-name { font-weight: 600; }
.finder-description { color: var(--kit-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none;
  color: var(--kit-muted); cursor: pointer; flex: none;
}
.star svg { width: 22px; height: 22px; fill: none; stroke: currentcolor; stroke-width: 1.8; stroke-linejoin: round; }
.star:hover { background: var(--kit-accent-soft); }
.star.on { color: var(--kit-star); }
.star.on svg { fill: currentcolor; }

/* A tile with its star (My Home and the space pages): the cell is the grid item, the star sits in the tile's corner. The
   star shows on hover or focus; on My Home and once on, it always shows. */
.tile-cell { position: relative; display: grid; }
.tile-cell.wide { grid-column: span 2; }
.tile-cell > .kit-tile { grid-column: auto; min-width: 0; }
.tile-star { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; opacity: 0; transition: opacity 120ms ease; }
.tile-star svg { width: 20px; height: 20px; }
.tile-cell:hover .tile-star, .tile-star:focus-visible, .tile-star.on { opacity: 1; }
@media (hover: none) { .tile-star { opacity: 1; } }
.kit-tab#home-tab.drop-target { outline: 1px solid var(--kit-accent); background: var(--kit-accent-soft); border-radius: 10px; }

/* SPEC-199: arranging the tabs by drag and drop (v1.1.0 FR-15, v1.2.0 FR-19) */
.kit-tabs { align-items: center; }
.tab-drag { display: inline-flex; border: 1px solid transparent; border-radius: 10px; }
.tab-drag.drop-target { border-color: var(--kit-accent); background: var(--kit-accent-soft); }
.kit-tile.dragging { opacity: 0.5; }
.kit-tile[draggable="true"]:active { cursor: grabbing; }
/* The empty end of the tab bar: invisible until a tile is dragged, then a dashed "+ New tab" target. */
.new-tab-zone {
  flex: 1; align-self: stretch; display: flex; align-items: center; justify-content: center; min-width: 140px;
  margin: 6px 0 6px 8px; border: 2px dashed transparent; border-radius: 10px; color: transparent; font-size: 13px; font-weight: 600;
  pointer-events: none;
}
body.dragging-tile .new-tab-zone { border-color: var(--kit-line); color: var(--kit-muted); pointer-events: auto; }
body.dragging-tile .new-tab-zone.drop-target { border-color: var(--kit-accent); background: var(--kit-accent-soft); color: var(--kit-accent); }
