/* ═══════════════════════════════════════════════════════════════════
   overview.css — Activities overview, workspace strip, app grid, search
   ═══════════════════════════════════════════════════════════════════ */

.overview {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding-top: var(--topbar-h);
  background: rgba(0, 0, 0, .28);
  opacity: 0;
  transition: opacity 260ms var(--ease), backdrop-filter 260ms;
  pointer-events: none;
}
.shell.overview-open .overview { opacity: 1; pointer-events: auto; }
.overview .ov-inner {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding-left: var(--dock-w);
  transition: transform 300ms var(--ease-out);
}
.shell[data-dock-position="bottom"] .overview .ov-inner { padding-left: 0; padding-bottom: calc(var(--dock-icon) + 20px); }
.shell[data-dock-position="right"] .overview .ov-inner { padding-left: 0; padding-right: var(--dock-w); }

/* search entry */
.ov-search-wrap { flex: none; display: flex; justify-content: center; padding: 18px 0 10px; }
.ov-search {
  display: flex; align-items: center; gap: 8px;
  width: 340px; max-width: 60%; min-height: 36px; padding: 0 14px;
  background: rgba(255,255,255,.14); border-radius: 999px;
  color: #fff; font-size: 14.5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  transition: width 220ms var(--ease-out), background var(--t-med), box-shadow var(--t-med);
  backdrop-filter: blur(8px);
}
.ov-search:focus-within { background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); width: 420px; }
.ov-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font-size: 14.5px; }
.ov-search input::placeholder { color: rgba(255,255,255,.7); }
.ov-search .sym { opacity: .8; }

/* workspace thumbnails */
.ov-workspaces {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 6px 30px 10px;
  transition: opacity 200ms var(--ease), height 260ms var(--ease-out), padding 260ms;
  overflow: hidden;
}
.ov-ws-thumb {
  position: relative; flex: none;
  border-radius: 8px; overflow: hidden;
  background-size: cover; background-position: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.14);
  transition: box-shadow 180ms var(--ease), transform 180ms var(--ease-out), opacity 180ms;
  cursor: pointer;
}
.ov-ws-thumb:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.3); }
.ov-ws-thumb.active { box-shadow: 0 4px 16px rgba(0,0,0,.45), inset 0 0 0 2px #fff; }
.ov-ws-thumb.drop-target { box-shadow: 0 0 0 2px var(--accent-shell), 0 4px 16px rgba(0,0,0,.5); }
.ov-ws-thumb .ws-win {
  position: absolute; border-radius: 2px;
  background: rgba(250,250,250,.9);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  overflow: hidden;
  display: grid; place-items: center;
}
[data-color-scheme="dark"] .ov-ws-thumb .ws-win { background: rgba(58,58,58,.95); }
.ov-ws-thumb .ws-win img { width: 60%; height: 60%; max-width: 22px; max-height: 22px; opacity: .95; }
.ov-ws-thumb .ws-win-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(0,0,0,.18); }
.ov-ws-thumb.empty::after {
  content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.25);
}

/* window spread */
.ov-windows { flex: 1; min-height: 0; position: relative; transition: opacity 200ms var(--ease); }
.ov-slot {
  position: absolute;
  border-radius: 10px;
  transition: transform 240ms var(--ease-out), opacity 200ms;
  pointer-events: auto;
  cursor: pointer;
}
.ov-slot .ov-label {
  position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 7px;
  max-width: 100%; padding: 3px 10px; border-radius: 999px;
  background: rgba(20,20,20,.75); color: #fff; font-size: 12.5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity 160ms var(--ease);
  backdrop-filter: blur(6px);
}
.ov-slot .ov-label img { width: 16px; height: 16px; }
.ov-slot:hover .ov-label, .ov-slot.hot .ov-label { opacity: 1; }
.ov-slot .ov-close {
  position: absolute; right: -10px; top: -10px;
  width: 26px; height: 26px; border-radius: 999px;
  background: #f2f2f2; color: #1a1a1a;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  opacity: 0; transform: scale(.7);
  transition: opacity 140ms var(--ease), transform 160ms var(--ease-spring), background 120ms;
}
.ov-slot:hover .ov-close, .ov-slot.hot .ov-close { opacity: 1; transform: none; }
.ov-slot .ov-close:hover { background: #fff; }
.ov-slot .ov-highlight {
  position: absolute; inset: -4px; border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.55);
  opacity: 0; transition: opacity 140ms;
}
.ov-slot:hover .ov-highlight { opacity: 1; }
.ov-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(255,255,255,.7); font-size: 15px; text-align: center; gap: 10px;
}
.ov-empty .oe-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ov-empty .sym { opacity: .5; }

/* overview windows: real window elements are transformed into slots */
.shell.overview-open .win { transition: transform 260ms var(--ease-out), opacity 200ms, box-shadow 200ms; }
.shell.overview-open .win.in-overview { pointer-events: none; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.shell.overview-open .win .win-body { pointer-events: none; }
.shell.overview-open .win.other-workspace { opacity: 0; pointer-events: none; }

/* desktop icons step out of the way during the overview */
#desktop { transition: opacity 220ms var(--ease); }
.shell.overview-open #desktop { opacity: 0; pointer-events: none; }

/* windows fade out when the app grid or search takes over the overview */
#workspace-viewport { transition: opacity 220ms var(--ease); }
.shell.appgrid-open #workspace-viewport,
.shell.overview-search #workspace-viewport { opacity: 0; pointer-events: none; }

/* ── search results ─────────────────────────────────────────────── */
.ov-results {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px 40px 30px;
  display: none; flex-direction: column; gap: 22px;
}
.shell.overview-search .ov-results { display: flex; animation: fade-in 180ms var(--ease); }
.shell.overview-search .ov-windows, .shell.overview-search .ov-workspaces { display: none; }
.res-section { display: flex; flex-direction: column; gap: 8px; }
.res-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .6px;
}
.res-head::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.14); }
.res-apps { display: flex; flex-wrap: wrap; gap: 6px; }
.res-app {
  width: 108px; padding: 10px 6px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: #fff; text-align: center; font-size: 12.5px;
  transition: background var(--t-fast);
}
.res-app img { width: 54px; height: 54px; }
.res-app .ra-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-app:hover, .res-app.sel { background: rgba(255,255,255,.16); }
.res-list { display: flex; flex-direction: column; gap: 2px; max-width: 780px; }
.res-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 10px; color: #fff;
  transition: background var(--t-fast);
  text-align: left;
}
.res-row .sym, .res-row img { flex: none; }
.res-row:hover, .res-row.sel { background: rgba(255,255,255,.16); }
.res-row img { width: 32px; height: 32px; }
.res-row .rr-text { flex: 1; min-width: 0; }
.res-row .rr-title { font-size: 13.5px; }
.res-row .rr-sub { font-size: 12px; color: rgba(255,255,255,.65); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row .rr-meta { font-size: 12px; color: rgba(255,255,255,.55); }
.res-empty { color: rgba(255,255,255,.75); font-size: 15px; text-align: center; padding: 60px 0; }
.res-calc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.1); max-width: 420px; }
.res-calc .rc-expr { font-size: 14px; color: rgba(255,255,255,.7); }
.res-calc .rc-value { font-size: 24px; font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; }
.res-hint { font-size: 12px; color: rgba(255,255,255,.5); }

/* ── app grid ───────────────────────────────────────────────────── */
.ov-appgrid {
  flex: 1; min-height: 0; display: none; flex-direction: column;
  padding: 10px 0 4px;
  animation: grid-in 260ms var(--ease-out);
}
.shell.appgrid-open .ov-appgrid { display: flex; }
.shell.appgrid-open .ov-windows, .shell.appgrid-open .ov-workspaces { display: none; }
@keyframes grid-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.ag-pages { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.ag-track { display: flex; height: 100%; transition: transform 320ms var(--ease-out); }
.ag-page {
  flex: none; width: 100%; height: 100%;
  display: grid; grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(0, 150px);
  gap: 6px; padding: 6px 56px; align-content: center; justify-content: center;
  overflow: hidden;
}
.ag-item {
  border-radius: 14px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
  color: #fff; text-align: center;
  transition: background 130ms var(--ease), transform 130ms var(--ease);
  position: relative;
  min-height: 0;
}
.ag-item img { width: 74px; height: 74px; max-width: 100%; pointer-events: none; }
.ag-item .ag-name {
  font-size: 13px; line-height: 1.25; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.ag-item:hover { background: rgba(255,255,255,.14); }
.ag-item:active { transform: scale(.96); }
.ag-item.dragging { opacity: .35; }
.ag-item.drop-into { background: rgba(255,255,255,.28); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.ag-folder .ag-folder-grid {
  width: 74px; height: 74px; border-radius: 16px;
  background: rgba(255,255,255,.15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; padding: 8px;
}
.ag-folder .ag-folder-grid img { width: 100%; height: 100%; }
.ag-arrow {
  position: absolute; top: 0; bottom: 0; width: 48px;
  display: grid; place-items: center; color: #fff; opacity: .55;
  transition: opacity var(--t-fast), background var(--t-fast);
  z-index: 3;
}
.ag-arrow:hover { opacity: 1; background: rgba(255,255,255,.08); }
.ag-arrow.prev { left: 0; } .ag-arrow.next { right: 0; }
.ag-dots { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 0 6px; }
.ag-dots i {
  width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.35);
  transition: background var(--t-fast), transform var(--t-fast);
  cursor: pointer;
}
.ag-dots i.on { background: #fff; transform: scale(1.15); }

/* folder popup */
.ag-folder-popup {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(680px, 76%); max-height: 70%;
  background: rgba(56, 56, 56, .92);
  backdrop-filter: blur(24px);
  border-radius: 18px; padding: 16px;
  box-shadow: var(--shell-shadow-lg), 0 0 0 1px rgba(255,255,255,.1);
  animation: folder-in 220ms var(--ease-out);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 10;
}
@keyframes folder-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%); } }
.ag-folder-popup .fp-title {
  align-self: center; background: none; border: 0; color: #fff; text-align: center;
  font-size: 16px; font-weight: 500; padding: 4px 10px; border-radius: 8px;
}
.ag-folder-popup .fp-title:hover { background: rgba(255,255,255,.1); }
.ag-folder-popup .fp-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; overflow-y: auto;
}
.ag-folder-scrim { position: absolute; inset: 0; z-index: 9; }
